/**
 * WooCommerce Mega Menu Preview v2 — Main Stylesheet
 * BEM Methodology | CSS Custom Properties | Dark Mode | Animations | Scrollbars
 *
 * @package WcMegaPreview
 * @version 2.0.0
 */

/* =============================================
   1. CSS CUSTOM PROPERTIES
   ============================================= */

:root {
    /* Core palette */
    --wcmp-primary: #028098;
    --wcmp-primary-dark: #026f85;
    --wcmp-text: #1a1a2e;
    --wcmp-text-light: #666;
    --wcmp-bg: #ffffff;
    --wcmp-bg-alt: #f8f9fa;
    --wcmp-border: #e9ecef;

    /* Shape & shadow */
    --wcmp-radius: 8px;
    --wcmp-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --wcmp-transition: 200ms ease;

    /* Scrollbar */
    --wcmp-sb-w: 6px;
    --wcmp-sb-track: #f1f1f1;
    --wcmp-sb-thumb: #c1c1c1;
    --wcmp-sb-thumb-h: #a8a8a8;

    /* Mobile rail layout */
    --wcmp-hpm-rail-w: 75px;
    --wcmp-hpm-rail-bg: #f1f3f5;
    --wcmp-hpm-rail-active-bg: #028098;
    --wcmp-hpm-rail-active-text: #ffffff;
    --wcmp-hpm-rail-text: #333333;
    --wcmp-hpm-img-radius: 6px;

    /* Typography */
    --wcmp-font-family: inherit;
    --wcmp-btn-text: #ffffff;
}

/* =============================================
   2. DARK MODE SUPPORT
   ============================================= */

@media (prefers-color-scheme: dark) {
    :root {
        --wcmp-text: #e9ecef;
        --wcmp-text-light: #adb5bd;
        --wcmp-bg: #1a1a2e;
        --wcmp-bg-alt: #16213e;
        --wcmp-border: #2d2d44;
        --wcmp-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        --wcmp-primary: #028098;
        --wcmp-primary-dark: #026f85;
        --wcmp-btn-text: #ffffff;
        --wcmp-sb-track: #16213e;
        --wcmp-sb-thumb: #444;
        --wcmp-sb-thumb-h: #555;
        --wcmp-hpm-rail-bg: #16213e;
        --wcmp-hpm-rail-text: #ced4da;
    }
}

/* Explicit dark class — takes precedence over auto */
[data-theme="dark"] .wcmp-mega-menu,
.wcmp-mega-menu.wcmp--dark {
    --wcmp-text: #e9ecef;
    --wcmp-text-light: #adb5bd;
    --wcmp-bg: #1a1a2e;
    --wcmp-bg-alt: #16213e;
    --wcmp-border: #2d2d44;
    --wcmp-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --wcmp-primary: #028098;
    --wcmp-primary-dark: #026f85;
    --wcmp-btn-text: #ffffff;
    --wcmp-sb-track: #16213e;
    --wcmp-sb-thumb: #444;
    --wcmp-sb-thumb-h: #555;
    --wcmp-hpm-rail-bg: #16213e;
    --wcmp-hpm-rail-text: #ced4da;
}

/* Auto dark — only when OS prefers dark and no explicit theme */
@media (prefers-color-scheme: dark) {
    .wcmp-mega-menu.wcmp--auto-dark {
        --wcmp-text: #e9ecef;
        --wcmp-text-light: #adb5bd;
        --wcmp-bg: #1a1a2e;
        --wcmp-bg-alt: #16213e;
        --wcmp-border: #2d2d44;
        --wcmp-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        --wcmp-primary: #028098;
        --wcmp-primary-dark: #026f85;
        --wcmp-btn-text: #ffffff;
        --wcmp-sb-track: #16213e;
        --wcmp-sb-thumb: #444;
        --wcmp-sb-thumb-h: #555;
        --wcmp-hpm-rail-bg: #16213e;
        --wcmp-hpm-rail-text: #ced4da;
    }
}

/* =============================================
   3. BEM — DESKTOP MEGA MENU (.wcmp-mega-menu)
   ============================================= */

/* --- 3a-0. CSS ISOLATION RESET ---
 * Neutralizes ALL external CSS leaks (WooCommerce, Theme, Elementor, Bootstrap, Tailwind)
 * so nothing inside .wcmp-mega-menu or .wcmp-hpm inherits unwanted styles.
 */
.wcmp-mega-menu,
.wcmp-mega-menu *,
.wcmp-hpm,
.wcmp-hpm *,
.wcmp-desktop-wrap .wcmp-mega-menu,
.wcmp-desktop-wrap .wcmp-mega-menu *,
.wcmp-mobile-wrap .wcmp-hpm,
.wcmp-mobile-wrap .wcmp-hpm * {
    box-sizing: border-box;
}

/* --- Price element isolation ---
 * WooCommerce outputs <del>, <ins>, .price, .woocommerce-Price-amount, .amount
 * Themes style these with red color, strike-through, etc.
 * We override ALL of them inside our containers to use WCMP-controlled styles only.
 */
.wcmp-mega-menu del,
.wcmp-mega-menu ins,
.wcmp-mega-menu .price,
.wcmp-mega-menu .woocommerce-Price-amount,
.wcmp-mega-menu .amount,
.wcmp-mega-menu span.amount,
.wcmp-hpm del,
.wcmp-hpm ins,
.wcmp-hpm .price,
.wcmp-hpm .woocommerce-Price-amount,
.wcmp-hpm .amount,
.wcmp-hpm span.amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
    text-decoration-line: none;
    background: none;
    border: none;
    margin: 0;
    padding: 0;
    display: inline;
    line-height: inherit;
    opacity: 1;
}

/* --- WCMP-scoped price classes (from format_price_html) --- */
.wcmp-price {
    display: inline-block;
    font-weight: 700;
    line-height: 1.4;
}

.wcmp-price--regular {
    color: var(--wcmp-price-regular, var(--wcmp-text, #1a1a2e));
}

.wcmp-price--contact {
    color: var(--wcmp-text-light, #666);
    font-weight: 500;
    font-style: italic;
    font-size: 0.9em;
}

.wcmp-price--range {
    color: var(--wcmp-price-regular, var(--wcmp-text, #1a1a2e));
}

.wcmp-price__del {
    color: var(--wcmp-price-regular, #999);
    font-size: 0.85em;
    font-weight: 400;
    text-decoration: line-through;
    text-decoration-color: var(--wcmp-price-regular, #999);
    margin-right: 6px;
    opacity: 0.8;
}

.wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 700;
    text-decoration: none;
}

/* --- General element resets inside WCMP containers --- */
.wcmp-mega-menu a,
.wcmp-hpm a {
    text-decoration: none;
    background: none;
    border: none;
}

.wcmp-mega-menu ul,
.wcmp-mega-menu ol,
.wcmp-hpm ul,
.wcmp-hpm ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcmp-mega-menu img,
.wcmp-hpm img {
    max-width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
    border-radius: inherit;
}

.wcmp-mega-menu button,
.wcmp-hpm button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.wcmp-mega-menu input,
.wcmp-hpm input {
    font-family: inherit;
}

/* Neutralize any external .price / del / ins styles that slip through */
.wcmp-mega-menu .wcmp-preview__price del,
.wcmp-mega-menu .wcmp-preview__price ins,
.wcmp-mega-menu .wcmp-product-link__price del,
.wcmp-mega-menu .wcmp-product-link__price ins,
.wcmp-hpm .wcmp-hpm__product-price del,
.wcmp-hpm .wcmp-hpm__product-price ins {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
    text-decoration-line: none;
}

/* --- 3a. Main container --- */

.wcmp-mega-menu {
    display: flex;
    flex-direction: column;
    background: var(--wcmp-bg);
    color: var(--wcmp-text);
    font-family: var(--wcmp-font-family);
    border: 1px solid var(--wcmp-border);
    border-radius: var(--wcmp-radius);
    box-shadow: var(--wcmp-shadow);
    overflow: visible;
    z-index: 9999;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wcmp-mega-menu__body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Keep side-by-side when preview is present */
.wcmp-mega-menu__body:has([data-wcmp-preview]) {
    flex-wrap: nowrap;
}

/* Equal-height columns toggle (default: independent heights) */
.wcmp-mega-menu__body--equal-height {
    align-items: stretch;
}
.wcmp-mega-menu__body--equal-height .wcmp-preview {
    align-self: stretch;
    max-height: none;
}

/* --- 3b. Search --- */

.wcmp-search {
    position: relative;
    margin-bottom: 16px;
    padding: 12px 20px 8px;
    border-bottom: 1px solid var(--wcmp-border);
}

.wcmp-search__wrapper {
    position: relative;
    max-width: 400px;
}

.wcmp-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wcmp-search-icon, #999);
    pointer-events: none;
}

.wcmp-search__input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--wcmp-search-border, var(--wcmp-border, #e9ecef));
    border-radius: 8px;
    font-size: 14px;
    background: var(--wcmp-search-bg, var(--wcmp-bg-alt, #f8f9fa));
    color: var(--wcmp-search-text, var(--wcmp-text, #1a1a2e));
    font-family: inherit;
    outline: none;
    transition: border-color var(--wcmp-transition), box-shadow var(--wcmp-transition);
    box-sizing: border-box;
}

.wcmp-search__input:focus {
    border-color: var(--wcmp-search-focus, var(--wcmp-primary, #028098));
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.wcmp-search__input::placeholder {
    color: var(--wcmp-text-light);
    opacity: 0.7;
}

/* Search results dropdown */
.wcmp-search__results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--wcmp-search-results-bg, #fff);
    border: 1px solid var(--wcmp-search-results-border, var(--wcmp-border, #e9ecef));
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--wcmp-shadow);
}

.wcmp-search__results.wcmp-search__results--visible {
    display: block;
    animation: wcmpFadeIn var(--wcmp-transition);
}

.wcmp-search__result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--wcmp-text);
    cursor: pointer;
    transition: background 150ms ease;
    border-bottom: 1px solid var(--wcmp-border);
}

.wcmp-search__result-item:last-child {
    border-bottom: none;
}

.wcmp-search__result-item:hover,
.wcmp-search__result-item:focus {
    background: var(--wcmp-search-hover-bg, #f8f9fa);
    outline: none;
}

.wcmp-search__result-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.wcmp-search__result-info {
    flex: 1;
    min-width: 0;
}

.wcmp-search__result-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wcmp-text);
}

.wcmp-search__result-price {
    font-size: 13px;
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 600;
}

/* Search result price: scoped overrides */
.wcmp-search__result-price .wcmp-price__del {
    color: var(--wcmp-text-light, #999);
    font-size: 12px;
    font-weight: 400;
    text-decoration: line-through;
    margin-right: 4px;
    opacity: 0.7;
}

.wcmp-search__result-price .wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 600;
}

.wcmp-search__result-price .wcmp-price--contact {
    color: var(--wcmp-text-light, #999);
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
}

.wcmp-search__no-results {
    padding: 20px;
    text-align: center;
    color: var(--wcmp-text-light, #999);
    font-size: 14px;
}

.wcmp-search__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    color: var(--wcmp-text-light);
    font-size: 13px;
}

.wcmp-search__loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--wcmp-border);
    border-top-color: var(--wcmp-primary, #028098);
    border-radius: 50%;
    margin-right: 8px;
    animation: wcmpSpin 600ms linear infinite;
}

/* --- 3c. Grid system --- */

.wcmp-menu__grid {
    display: grid;
    flex: 1;
    min-width: 0;
}

.wcmp-menu__grid--2-col { grid-template-columns: repeat(2, 1fr); }
.wcmp-menu__grid--3-col { grid-template-columns: repeat(3, 1fr); }
.wcmp-menu__grid--4-col { grid-template-columns: repeat(4, 1fr); }
.wcmp-menu__grid--5-col { grid-template-columns: repeat(5, 1fr); }
.wcmp-menu__grid--6-col { grid-template-columns: repeat(6, 1fr); }

/* --- 3d. Menu column --- */

.wcmp-menu__column {
    overflow-y: auto;
    max-height: 600px;
    padding: 8px 0;
    border-right: 1px solid var(--wcmp-border);
}

.wcmp-menu__column:last-child {
    border-right: none;
}

/* --- 3e. Category heading --- */

.wcmp-menu__category-link {
    text-decoration: none;
    display: block;
}

.wcmp-menu__category-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--wcmp-cat-color, var(--wcmp-text, #1a1a2e));
    margin: 0 0 4px;
    padding: 0 16px 8px 16px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    position: relative;
}

/* Divider pseudo-element below category title */
.wcmp-menu__category-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--wcmp-cat-divider-color, var(--wcmp-border, #e9ecef));
    border-radius: 1px;
}

.wcmp-menu__product-count {
    font-weight: 400;
    font-size: 12px;
    color: var(--wcmp-cat-count-color, var(--wcmp-text-light, #666));
    text-transform: none;
    margin-left: 4px;
}

/* --- 3f. Subcategories --- */

.wcmp-menu__subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 16px 8px;
}

.wcmp-menu__subcategory-link {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--wcmp-subcat-border, var(--wcmp-border, #e9ecef));
    border-radius: 4px;
    font-size: 13px;
    color: var(--wcmp-subcat-color, var(--wcmp-text-light, #666));
    text-decoration: none;
    transition: all 200ms ease;
    white-space: nowrap;
}

.wcmp-menu__subcategory-link:hover {
    color: var(--wcmp-primary, #028098);
    border-color: var(--wcmp-primary, #028098);
}

.wcmp-menu__subcat-count {
    font-size: 11px;
    opacity: 0.7;
}

/* --- 3g. Product list --- */

.wcmp-menu__product-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wcmp-menu__product-item {
    position: relative;
    list-style: none;
}

.wcmp-menu__product-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--wcmp-product-color, var(--wcmp-text-light, #666));
    text-decoration: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: color var(--wcmp-transition),
                background-color var(--wcmp-transition),
                padding-left var(--wcmp-transition);
    background: var(--wcmp-product-bg, transparent);
}

.wcmp-menu__product-link:hover {
    color: var(--wcmp-product-hover-color, var(--wcmp-primary, #028098));
    background: var(--wcmp-product-hover-bg, transparent);
    border-left-color: var(--wcmp-indicator-color, var(--wcmp-primary, #028098));
}

.wcmp-menu__product-link:focus {
    outline: none;
    color: var(--wcmp-product-hover-color, var(--wcmp-primary, #028098));
    background: var(--wcmp-product-hover-bg, transparent);
    border-left-color: var(--wcmp-indicator-color, var(--wcmp-primary, #028098));
}

.wcmp-menu__product-link.wcmp--active {
    color: var(--wcmp-product-active-color, var(--wcmp-primary, #028098));
    border-left-color: var(--wcmp-indicator-color, var(--wcmp-primary, #028098));
    background: var(--wcmp-product-active-bg, var(--wcmp-bg-alt, #f8f9fa));
}

/* Hover animation variants */
.wcmp-menu__product-link[data-wcmp-anim="slide"]:hover,
.wcmp-menu__product-link[data-wcmp-anim="slide"].wcmp--active {
    padding-left: 20px;
}

.wcmp-menu__product-link[data-wcmp-anim="grow"]:hover,
.wcmp-menu__product-link[data-wcmp-anim="grow"].wcmp--active {
    font-weight: 600;
}

/* --- 3h. Product card elements --- */

.wcmp-product-thumb {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    vertical-align: middle;
}

.wcmp-product-thumb[src=""] {
    display: none;
}

.wcmp-product-link__text {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcmp-product-link__price {
    font-size: 12px;
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    margin-left: auto;
    white-space: nowrap;
    font-weight: 600;
}

/* Inline price: scoped overrides */
.wcmp-product-link__price .wcmp-price__del {
    color: var(--wcmp-text-light, #999);
    font-size: 11px;
    font-weight: 400;
    text-decoration: line-through;
    margin-right: 3px;
    opacity: 0.7;
}

.wcmp-product-link__price .wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 600;
}

.wcmp-product-link__price .wcmp-price--contact {
    color: var(--wcmp-text-light, #999);
    font-weight: 400;
    font-style: italic;
    font-size: 11px;
}

/* --- 3i. Badges --- */

.wcmp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 6px;
    vertical-align: middle;
}

.wcmp-badge--sale {
    background: var(--wcmp-badge-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-badge-text, #fff);
}

.wcmp-badge--preview {
    position: absolute;
    top: 8px;
    z-index: 2;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

.wcmp-badge--top-left {
    top: 8px;
    left: 8px;
}

.wcmp-badge--top-right {
    top: 8px;
    right: 8px;
}

/* HPM-specific badge */
.wcmp-badge--hpm {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--wcmp-badge-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-badge-text, #fff);
    z-index: 2;
}

/* --- 3j. Stock indicator --- */

.wcmp-stock {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.wcmp-stock--in {
    color: var(--wcmp-stock-in, #28a745);
}

.wcmp-stock--out {
    color: var(--wcmp-stock-out, #dc3545);
}

/* --- 3k. SKU --- */

.wcmp-sku {
    display: inline-block;
    font-size: 11px;
    color: var(--wcmp-text-light, #999);
    font-family: monospace;
    margin-left: 4px;
    flex-shrink: 0;
}

/* --- 3l. Preview panel --- */

.wcmp-preview {
    flex-shrink: 0;
    background: var(--wcmp-preview-bg, var(--wcmp-bg-alt, #f8f9fa));
    border: 1px solid var(--wcmp-border);
    border-radius: var(--wcmp-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    min-width: 280px;
    max-width: 340px;
    /* Independent component — does NOT inherit category column height */
    align-self: flex-start;
    height: auto;
    min-height: unset;
    max-height: fit-content;
    /* Override max-height when a specific value is set via Elementor (0 = auto/fit-content) */
    max-height: var(--wcmp-preview-max-h, fit-content);
    position: sticky;
    top: var(--wcmp-preview-sticky-top, 0px);
    text-align: center;
}

/* Optional: disable sticky preview */
.wcmp-preview--no-sticky {
    position: static;
}

/* When image position is left */
.wcmp-preview--left {
    order: -1;
    margin-right: 24px;
}

.wcmp-preview__image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--wcmp-radius);
    background: var(--wcmp-bg);
    margin-bottom: 16px;
}

.wcmp-preview__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: opacity var(--wcmp-transition) ease, transform var(--wcmp-transition) ease;
}

/* Preview image zoom on hover */
.wcmp-preview__image.wcmp-zoom-enabled {
    transition: transform 400ms ease, opacity var(--wcmp-transition) ease;
}

.wcmp-mega-menu:hover .wcmp-preview__image.wcmp-zoom-enabled:hover {
    transform: scale(var(--wcmp-zoom, 1.05));
}

.wcmp-preview__image.wcmp-zoom-enabled.wcmp--swapping {
    transform: scale(1);
}

/* Image animation variants */
.wcmp-preview__image.wcmp-anim-fade {
    transition: opacity var(--wcmp-transition) ease;
}

.wcmp-preview__image.wcmp-anim-zoom {
    transition: opacity 150ms ease, transform 400ms ease;
}

.wcmp-preview__image.wcmp-anim-slide {
    transition: opacity 150ms ease, transform 300ms ease;
}

/* Image swap states */
.wcmp-preview__image.wcmp--swapping {
    opacity: 0;
}

.wcmp-preview__image.wcmp-anim-zoom.wcmp--swapping {
    transform: scale(0.95);
}

.wcmp-preview__image.wcmp-anim-slide.wcmp--swapping {
    transform: translateY(8px);
}

/* --- 3m. Preview content --- */

.wcmp-preview__content {
    padding: 12px 0 0;
    width: 100%;
}

.wcmp-preview__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wcmp-preview-title, var(--wcmp-text, #1a1a2e));
    margin: 0 0 8px;
    line-height: 1.3;
    transition: opacity 200ms ease;
}

.wcmp-preview__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    margin: 0 0 8px;
    transition: opacity 200ms ease;
}

/* Preview price uses WCMP-scoped del/ins from format_price_html */
.wcmp-preview__price .wcmp-price__del {
    color: var(--wcmp-price-regular, #999);
    font-size: 14px;
    font-weight: 400;
    margin-right: 6px;
}

.wcmp-preview__price .wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 700;
}

.wcmp-preview__price .wcmp-price--contact {
    color: var(--wcmp-text-light, #999);
    font-weight: 500;
    font-style: italic;
    font-size: 14px;
}

/* Also handle any WooCommerce classes that wc_price() might still output */
.wcmp-preview__price .woocommerce-Price-amount,
.wcmp-preview__price .amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.wcmp-preview__stock {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 12px;
}

/* --- 3n. Preview actions / buttons --- */

.wcmp-preview__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.wcmp-preview__actions--horizontal {
    flex-direction: row;
}

.wcmp-preview__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: var(--wcmp-radius);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1.4;
    transition: all 200ms ease;
}

/* Cart button — outlined style */
.wcmp-preview__btn--cart {
    background: var(--wcmp-cart-bg, transparent);
    color: var(--wcmp-cart-text, var(--wcmp-primary, #028098));
    border: 2px solid var(--wcmp-primary, #028098);
}

.wcmp-preview__btn--cart:hover {
    background: var(--wcmp-cart-hover-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-cart-hover-text, var(--wcmp-btn-text, #ffffff));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

/* Shop button — filled style */
.wcmp-preview__btn--shop {
    background: var(--wcmp-shop-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-shop-text, var(--wcmp-btn-text, #ffffff));
    border: 2px solid var(--wcmp-primary, #028098);
}

.wcmp-preview__btn--shop:hover {
    background: var(--wcmp-shop-hover-bg, transparent);
    color: var(--wcmp-shop-hover-text, var(--wcmp-primary, #028098));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

/* --- 3o. Popular / Recent sections --- */

.wcmp-section {
    margin-top: 24px;
    padding-top: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--wcmp-border);
}

.wcmp-section__heading {
    font-size: 16px;
    font-weight: 600;
    color: var(--wcmp-section-heading, var(--wcmp-text, #1a1a2e));
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wcmp-section__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.wcmp-section__grid--2 { grid-template-columns: repeat(2, 1fr); }
.wcmp-section__grid--3 { grid-template-columns: repeat(3, 1fr); }
.wcmp-section__grid--4 { grid-template-columns: repeat(4, 1fr); }
.wcmp-section__grid--5 { grid-template-columns: repeat(5, 1fr); }
.wcmp-section__grid--6 { grid-template-columns: repeat(6, 1fr); }

.wcmp-section__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--wcmp-radius);
    text-decoration: none;
    color: var(--wcmp-text);
    transition: background-color 200ms ease;
}

.wcmp-section__item:hover {
    background-color: var(--wcmp-bg-alt);
}

.wcmp-section__item-image {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.wcmp-section__item-image[src=""] {
    display: none;
}

.wcmp-section__item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.wcmp-section__item-name {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--wcmp-section-title, var(--wcmp-text, #1a1a2e));
    font-weight: 500;
}

/* Backward compat alias */
.wcmp-section__item-title {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--wcmp-section-title, var(--wcmp-text, #1a1a2e));
    font-weight: 500;
}

.wcmp-section__item-price {
    font-size: 12px;
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

/* Section item price: scoped overrides */
.wcmp-section__item-price .wcmp-price__del {
    color: var(--wcmp-text-light, #999);
    font-size: 11px;
    font-weight: 400;
    text-decoration: line-through;
    margin-right: 3px;
    opacity: 0.7;
}

.wcmp-section__item-price .wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 600;
}

.wcmp-section__item-price .wcmp-price--contact {
    color: var(--wcmp-text-light, #999);
    font-weight: 400;
    font-style: italic;
    font-size: 11px;
}

.wcmp-section__empty {
    padding: 16px;
    text-align: center;
    color: var(--wcmp-text-light);
    font-size: 13px;
    font-style: italic;
}

/* --- 3p. Load More --- */

.wcmp-menu__load-more-item {
    list-style: none;
    text-align: center;
    padding: 8px 0;
}

.wcmp-menu__load-more-btn {
    background: var(--wcmp-loadmore-bg, transparent);
    border: 1px solid var(--wcmp-loadmore-border, var(--wcmp-primary, #028098));
    color: var(--wcmp-loadmore-text, var(--wcmp-primary, #028098));
    padding: 8px 24px;
    border-radius: var(--wcmp-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 200ms ease;
}

.wcmp-menu__load-more-btn:hover {
    background: var(--wcmp-loadmore-hover-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-loadmore-hover-text, var(--wcmp-btn-text, #ffffff));
}

.wcmp-menu__load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 3q. Empty state --- */

.wcmp-menu__empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--wcmp-text-light, #999);
}

.wcmp-menu__empty p {
    margin: 0;
    font-size: 15px;
}

/* --- 3r. Animation utility classes --- */

.wcmp-anim-fade {
    transition: opacity var(--wcmp-transition);
}

.wcmp-anim-zoom {
    transition: transform var(--wcmp-transition);
}

.wcmp-anim-slide {
    transition: transform var(--wcmp-transition);
}

.wcmp-anim-grow {
    transition: transform var(--wcmp-transition);
}

/* --- 3s. Skeleton loading --- */

.wcmp--skeleton {
    animation: wcmpPulse 1.5s ease-in-out infinite;
    background: linear-gradient(
        90deg,
        var(--wcmp-bg-alt) 25%,
        var(--wcmp-border) 50%,
        var(--wcmp-bg-alt) 75%
    );
    background-size: 200% 100%;
}

/* --- 3t. Editor placeholder --- */

.wcmp-editor-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--wcmp-bg-alt);
    border: 2px dashed var(--wcmp-border);
    border-radius: var(--wcmp-radius);
    color: var(--wcmp-text-light);
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

.wcmp-editor-placeholder svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* --- 3u. Keyboard focus --- */

.wcmp-mega-menu *:focus-visible {
    outline: 2px solid var(--wcmp-primary, #028098);
    outline-offset: 2px;
}

.wcmp-menu__product-link:focus-visible {
    border-left-color: var(--wcmp-indicator-color, var(--wcmp-primary, #028098));
    background-color: var(--wcmp-bg-alt);
}

/* =============================================
   4. SPLIT MOBILE (.wcmp-hpm)
   ============================================= */

/* --- 4a. HPM container --- */

.wcmp-hpm {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--wcmp-bg);
    color: var(--wcmp-text);
    font-family: var(--wcmp-font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 4b. HPM search --- */

.wcmp-hpm__search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--wcmp-border);
}

.wcmp-hpm__search-wrapper {
    position: relative;
}

.wcmp-hpm__search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wcmp-search-icon, #999);
    pointer-events: none;
}

.wcmp-hpm__search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--wcmp-search-border, var(--wcmp-border, #e9ecef));
    border-radius: 6px;
    font-size: 14px;
    background: var(--wcmp-search-bg, var(--wcmp-bg-alt, #f8f9fa));
    color: var(--wcmp-search-text, var(--wcmp-text, #1a1a2e));
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.wcmp-hpm__search-input:focus {
    border-color: var(--wcmp-search-focus, var(--wcmp-primary, #028098));
}

.wcmp-hpm__search-input::placeholder {
    color: var(--wcmp-text-light);
    opacity: 0.7;
}

.wcmp-hpm__search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--wcmp-search-results-bg, #fff);
    border: 1px solid var(--wcmp-search-results-border, var(--wcmp-border, #e9ecef));
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--wcmp-shadow);
}

.wcmp-hpm__search-results.wcmp-hpm__search-results--visible {
    display: block;
    animation: wcmpFadeIn var(--wcmp-transition);
}

.wcmp-hpm__search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--wcmp-text);
    cursor: pointer;
    transition: background 150ms ease;
    border-bottom: 1px solid var(--wcmp-border);
}

.wcmp-hpm__search-result-item:last-child {
    border-bottom: none;
}

.wcmp-hpm__search-result-item:hover {
    background: var(--wcmp-search-hover-bg, #f8f9fa);
}

.wcmp-hpm__search-result-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.wcmp-hpm__search-result-info {
    flex: 1;
    min-width: 0;
}

.wcmp-hpm__search-result-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcmp-hpm__search-result-price {
    font-size: 13px;
    color: var(--wcmp-primary, #028098);
}

.wcmp-hpm__search-no-results {
    padding: 20px 12px;
    text-align: center;
    color: var(--wcmp-text-light, #999);
    font-size: 14px;
}

/* --- 4c. HPM body (rail + content) --- */

.wcmp-hpm__body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* --- 4d. HPM rail (vertical category nav) --- */

.wcmp-hpm__rail {
    width: var(--wcmp-hpm-rail-w);
    background: var(--wcmp-hpm-rail-bg);
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.wcmp-hpm__rail--sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.wcmp-hpm__rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--wcmp-hpm-rail-text);
    text-align: center;
    gap: 4px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 11px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.wcmp-hpm__rail-item:hover {
    background: rgba(230, 57, 70, 0.08);
}

.wcmp-hpm__rail-item--active {
    background: var(--wcmp-hpm-rail-active-bg);
    color: var(--wcmp-hpm-rail-active-text);
    border-left-color: var(--wcmp-hpm-rail-active-bg);
}

.wcmp-hpm__rail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wcmp-hpm__rail-icon img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: var(--wcmp-hpm-img-radius);
}

.wcmp-hpm__rail-text {
    font-size: 10px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

/* --- 4e. HPM content area --- */

.wcmp-hpm__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* --- 4f. HPM panels --- */

.wcmp-hpm__panel {
    display: none;
}

.wcmp-hpm__panel--active {
    display: block;
    animation: wcmpFadeIn 0.2s ease;
}

/* --- 4g. HPM category header --- */

.wcmp-hpm__cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--wcmp-border);
}

.wcmp-hpm__cat-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--wcmp-cat-color, var(--wcmp-text, #1a1a2e));
}

.wcmp-hpm__cat-link {
    font-size: 18px;
    color: var(--wcmp-primary, #028098);
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
}

.wcmp-hpm__cat-link:hover {
    color: var(--wcmp-primary-dark, #026f85);
}

/* --- 4h. HPM product grid --- */

.wcmp-hpm__product-grid {
    display: grid;
    gap: var(--wcmp-hpm-product-gap, 10px);
}

.wcmp-hpm__product-grid--1 { grid-template-columns: 1fr; }
.wcmp-hpm__product-grid--2 { grid-template-columns: repeat(2, 1fr); }
.wcmp-hpm__product-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* --- 4i. HPM product card --- */

.wcmp-hpm__product-card {
    display: block;
    text-decoration: none;
    color: var(--wcmp-text);
    border-radius: 8px;
    overflow: hidden;
    background: var(--wcmp-bg, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.wcmp-hpm__product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.wcmp-hpm__product-card:active {
    transform: scale(0.98);
}

/* --- 4j. HPM product image --- */

.wcmp-hpm__product-image-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--wcmp-bg-alt, #f5f5f5);
}

.wcmp-hpm__product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--wcmp-hpm-img-radius);
    transition: transform 0.3s ease;
}

.wcmp-hpm__product-image[src=""] {
    display: none;
}

.wcmp-hpm__product-image-wrap:empty {
    display: none;
}

.wcmp-hpm__product-card:hover .wcmp-hpm__product-image {
    transform: scale(1.05);
}

/* --- 4k. HPM product info --- */

.wcmp-hpm__product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding: 8px 8px 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    min-height: 31px;
    color: var(--wcmp-text);
}

.wcmp-hpm__product-price {
    display: block;
    padding: 0 8px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
}

/* HPM price: scoped overrides */
.wcmp-hpm__product-price .wcmp-price__del {
    color: var(--wcmp-text-light, #999);
    font-size: 12px;
    font-weight: 400;
    text-decoration: line-through;
    margin-right: 4px;
    opacity: 0.7;
}

.wcmp-hpm__product-price .wcmp-price__ins {
    color: var(--wcmp-price-sale, var(--wcmp-primary, #028098));
    font-weight: 600;
}

.wcmp-hpm__product-price .wcmp-price--contact {
    color: var(--wcmp-text-light, #999);
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
}

.wcmp-hpm__product-arrow {
    display: block;
    padding: 0 8px 8px;
    font-size: 12px;
    color: var(--wcmp-text-light, #999);
}

/* --- 4l. HPM stock --- */

.wcmp-hpm__stock--hpm {
    font-size: 10px;
    padding: 0 8px 6px;
    display: block;
}

.wcmp-hpm__stock--hpm.wcmp-stock--in {
    color: var(--wcmp-stock-in, #28a745);
}

.wcmp-hpm__stock--hpm.wcmp-stock--out {
    color: var(--wcmp-stock-out, #dc3545);
}

/* --- 4m. HPM out-of-stock overlay --- */

.wcmp-hpm__out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--wcmp-stock-out, #dc3545);
    border-radius: var(--wcmp-hpm-img-radius);
}

/* --- 4n. HPM load more --- */

.wcmp-hpm__load-more {
    text-align: center;
    padding: 16px 0 8px;
}

.wcmp-hpm__load-more-btn {
    background: transparent;
    border: 1px solid var(--wcmp-loadmore-border, var(--wcmp-primary, #028098));
    color: var(--wcmp-loadmore-text, var(--wcmp-primary, #028098));
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 200ms ease;
}

.wcmp-hpm__load-more-btn:hover {
    background: var(--wcmp-loadmore-hover-bg, var(--wcmp-primary, #028098));
    color: var(--wcmp-loadmore-hover-text, var(--wcmp-btn-text, #fff));
}

.wcmp-hpm__load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 4o. HPM empty states --- */

.wcmp-hpm__empty {
    padding: 20px;
    text-align: center;
    color: var(--wcmp-text-light, #999);
}

.wcmp-hpm__no-products {
    padding: 20px;
    text-align: center;
    color: var(--wcmp-text-light, #999);
    font-size: 13px;
}

/* --- 4p. HPM keyboard focus --- */

.wcmp-hpm *:focus-visible {
    outline: 2px solid var(--wcmp-primary, #028098);
    outline-offset: 2px;
}

/* =============================================
   5. KEYFRAMES
   ============================================= */

@keyframes wcmpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wcmpSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wcmpScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes wcmpFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes wcmpSpin {
    to { transform: rotate(360deg); }
}

@keyframes wcmpPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* =============================================
   6. CUSTOM SCROLLBAR
   ============================================= */

/* Desktop menu column scrollbar */
.wcmp-menu__column::-webkit-scrollbar {
    width: var(--wcmp-sb-w);
}

.wcmp-menu__column::-webkit-scrollbar-track {
    background: var(--wcmp-sb-track);
    border-radius: 10px;
}

.wcmp-menu__column::-webkit-scrollbar-thumb {
    background: var(--wcmp-sb-thumb);
    border-radius: 10px;
}

.wcmp-menu__column::-webkit-scrollbar-thumb:hover {
    background: var(--wcmp-sb-thumb-h);
}

/* Firefox fallback for menu columns */
.wcmp-menu__column {
    scrollbar-width: thin;
    scrollbar-color: var(--wcmp-sb-thumb) var(--wcmp-sb-track);
}

/* HPM rail scrollbar — thinner */
.wcmp-hpm__rail::-webkit-scrollbar {
    width: 3px;
}

.wcmp-hpm__rail::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.wcmp-hpm__rail::-webkit-scrollbar-track {
    background: transparent;
}

/* HPM rail Firefox fallback */
.wcmp-hpm__rail {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* Search results scrollbar */
.wcmp-search__results::-webkit-scrollbar,
.wcmp-hpm__search-results::-webkit-scrollbar,
.wcmp-section__grid::-webkit-scrollbar {
    width: 6px;
}

.wcmp-search__results::-webkit-scrollbar-track,
.wcmp-hpm__search-results::-webkit-scrollbar-track,
.wcmp-section__grid::-webkit-scrollbar-track {
    background: transparent;
}

.wcmp-search__results::-webkit-scrollbar-thumb,
.wcmp-hpm__search-results::-webkit-scrollbar-thumb,
.wcmp-section__grid::-webkit-scrollbar-thumb {
    background-color: var(--wcmp-border);
    border-radius: 3px;
}

.wcmp-search__results::-webkit-scrollbar-thumb:hover,
.wcmp-hpm__search-results::-webkit-scrollbar-thumb:hover,
.wcmp-section__grid::-webkit-scrollbar-thumb:hover {
    background-color: var(--wcmp-text-light);
}

/* =============================================
   7. MOBILE OVERLAY (v3) — Full-screen fixed overlay
   Independent from desktop. Never pushes page content.
   ============================================= */

/* --- 7a. Trigger Button (visible on mobile only) --- */

.wcmp-overlay-trigger {
    display: none;
}

@media (max-width: 768px) {
    .wcmp-mobile-wrap .wcmp-overlay-trigger {
        display: inline-flex;
    }
}

.wcmp-overlay-trigger__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: var(--wcmp-text, #1a1a2e);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.wcmp-overlay-trigger__btn svg {
    flex-shrink: 0;
}

.wcmp-overlay-trigger__label {
    white-space: nowrap;
}

/* --- 7b. Overlay Container (hidden by default) --- */

.wcmp-mobile-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: var(--wcmp-overlay-z, 999999);
    background: var(--wcmp-overlay-bg, #ffffff);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--wcmp-overlay-anim, 300ms) ease,
                visibility 0s var(--wcmp-overlay-anim, 300ms) ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--wcmp-text, #1a1a2e);
    font-family: var(--wcmp-font-family, inherit);
}

/* Open state — toggled via JS (.wcmp-overlay--open) */
.wcmp-mobile-overlay.wcmp-overlay--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--wcmp-overlay-anim, 300ms) ease,
                visibility 0s 0s ease;
}

/* CSS isolation — same as desktop */
.wcmp-mobile-overlay *,
.wcmp-mobile-overlay *::before,
.wcmp-mobile-overlay *::after {
    box-sizing: border-box;
}

.wcmp-mobile-overlay del,
.wcmp-mobile-overlay ins,
.wcmp-mobile-overlay .price,
.wcmp-mobile-overlay .woocommerce-Price-amount,
.wcmp-mobile-overlay .amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
    text-decoration-line: none;
    background: none;
    border: none;
    margin: 0;
    padding: 0;
    display: inline;
    line-height: inherit;
    opacity: 1;
}

/* --- 7c. Overlay Header --- */

.wcmp-overlay__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--wcmp-border, #e9ecef);
    flex-shrink: 0;
    min-height: 52px;
}

.wcmp-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--wcmp-bg-alt, #f8f9fa);
    color: var(--wcmp-overlay-close-color, #333333);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 150ms ease;
}

.wcmp-overlay__close:hover,
.wcmp-overlay__close:active {
    background: var(--wcmp-border, #e9ecef);
}

.wcmp-overlay__close-spacer {
    width: 40px;
    flex-shrink: 0;
}

.wcmp-search-spacer {
    flex: 1;
}

/* --- 7d. HPM layout inside overlay (fills remaining space) --- */

.wcmp-mobile-overlay > .wcmp-hpm {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.wcmp-mobile-overlay > .wcmp-hpm > .wcmp-hpm__search {
    flex-shrink: 0;
}

.wcmp-mobile-overlay > .wcmp-hpm > .wcmp-hpm__body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* --- 7u. Body scroll lock helper class (applied via JS) --- */

body.wcmp-body-lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
    touch-action: none;
}

/* Fallback for older browsers */
body.wcmp-body-lock::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: calc(var(--wcmp-overlay-z, 999999) - 1);
}