/* Scoped Didgah skin: retain YITH/DataTables column measurements. */
#yith-woocompare-preview-bar,
.yith-woocompare-popup-container,
#yith-woocompare,
#didgah-compare-notice {
    --dc-navy: #10243d;
    --dc-gold: #e5bc68;
    --dc-line: #e6ebf2;
}
#yith-woocompare-preview-bar {
    inset-inline: 20px;
    bottom: max(20px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 1080px;
    margin-inline: auto;
    padding: 18px 22px;
    border: 1px solid #ffffff26;
    border-radius: 22px;
    background: linear-gradient(125deg, #10243df5, #1b3451f5);
    box-shadow: 0 16px 50px #08182e42, inset 0 1px 0 #ffffff0d;
    color: #fff;
    backdrop-filter: blur(18px);
    z-index: 990;
    font: inherit;
}
#yith-woocompare-preview-bar .container {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    max-width: none;
}
#yith-woocompare-preview-bar header { display: block; flex: 1; min-width: 160px; }
#yith-woocompare-preview-bar header p { margin: 6px 0 0; color: #d6dfeb; font-size: 12px; line-height: 1.8; }
#yith-woocompare-preview-bar .didgah-compare-heading { display: block; color: #fff; font-size: 16px; font-weight: 700; }
#yith-woocompare-preview-bar .didgah-compare-count { color: var(--dc-gold); font-size: 12px; margin-inline-start: 8px; white-space: nowrap; }
#yith-woocompare-preview-bar .content { min-width: 0; }
#yith-woocompare-preview-bar .compare-list { gap: 12px; }
#yith-woocompare-preview-bar .compare-list li,
#yith-woocompare-preview-bar .compare-list li.product-placeholder {
    display: flex;
    flex: 0 0 62px;
    width: 62px;
    min-height: 62px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
    box-sizing: border-box;
}
#yith-woocompare-preview-bar .compare-list li.product-placeholder { border: 1px dashed #ffffff35; color: #b9c7d8; background: #ffffff04; }
#yith-woocompare-preview-bar .compare-list .image-wrap { width: 62px; height: 62px; }
#yith-woocompare-preview-bar .compare-list .image-wrap > a { height: 62px; border-radius: 12px; overflow: hidden; background: #fff; }
#yith-woocompare-preview-bar .compare-list .image-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 5px; box-sizing: border-box; transition: transform .2s ease; }
#yith-woocompare-preview-bar .compare-list .image-wrap:hover img { transform: scale(1.06); }
#yith-woocompare-preview-bar .compare-list .image-wrap .remove a {
    top: -7px; right: -7px; width: 24px; height: 24px; line-height: 24px;
    background: #edf2f8; color: #18324e; border: 2px solid #19304b;
    transition: background .18s, color .18s, transform .18s;
}
#yith-woocompare-preview-bar .compare-list .image-wrap .remove a::after { font-size: 19px; }
#yith-woocompare-preview-bar .compare-list .image-wrap .remove a:hover { background: #fce3dd; color: #a63222; transform: rotate(8deg); }
#yith-woocompare-preview-bar footer { flex: 0 0 auto; }
#yith-woocompare-preview-bar footer > a,
#yith-woocompare .button:not(.yith_woocompare_clear) {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 44px; padding: 11px 20px; border: 0; border-radius: 12px;
    background: linear-gradient(120deg, #f1d28e, #e0b65e); color: #12253c;
    box-shadow: 0 4px 14px #00000012; font: inherit; font-weight: 700; font-size: 13px;
    text-decoration: none; line-height: 1.5;
    transition: transform .18s, box-shadow .18s, opacity .18s;
}
#yith-woocompare-preview-bar footer > a:hover,
#yith-woocompare .button:not(.yith_woocompare_clear):hover { transform: translateY(-2px); box-shadow: 0 7px 18px #d3a34930; color: #10243d; }
#yith-woocompare-preview-bar footer > a[aria-disabled="true"] { opacity: .6; }
#yith-woocompare-preview-bar footer > a[aria-busy="true"]::after {
    content: ''; width: 14px; height: 14px; border: 2px solid #10243d40;
    border-top-color: #10243d; border-radius: 50%; animation: dc-spin .7s linear infinite;
}
#yith-woocompare-preview-bar a:focus-visible,
.yith-woocompare-popup-container a:focus-visible,
.yith-woocompare-popup-container button:focus-visible { outline: 3px solid #e5bc68; outline-offset: 4px; }
.yith-woocompare-popup-container { background: #091b32b8; backdrop-filter: blur(8px); z-index: 10000; }
.yith-woocompare-popup-container .yith-woocompare-table-wrapper { overflow-y: auto; overscroll-behavior: contain; }
.yith-woocompare-popup-container .yith-woocompare-table-scroll-wrapper { padding: 66px 28px 28px; max-width: 1440px; margin-inline: auto; }
.yith-woocompare-popup-container #yith-woocompare {
    background: #fff; padding: 24px; border-radius: 20px; color: #22354d;
    box-shadow: 0 20px 60px #00000030;
}
a.yith-woocompare-popup-close { top: 14px; right: 28px; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; font-size: 28px; line-height: 1; border-radius: 50%; color: #fff; background: #ffffff20; transition: background .18s, transform .18s; }
a.yith-woocompare-popup-close:hover { color: #10243d; background: #e5bc68; transform: rotate(8deg); }
#yith-woocompare h2 { color: #10243d; font-size: 24px; font-weight: 700; margin: 0 0 20px; }
#yith-woocompare table.compare-list tbody th:not(.filler) { background: #f4f7fb; color: #18324e; }
#yith-woocompare table.compare-list tbody tr:nth-child(even) { background: #fafbfd; }
#yith-woocompare table.compare-list tbody td,
#yith-woocompare table.compare-list tbody th { border-color: var(--dc-line); line-height: 1.8; }
#yith-woocompare table.compare-list tbody tr:not(.stock):hover td { background-color: #fbf6e9; }
#yith-woocompare table.compare-list .product_title { color: #10243d; font-weight: 700; line-height: 1.8; }
#yith-woocompare table.compare-list .image-wrap img { max-height: 180px; object-fit: contain; }
#yith-woocompare table.compare-list tr.price { color: #10243d; font-weight: 700; }
#yith-woocompare .dataTables_scrollBody { scrollbar-color: #b4bfd0 #f3f6fa; scrollbar-width: thin; }
#yith-woocompare .dataTables_scrollBody::-webkit-scrollbar { height: 8px; }
#yith-woocompare .dataTables_scrollBody::-webkit-scrollbar-thumb { background: #b4bfd0; border-radius: 20px; }
#yith-woocompare .empty-comparison { margin: 40px auto; padding: 28px; border: 1px dashed #d1dae7; border-radius: 16px; background: #f6f8fb; color: #263d58; }
#yith-woocompare a.yith_woocompare_clear { background: #fff2ee; border-radius: 9px; color: #9d3422; }
#didgah-compare-notice {
    position: fixed; inset-inline: 16px; bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 10001; max-width: 500px; margin-inline: auto; padding: 14px 20px;
    border: 1px solid #ddc18c; border-inline-start: 4px solid #e5bc68; border-radius: 14px;
    background: #fff; color: #10243d; box-shadow: 0 8px 30px #08182e26;
    text-align: start; font: inherit; font-size: 14px; line-height: 1.8;
}
body.didgah-compare-bar-visible #didgah-compare-notice { bottom: calc(var(--dc-bar-height, 112px) + 36px); }
#didgah-compare-notice[hidden] { display: none; }
html[dir="rtl"] #didgah-compare-notice,
html[dir="rtl"] #yith-woocompare .empty-comparison { direction: rtl; }
html[dir="rtl"] #yith-woocompare .description,
html[dir="rtl"] #yith-woocompare .product_info { text-align: right; }
#yith-woocompare-preview-bar.dc-enter { animation: dc-rise .32s ease-out both; }
#yith-woocompare-preview-bar .dc-new-product { animation: dc-card .4s ease-out both; }
body.yith-woocompare-popup-open .yith-woocompare-table-scroll-wrapper { animation: dc-rise .26s ease-out; }
#didgah-compare-notice:not([hidden]) { animation: dc-rise .24s ease-out; }
@keyframes dc-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dc-card { from { opacity: .4; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes dc-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
    #yith-woocompare-preview-bar .container { gap: 16px; }
    #yith-woocompare-preview-bar header { min-width: 120px; }
    #yith-woocompare-preview-bar .compare-list li.product-placeholder { display: none; }
}
@media (max-width: 600px) {
    #yith-woocompare-preview-bar { inset-inline: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 14px; border-radius: 18px; }
    #yith-woocompare-preview-bar .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
    #yith-woocompare-preview-bar header { min-width: 0; }
    #yith-woocompare-preview-bar .didgah-compare-heading { font-size: 14px; }
    #yith-woocompare-preview-bar .didgah-compare-count { display: block; margin-inline-start: 0; margin-top: 4px; }
    #yith-woocompare-preview-bar header p { font-size: 11px; }
    #yith-woocompare-preview-bar header br { display: none; }
    #yith-woocompare-preview-bar .content { grid-column: 1 / -1; grid-row: 2; overflow: auto; padding: 7px 3px 2px; }
    #yith-woocompare-preview-bar footer { grid-column: 2; grid-row: 1; }
    #yith-woocompare-preview-bar footer > a { padding: 10px 13px; font-size: 12px; }
    #yith-woocompare-preview-bar .compare-list { gap: 10px; }
    #yith-woocompare-preview-bar .compare-list li:not(.product-placeholder) { display: flex; }
    .yith-woocompare-popup-container .yith-woocompare-table-scroll-wrapper { padding: 60px 8px 12px; }
    .yith-woocompare-popup-container #yith-woocompare { padding: 14px 8px; border-radius: 14px; }
    a.yith-woocompare-popup-close { right: 12px; }
    #yith-woocompare h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    #yith-woocompare-preview-bar, #yith-woocompare-preview-bar *,
    .yith-woocompare-popup-container *, #didgah-compare-notice {
        animation: none !important; transition: none !important;
    }
}

/* Product identity remains visible in the preview, including after AJAX updates. */
#yith-woocompare-preview-bar .content { overflow-x: auto; padding: 8px 4px 4px; scrollbar-width: thin; scrollbar-color: #70849e transparent; }
#yith-woocompare-preview-bar .compare-list li:not(.product-placeholder) { flex-direction: column; gap: 8px; flex-basis: 86px; width: 86px; }
#yith-woocompare-preview-bar .didgah-preview-product-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    width: 86px; overflow: hidden; overflow-wrap: anywhere; min-height: 34px;
    color: #edf2f8; font-size: 11px; line-height: 1.6; text-align: center;
    text-decoration: none; unicode-bidi: plaintext;
}
#yith-woocompare-preview-bar .didgah-preview-product-name:hover { color: #e5bc68; }
#yith-woocompare .product_title { overflow-wrap: anywhere; unicode-bidi: plaintext; }
/* Explicit controls and a compact, scrollable mobile comparison. */
#yith-woocompare-preview-bar footer { display: flex; flex-direction: column; gap: 8px; }
#yith-woocompare-preview-bar .didgah-clear-compare { border: 1px solid #ffffff38; border-radius: 10px; background: transparent; color: #e3eaf3; padding: 8px 12px; font: inherit; font-size: 12px; cursor: pointer; min-height: 36px; }
#yith-woocompare-preview-bar .didgah-clear-compare:hover { background: #ffffff12; }
#yith-woocompare-preview-bar .didgah-remove-product { position: absolute; top: -8px; right: -8px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 2px solid #19304b; border-radius: 50%; background: #edf2f8; color: #18324e; font-size: 23px; cursor: pointer; }
#yith-woocompare-preview-bar button:focus-visible { outline: 3px solid #e5bc68; outline-offset: 3px; }
#yith-woocompare-preview-bar button[disabled] { opacity: .5; cursor: wait; }
#yith-woocompare { box-sizing: border-box; max-width: 100%; overflow-x: auto; }
#yith-woocompare .dataTables_wrapper { max-width: 100%; }
#yith-woocompare .dataTables_scrollBody { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) {
    #yith-woocompare-preview-bar .container { gap: 8px; }
    #yith-woocompare-preview-bar header p { display: none; }
    #yith-woocompare-preview-bar footer { flex-direction: column; gap: 5px; }
    #yith-woocompare-preview-bar footer > a { min-height: 38px; padding: 8px 10px; }
    #yith-woocompare-preview-bar .didgah-clear-compare { padding: 4px 8px; min-height: 30px; }
    #yith-woocompare-preview-bar .compare-list li:not(.product-placeholder),
    #yith-woocompare-preview-bar .didgah-preview-product-name { width: 78px; flex-basis: 78px; }
    #yith-woocompare-preview-bar .compare-list .image-wrap,
    #yith-woocompare-preview-bar .compare-list .image-wrap > a { width: 52px; height: 52px; }
    #yith-woocompare-preview-bar { max-height: 40vh; overflow-y: auto; }
    #yith-woocompare table.compare-list tbody th:not(.filler) { min-width: 90px; width: 90px; font-size: 12px; }
    #yith-woocompare table.compare-list td:not(.filler) { min-width: 170px; width: 170px; }
    #yith-woocompare table.dataTable.compare-list:not(.compact) tbody td { padding-inline: 12px; }
    #yith-woocompare .DTFC_LeftWrapper, #yith-woocompare .DTFC_RightWrapper { display: none; }
    #yith-woocompare .product_title { font-size: 13px; }
    #yith-woocompare table.compare-list .image-wrap img { max-height: 110px; }
}
.yith-woocompare-popup-container .didgah-comparison-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.yith-woocompare-popup-container .didgah-clear-compare { border: 1px solid #edc7bb; border-radius: 10px; background: #fff2ee; color: #9d3422; padding: 10px 14px; font: inherit; font-size: 13px; min-height: 42px; cursor: pointer; }
@media (max-width: 600px) { #yith-woocompare-preview-bar .didgah-remove-product { width: 36px; height: 36px; top: -9px; right: -9px; } }

#yith-woocompare .didgah-spec-missing { color: #7b8796; font-size: .9em; font-weight: 400; }
#yith-woocompare .didgah-spec-value { overflow-wrap: anywhere; unicode-bidi: plaintext; }
#yith-woocompare .didgah-spec-list { margin: 0; text-align: start; font-size: 13px; }
#yith-woocompare .didgah-spec-list > div { padding: 10px 0; border-bottom: 1px dashed #e3e8ef; }
#yith-woocompare .didgah-spec-list > div:last-child { border-bottom: 0; }
#yith-woocompare .didgah-spec-list dt { margin: 0 0 4px; color: #10243d; font-weight: 700; line-height: 1.7; }
#yith-woocompare .didgah-spec-list dd { margin: 0; color: #344a62; font-weight: 400; line-height: 1.9; overflow-wrap: anywhere; unicode-bidi: plaintext; }
@media(max-width:600px) { #yith-woocompare .didgah-spec-list { font-size: 12px; } }
#yith-woocompare table.compare-list tr[class*="didgah_section_"] th,
#yith-woocompare table.compare-list tr[class*="didgah_section_"] td { vertical-align: top; }
