/* =============================================================================
   WOOCOMMERCE — Shop archive, product page, tabs, gallery, cart, breadcrumbs
   ============================================================================= */

/* ── Shop archive: product cards ─────────────────────────────────────────────── */
ul.products.columns-3 > li {
    box-shadow: 0 0 20px #a0a9dd;
    border-radius: 0.5rem;
}

.button.product_type_external.shop-page-add-to-cart {
    border-radius: 0.5rem;
    width: 90%;
    margin: auto;
    margin-bottom: 0.625rem;
}

#wc-column-container > ul > li > a.woocommerce-LoopProduct-link.woocommerce-loop-product__link > div.wc-product-image > div > img {
    border-radius: 0.5rem !important;
}

#wc-column-container > ul > li > a > h2 {
    padding-inline: 0.625rem;
}

#wc-column-container > ul > li > a > div.star-rating {
    margin-left: 0.625rem;
}

#wc-column-container > ul > li > a > div.woocommerce-product-details__short-description {
    padding-inline: 0.625rem;
    font-size: 1rem;
}

#wc-column-container > ul > li > a > span.price {
    padding-inline: 0.625rem;
    font-size: 1rem;
    margin-bottom: 1.2rem;
}

/* ── Mobile shop layout ──────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
    div.site-content {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .woocommerce #wc-column-container.wc-mobile-columns-1 .products {
        -ms-grid-columns: 1fr;
        grid-template-columns: repeat(1, minmax(0, 1fr));
        max-width: 18.75rem;
        margin-inline: auto;
    }

    .is-left-sidebar.sidebar {
        width: auto !important;
        order: -1 !important;
    }

    aside#wcpf_filters-7 {
        padding-bottom: 0px;
        margin-bottom: -3rem;
    }
}

/* ── Product page: flatten WooCommerce tabs into a plain description block ────── */

/* Hide the clickable tab navigation bar entirely */
.woocommerce-tabs ul.tabs.wc-tabs {
    display: none !important;
}

/* Remove the tab-panel border/padding that WooCommerce adds */
.woocommerce-tabs .woocommerce-Tabs-panel {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* Always show the description panel — no JS click needed */
.woocommerce-tabs .woocommerce-Tabs-panel--description {
    display: block !important;
}

/* Give the description area a clean heading */
.woocommerce-tabs .woocommerce-Tabs-panel--description h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #3c4fb5;
    display: inline-block;
}

/* Wrap the whole tabs area so it sits cleanly below the gallery/summary row */
.woocommerce-tabs {
    clear: both;
    margin-top: 2rem;
}

/* Hide default Additional Information tab panel */
.woocommerce-tabs .woocommerce-Tabs-panel--additional_information {
    display: none !important;
}

/* ── Flat scrollable product sections ────────────────────────────────────────── */
.flat-product-sections {
    margin-top: 2.5rem;
    width: 100%;
    clear: both;
}

.flat-section {
    margin-bottom: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e8e8e8;
}

.flat-section:first-child {
    border-top: none;
    padding-top: 0;
}

/* Section H3 heading */
.flat-section__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #3c4fb5;
    display: inline-block;
}

/* Card containers */
.cards-container {
    display: flex;
    gap: 0.9375rem;
    flex-wrap: wrap;
    padding-bottom: 0.625rem;
}

.cards-container-pc {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* Individual cards */
.tab-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.9375rem;
    min-width: 9.375rem;
    max-width: 18.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 9.375rem;
}

.tab-card-pc {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.9375rem;
    min-width: 12rem;
    max-width: 22rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 12rem;
}

/* Pros card accent */
.tab-card-pc--pros {
    border-left: 4px solid #2e7d32;
}

/* Cons card accent */
.tab-card-pc--cons {
    border-left: 4px solid #c62828;
}

/* Card label */
.tab-card__label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin: 0 0 0.5rem 0;
}

.tab-card__label--pros { color: #2e7d32; }
.tab-card__label--cons { color: #c62828; }

.tab-card-pc ol,
.tab-card-pc ul {
    margin: 0 0 1.5em 1.5em;
}

.tab-card ol,
.tab-card ul {
    margin: 0 0 1.5em 1.5em;
    padding-top: inherit !important;
}

.tab-card p,
.tab-card-pc p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

/* Mobile: full-width cards */
@media (max-width: 768px) {
    .tab-card,
    .tab-card-pc {
        min-width: 100%;
        max-width: 100%;
    }
}

/* ── Product page: cart button ───────────────────────────────────────────────── */
form.cart {
    display: grid !important;
    border-radius: 0.5rem;
}

a.button.product_type_external {
    display: grid !important;
    margin-inline: auto !important;
    text-align: center;
    width: 90%;
    border-radius: 0.5rem !important;
}

.woocommerce div.product form.cart {
    margin-bottom: 1em;
}

.woocommerce div.product form.cart .button {
    border-radius: 0.5rem !important;
}

/* ── Product page: gallery thumbnail strip ───────────────────────────────────── */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 0.625rem 0 !important;
    margin: 0 !important;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
}

.woocommerce-product-gallery .flex-control-thumbs img {
    width: auto !important;
    height: auto !important;
    max-width: 5rem !important;
    max-height: 5rem !important;
}

.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar { width: 8px; }
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-track { background: #f1f1f1; }
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Product images — aspect ratio & border radius ────────────────────────────── */
.woocommerce-product-gallery__image img,
.wp-post-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
}

.woocommerce-product-gallery__image img {
    border-radius: 0.5rem !important;
}

img.attachment-woocommerce_thumbnail {
    border-radius: 0.5rem !important;
}

/* ── Summary column min-height ───────────────────────────────────────────────── */
.summary.entry-summary {
    min-height: 25rem;
}

/* ── Perfmatters lazy-load placeholder fix ───────────────────────────────────── */
.perfmatters-lazy[width="32"] {
    width: 2rem;
    height: 2rem;
    display: inline-block;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────────── */
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) .woocommerce-breadcrumb a,
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) .woocommerce-breadcrumb {
    font-size: 0.92em;
    color: #3c4fb5;
    font-style: italic;
}

/* ── SEO-friendly hidden H1 (generated dynamically via PHP) ──────────────────── */
.page-title {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Up-sells and related products headings ──────────────────────────────────── */
section.up-sells.upsells.products > h2,
section.related.products > h2 {
    text-align: center;
}

/* Hide native WooCommerce upsells on single product pages — comparison table replaces them */
.woocommerce div.product section.up-sells.upsells.products {
    display: none !important;
}

section.related.products {
    margin-top: 2.5rem;
}

/* ── Loop product buy button ─────────────────────────────────────────────────── */
.woocommerce-loop-product__link > a.button.product_type_external {
    display: grid !important;
    margin-inline: auto !important;
    text-align: center;
    width: 90%;
    border-radius: 0.5rem;
}

/* ── Compare button (Addonify) ───────────────────────────────────────────────── */
.button.addonify-cp-button.icon-position-left {
    display: block !important;
    margin-inline: auto !important;
    text-align: center;
    width: 90%;
    border-radius: 0.5rem;
    margin-bottom: 0.625rem;
}

@media (max-width: 430px) {
    div#addonify-compare-dock {
        margin-bottom: 5rem;
    }
}

/* =============================================================================
   COMPARISON TABLE — flat-section--comparison
   ============================================================================= */

/* ── Scrollable wrapper (handles overflow on small screens) ──────────────────── */
.cmp-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ── Table base ──────────────────────────────────────────────────────────────── */
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    font-size: 0.95rem;
    color: #333;
}

/* ── All cells ───────────────────────────────────────────────────────────────── */
.cmp-table .cmp-cell {
    padding: 0.85rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid #efefef;
    text-align: left;
    word-break: break-word;
}

/* ── Label column (first column) ─────────────────────────────────────────────── */
.cmp-table .cmp-cell--label {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    background: #f9f9f9;
    width: 22%;
    min-width: 7rem;
    white-space: nowrap;
}

/* ── Product columns ─────────────────────────────────────────────────────────── */
.cmp-table .cmp-cell--product {
    text-align: center;
    vertical-align: top;
    position: relative;
}

/* ── Current product column highlight ───────────────────────────────────────── */
.cmp-table .cmp-col--current {
    background: #f0f3ff;
    border-left: 3px solid #3c4fb5;
    border-right: 3px solid #3c4fb5;
}

.cmp-table thead .cmp-col--current {
    border-top: 3px solid #3c4fb5;
}

.cmp-table tbody tr:last-child .cmp-col--current {
    border-bottom: 3px solid #3c4fb5;
}

/* ── "This Product" badge ────────────────────────────────────────────────────── */
.cmp-badge {
    display: inline-block;
    background: #3c4fb5;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    margin-bottom: 0.6rem;
}

/* ── Thumbnail — uniform size across all columns ─────────────────────────────── */
.cmp-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    width: 10rem;
    height: 10rem;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #f5f5f5;
}

.cmp-thumb img {
    width: 10rem !important;
    height: 10rem !important;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    border-radius: 0.5rem;
}

/* ── Product name & price in header ─────────────────────────────────────────── */
.cmp-product-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a2e;
    margin: 0.25rem 0 0.2rem;
    line-height: 1.3;
}

.cmp-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #3c4fb5;
    margin: 0;
}

/* ── Recommendation row ──────────────────────────────────────────────────────── */
.cmp-row--recommendation .cmp-cell {
    font-style: italic;
    font-size: 0.9rem;
    color: #444;
}

.cmp-row--recommendation .cmp-cell--label {
    font-style: normal;
}

/* ── CTA row ─────────────────────────────────────────────────────────────────── */
.cmp-row--cta .cmp-cell {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: none;
}

.cmp-cta {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.cmp-cta--current {
    background: #3c4fb5;
    color: #fff;
    cursor: default;
}

.cmp-cta--link {
    background: transparent;
    color: #3c4fb5;
    border: 2px solid #3c4fb5;
    transition: background 0.2s, color 0.2s;
}

.cmp-cta--link:hover {
    background: #3c4fb5;
    color: #fff;
}

/* ── Zebra striping on body rows ─────────────────────────────────────────────── */
.cmp-table tbody tr:nth-child(even) .cmp-cell:not(.cmp-col--current) {
    background: #fafafa;
}

/* ── Mobile: stack columns as cards ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .cmp-table-wrapper {
        box-shadow: none;
    }

    .cmp-table,
    .cmp-table thead,
    .cmp-table tbody,
    .cmp-table tr,
    .cmp-table th,
    .cmp-table td {
        display: block;
        width: 100% !important;
    }

    /* Hide the label column on mobile — labels become row headings */
    .cmp-table .cmp-cell--label {
        display: none;
    }

    .cmp-table thead .cmp-row--header {
        display: flex;
        gap: 0.5rem;
    }

    .cmp-table thead .cmp-cell--product {
        flex: 1;
        border: 1px solid #e0e0e0;
        border-radius: 0.5rem;
        padding: 0.75rem 0.5rem;
    }

    .cmp-table thead .cmp-col--current {
        border: 3px solid #3c4fb5;
    }

    /* Each body row becomes a labelled row using data-label */
    .cmp-table tbody .cmp-row {
        display: flex;
        gap: 0.5rem;
        border-bottom: 1px solid #efefef;
        padding: 0.5rem 0;
    }

    .cmp-table tbody .cmp-cell {
        flex: 1;
        border: none;
        border-bottom: none;
        padding: 0.4rem 0.5rem;
        font-size: 0.88rem;
    }

    .cmp-table tbody .cmp-col--current {
        background: #f0f3ff;
        border-left: 3px solid #3c4fb5;
        border-radius: 0 0.25rem 0.25rem 0;
    }

    .cmp-row--cta {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .cmp-row--cta .cmp-cell {
        flex: 0 0 auto;
    }
}

/* =============================================================================
   HEARING LOSS FIT GUIDANCE — flat-section--hearing-loss-guidance
   ============================================================================= */

.flat-section--hearing-loss-guidance .hlg-content {
    background: #f0f3ff;
    border-left: 4px solid #3c4fb5;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1.25rem 1.5rem;
    font-size: 0.97rem;
    color: #2a2a3d;
    line-height: 1.7;
}

.flat-section--hearing-loss-guidance .hlg-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1rem 0 0.4rem;
}

.flat-section--hearing-loss-guidance .hlg-content h4:first-child {
    margin-top: 0;
}

.flat-section--hearing-loss-guidance .hlg-content p {
    margin: 0 0 0.75rem;
}

.flat-section--hearing-loss-guidance .hlg-content ul,
.flat-section--hearing-loss-guidance .hlg-content ol {
    margin: 0 0 0.75rem 1.5rem;
    padding: 0;
}

.flat-section--hearing-loss-guidance .hlg-content li {
    margin-bottom: 0.3rem;
}

@media (max-width: 600px) {
    .flat-section--hearing-loss-guidance .hlg-content {
        padding: 1rem;
    }
}
