/*
 * Product tabs shortcode [mme_product_tabs] — accordion sections + optional nav.
 * Scoped to .mme-product-tabs-shell (output by the shortcode).
 */

/* Tab panels: our tabs.php renders every panel inside a <details> accordion,
   so panels must always be laid out (no JS-driven show/hide like Woodmart's
   own tab-strip skin uses). */
.product-details-tab .tab-content .tab-pane {
    display: block !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

.product-detail-show .product-details-bottom-inner .product-details-tab > .tab-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0 !important;
}

.product-detail-show .product-details-tab .tab-pane.description,
.product-detail-show .product-details-tab .tab-pane.specification,
.product-detail-show .product-details-tab .tab-pane.reviews {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Accordion component (details/summary — native, keyboard + screen-reader
   accessible, zero JS required to open/close). */
.product-section-accordion {
    margin-bottom: 0;
    border: 0;
    border-bottom: 1px solid #e8ebe8;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
}

@media screen and (min-width: 1200px) {
    .product-detail-show #reviews .product-section-accordion,
    .product-detail-show #reviews .product-section-accordion__body {
        overflow: visible;
    }
}

.product-section-accordion > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 2px;
    font-weight: 700;
    font-size: 14px;
    color: #0c0c0c;
    border: 0;
    border-bottom: 1px solid #e0e0e2;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: color .15s ease, border-color .15s ease;
}

.product-section-accordion > summary:hover,
.product-section-accordion > summary:focus-visible {
    color: var(--mme-product-accent, var(--color-primary, #7eb934));
    outline: none;
}

.product-section-accordion > summary::-webkit-details-marker {
    display: none;
}

.product-section-accordion > summary::marker {
    content: "";
    display: none;
}

.product-section-accordion > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e0e0e2;
    background-color: #f7f8f7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23424750' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
    transition: transform .2s ease, background-color .15s ease, border-color .15s ease;
}

.product-section-accordion[open] > summary {
    color: var(--mme-product-accent, var(--color-primary, #7eb934));
    border-bottom-color: #e0e0e2;
    margin-bottom: 12px;
}

.product-section-accordion[open] > summary::after {
    content: "";
    transform: rotate(180deg);
    border-color: color-mix(in srgb, var(--mme-product-accent, #7eb934) 35%, #e0e0e2);
    background-color: color-mix(in srgb, var(--mme-product-accent, #7eb934) 14%, #fff);
}

.product-section-accordion__body {
    padding: 0 2px 18px;
    overflow-x: visible;
    font-size: 14px;
    line-height: 1.7;
    color: #424750;
}

/* Section nav: desktop tab strip + mobile pill nav (both optional, toggled
   via Appearance > Single Product Layout). */
.product-detail-show .product-section-link {
    text-decoration: none;
    color: inherit;
}

.product-detail-show .d-none {
    display: none !important;
}

@media (min-width: 992px) {
    .product-detail-show .d-lg-block {
        display: block !important;
    }

    .product-detail-show .d-lg-none {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .product-detail-show .d-lg-none {
        display: flex !important;
    }
}

.product-details-tab-overflow__scroll .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #e5e7eb;
}

.product-details-tab-overflow__scroll .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
}

.product-details-tab-overflow__scroll .nav-link.active {
    color: var(--mme-product-accent, var(--color-primary, #2563eb));
    border-color: #e5e7eb;
    border-bottom-color: #fff;
    background: #fff;
    margin-bottom: -1px;
}

/* Desktop sticky nav when Digikala sticky_section_nav is on */
@media screen and (min-width: 992px) {
    .mme-product-tabs-shell--sticky-nav .product-details-tab-overflow--sticky,
    body.mme-sp-sticky-nav .product-details-tab-overflow--sticky {
        position: sticky;
        top: var(--mme-sticky-tabs-top, 56px);
        z-index: 90;
        background: #fff;
    }
}

@media screen and (max-width: 991px) {
    .product-detail-show .product-details-tab-overflow {
        position: sticky;
        top: var(--mme-sticky-tabs-top, 0px);
        z-index: 90;
        margin: 0 -8px 10px;
        padding: 0;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
    }

    .product-detail-show .product-details-tab-overflow__chrome {
        border-radius: 0;
        padding: 0;
        border: 0;
        background: #fff;
        box-shadow: none;
    }

    .product-detail-show .product-details-tab-mobile-pills-wrap {
        display: flex !important;
        align-items: stretch;
        gap: 0;
        width: 100%;
        position: sticky;
        top: var(--mme-sticky-tabs-top, 0px);
        z-index: 90;
        margin: 0 0 10px;
        padding: 8px 0 8px 10px;
        background: #fff;
        border-bottom: 1px solid #e8eaed;
        box-sizing: border-box;
    }

    .product-detail-show .product-details-tab-mobile-pills {
        display: flex !important;
        flex: 1 1 auto;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 6px;
        min-width: 0;
        width: auto;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        padding: 0 4px 0 0;
    }

    .product-detail-show .product-details-tab-mobile-pills::-webkit-scrollbar {
        display: none;
    }

    .product-detail-show .product-details-tab-mobile-pills__scroll-hint {
        display: none;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 36px;
        margin: 0;
        padding: 0 6px 0 0;
        color: #64748b;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
        pointer-events: none;
    }

    .product-detail-show .product-details-tab-mobile-pills-wrap.is-scrollable .product-details-tab-mobile-pills__scroll-hint {
        display: inline-flex;
    }

    .product-detail-show .product-details-tab-mobile-pills-wrap.is-at-end .product-details-tab-mobile-pills__scroll-hint {
        opacity: 0.35;
    }

    .product-detail-show .product-details-tab-mobile-pills__scroll-icon {
        display: block;
        flex-shrink: 0;
    }

    .product-detail-show .product-details-tab-mobile-pills .product-section-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 32px;
        height: 32px;
        margin: 0;
        padding: 0 12px;
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        background: #f8fafc;
        color: #334155;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        transition: background .15s ease, border-color .15s ease, color .15s ease;
        box-sizing: border-box;
        vertical-align: middle;
        text-decoration: none;
    }

    .product-detail-show .product-details-tab-mobile-pills .product-section-link.active {
        color: #fff;
        border-color: var(--mme-product-accent, var(--mme-accent, #c8922a));
        background: var(--mme-product-accent, var(--mme-accent, #c8922a));
        box-shadow: none;
    }
}

/* Woodmart bridge: spacing + brand accent on the real WooCommerce/Woodmart
   markup that surrounds our tabs (product gallery, summary, attributes). */
.product-detail-show div.product {
    margin-top: 24px;
}

.product-detail-show .product-image-summary-wrap {
    margin-bottom: 20px;
}

.product-detail-show .summary.entry-summary {
    padding: 0;
}

.product-detail-show .mme-product-tabs {
    margin-top: 8px;
}

.product-detail-show .woocommerce table.shop_attributes {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.product-detail-show .woocommerce table.shop_attributes th {
    background: #f8fafc;
    font-weight: 600;
    color: #111827;
    width: 38%;
}

.product-detail-show .woocommerce table.shop_attributes td,
.product-detail-show .woocommerce table.shop_attributes th {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
