/* =========================================================
   LAYOUT MODULE: HEADER, FOOTER, DRAWER & NAV
========================================================= */

/* --- SITE HEADER --- */
.cm-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    min-height: 70px;
    padding: 0 16px;
    background: var(--cm-surface) !important;
    background: color-mix(in srgb, var(--cm-bg) 74%, transparent) !important;
    backdrop-filter: blur(26px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(180%) !important;
    border-bottom: 1px solid var(--cm-border) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    z-index: 99999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.cm-header-profile-block { 
    display: flex; 
    align-items: center; 
    height: 70px;
    gap: 7px; 
    flex-shrink: 1; 
    min-width: 0; 
    max-width: calc(50% - 64px); 
    z-index: 2; 
}
.cm-header-avatar {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}
.cm-header-avatar img:not(.cm-avatar-frame-overlay) {
    border-radius: 50% !important;
}
.cm-header-avatar .cm-avatar-frame-overlay {
    border-radius: 0 !important;
}
.cm-user-greeting { 
    font-size: 8px !important; 
    line-height: 1 !important; 
    font-weight: 700 !important; 
    opacity: 0.7 !important; 
    text-transform: uppercase !important; 
    letter-spacing: 0.4px !important; 
    margin-bottom: 2px !important; 
    color: var(--cm-text-static) !important; 
    display: block !important; 
}
.cm-user-greeting.cm-greeting-welcome {
    font-size: 7.5px !important;
    letter-spacing: 0.3px !important;
}
.cm-header-user-meta { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    line-height: 1; 
    min-width: 0; 
    max-width: 150px; 
}
.cm-user-name-row { 
    display: inline-flex; 
    align-items: center; 
    vertical-align: middle; 
    gap: 1.5px !important; 
    min-width: 0; 
}
.cm-user-name-text { 
    font-size: clamp(10px, 2.1vw, 11.5px); 
    font-weight: 700; 
    max-width: 120px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    color: var(--cm-accent) !important; 
    line-height: 1; 
    display: inline-flex; 
    align-items: center; 
}
.cm-user-badge-pill { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    line-height: 1; 
    margin-left: 0 !important; 
    margin-right: 0 !important; 
    vertical-align: middle; 
    flex-shrink: 0; 
    transform: translateY(-0.5px); 
}
.cm-header-user-meta .cm-user-badge-pill {
    margin-left: -0.5px !important;
}
.cm-header-user-meta .cm-user-badge-pill svg,
.cm-header-user-meta .cm-verified-badge-svg {
    width: 12px !important;
    height: 12px !important;
}
.cm-badge-glow-millionaire svg {
    animation: cm-gem-glow-gold 3s ease-in-out infinite alternate;
}
.cm-badge-glow-billionaire svg {
    animation: cm-gem-glow-amber 2.6s ease-in-out infinite alternate;
}
.cm-badge-glow-queen svg {
    animation: cm-gem-glow-queen 2.2s ease-in-out infinite alternate;
}
@keyframes cm-gem-glow-gold {
    0% { filter: drop-shadow(0 0 1px rgba(251, 191, 36, 0.45)); }
    100% { filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.95)) drop-shadow(0 0 8px rgba(245, 158, 11, 0.6)); }
}
@keyframes cm-gem-glow-amber {
    0% { filter: drop-shadow(0 0 1px rgba(249, 115, 22, 0.45)); }
    100% { filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.95)) drop-shadow(0 0 9px rgba(234, 88, 12, 0.65)); }
}
@keyframes cm-gem-glow-queen {
    0% { filter: drop-shadow(0 0 1.5px rgba(192, 132, 252, 0.5)); }
    100% { filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.95)) drop-shadow(0 0 10px rgba(147, 51, 234, 0.7)); }
}

.cm-header-brand-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    text-align: center;
}
.cm-header-brand { font-family: 'Bebas Neue', sans-serif; font-size: 24px; line-height: 1; letter-spacing: 1px; color: var(--cm-text-static) !important; text-decoration: none; }
.cm-header-tagline { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; color: var(--cm-accent) !important; }
.cm-header-controls-block { 
    display: flex; 
    align-items: center; 
    height: 70px;
    gap: 4px; 
    flex-shrink: 0; 
    z-index: 2; 
}
.cm-icon-btn { background: none; border: none; padding: 6px; cursor: pointer; color: var(--cm-text-static); }

/* --- GLASSMORPHIC INTELLIGENT LIVE SEARCH OVERLAY --- */
.cm-search-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 99996; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.cm-search-backdrop.active { opacity: 1; pointer-events: all; }

.cm-dropdown-search {
    position: fixed;
    top: 78px;
    bottom: 98px;
    left: 12px;
    right: 12px;
    margin: 0 auto;
    transform-origin: 85% 0;
    transform: scale(0.95) translateY(-6px);
    max-width: 580px;
    max-height: calc(100vh - 176px);
    max-height: calc(100dvh - 176px);
    height: auto;
    background: var(--cm-surface) !important;
    backdrop-filter: blur(34px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(34px) saturate(180%) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: 22px;
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
}
html[data-theme="light"] .cm-search-backdrop {
    background: color-mix(in srgb, var(--cm-bg) 56%, transparent);
    backdrop-filter: blur(36px) saturate(140%);
    -webkit-backdrop-filter: blur(36px) saturate(140%);
}
html[data-theme="light"] .cm-dropdown-search {
    background: color-mix(in srgb, var(--cm-bg) 52%, transparent) !important;
    backdrop-filter: blur(44px) saturate(185%) !important;
    -webkit-backdrop-filter: blur(44px) saturate(185%) !important;
    box-shadow: 0 22px 54px rgba(20, 10, 14, 0.16) !important;
}
.cm-dropdown-search.active { opacity: 1; pointer-events: all; transform: scale(1) translateY(0); }
.cm-dropdown-search form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 56px;
    min-height: 56px;
    flex-shrink: 0;
    padding: 0 16px;
    gap: 10px;
    border-bottom: 1px solid var(--cm-border);
    box-sizing: border-box;
}
.cm-search-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-accent);
    opacity: 0.85;
    flex-shrink: 0;
}
.cm-dropdown-search input {
    flex-grow: 1;
    background: transparent;
    border: none;
    font-size: 15px;
    outline: none;
    padding: 0;
    color: var(--cm-text-static) !important;
}

.cm-search-quick-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 50px;
    min-height: 50px;
    overflow-x: auto;
    overflow-y: hidden !important;
    touch-action: pan-x !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
    border-bottom: none !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cm-search-quick-tags::-webkit-scrollbar { display: none; }
.cm-search-tag-pill {
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--cm-panel);
    border: 1px solid var(--cm-border);
    color: var(--cm-text-static) !important;
    border-radius: 999px;
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.cm-search-tag-pill:hover,
.cm-search-tag-pill:focus {
    border-color: var(--cm-accent);
    color: var(--cm-accent) !important;
}
.cm-search-tag-pill.active {
    background: var(--cm-accent) !important;
    color: var(--cm-btn-accent-color, #ffffff) !important;
    border-color: var(--cm-accent) !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .cm-search-tag-pill {
    background: var(--cm-panel);
    border: 1px solid var(--cm-border);
    color: var(--cm-text-static) !important;
}
html[data-theme="light"] .cm-search-tag-pill.active {
    background: var(--cm-accent) !important;
    color: #000000 !important;
    border-color: var(--cm-accent) !important;
    font-weight: 800 !important;
}

.cm-search-live-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.cm-search-live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cm-search-live-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cm-accent);
}
.cm-search-view-all {
    font-size: 11px;
    font-weight: 600;
    color: var(--cm-text-static);
    opacity: 0.75;
    text-decoration: none;
}
.cm-search-view-all:hover { opacity: 1; color: var(--cm-accent); }
.cm-search-live-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cm-search-item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--cm-panel) !important;
    border: 1px solid var(--cm-border) !important;
    text-decoration: none;
    color: var(--cm-text-static);
    transition: all 0.2s ease;
}
html[data-theme="light"] .cm-search-item-card {
    background: var(--cm-card-glass) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-color: var(--cm-border) !important;
}
html[data-theme="light"] .cm-search-item-cat {
    opacity: 1;
    color: var(--cm-text-muted, var(--cm-accent));
}
.cm-search-item-card:hover {
    border-color: var(--cm-accent) !important;
    background: var(--cm-surface) !important;
    transform: translateX(2px);
}
.cm-search-item-thumb {
    width: 52px;
    height: 62px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
}
.cm-search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cm-search-item-cat {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cm-accent);
    opacity: 0.85;
}
.cm-search-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cm-text-static);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cm-search-item-title mark {
    background: rgba(232, 180, 184, 0.28);
    color: var(--cm-accent);
    padding: 0 2px;
    border-radius: 3px;
}
.cm-search-item-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--cm-text-static);
    opacity: 0.9;
}
.cm-search-item-cta {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    color: var(--cm-accent);
    flex-shrink: 0;
}
.cm-search-empty-state {
    text-align: center;
    padding: 20px 12px;
    font-size: 13px;
    color: var(--cm-text-static);
    opacity: 0.7;
}

/* SEARCH BAR WEB_KIT RESET */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
}

/* --- GLASSMORPHIC MENU DRAWER --- */
.cm-drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 100000 !important; opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.cm-drawer-overlay.active { opacity: 1; pointer-events: all; }
html[data-theme="light"] .cm-drawer-overlay {
    background: color-mix(in srgb, var(--cm-bg) 56%, transparent);
    backdrop-filter: blur(36px) saturate(140%);
    -webkit-backdrop-filter: blur(36px) saturate(140%);
}

.cm-side-drawer {
    position: fixed; top: 80px; right: 16px; bottom: 95px;
    transform-origin: top right; transform: scale(0);
    width: 60vw; max-width: 320px;
    background: var(--cm-surface) !important; 
    backdrop-filter: blur(30px) !important; -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid var(--cm-border) !important; border-radius: 30px;
    z-index: 100001 !important; opacity: 0; pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 35px 24px; box-shadow: none !important;
    overflow-y: auto; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center;
}
html[data-theme="light"] .cm-side-drawer {
    background: color-mix(in srgb, var(--cm-bg) 52%, transparent) !important;
    backdrop-filter: blur(44px) saturate(185%) !important;
    -webkit-backdrop-filter: blur(44px) saturate(185%) !important;
    box-shadow: 0 22px 54px rgba(20, 10, 14, 0.16) !important;
}
html[data-theme="light"] .cm-drawer-menu a,
html[data-theme="light"] .cm-drawer-socials a {
    color: var(--cm-accent) !important;
}
html[data-theme="light"] .cm-drawer-submenu li a {
    color: var(--cm-accent) !important;
    opacity: 0.85;
}
@media (max-width: 480px) { .cm-side-drawer { width: 75vw; } }
.cm-side-drawer.active { opacity: 1; pointer-events: all; transform: scale(1); }

.cm-drawer-close-btn { position: absolute; top: 16px; right: 16px; background: none; border: none; padding: 6px; }
.cm-drawer-heading { font-size: 12px; text-transform: uppercase; margin-bottom: 15px; letter-spacing: 2px; color: var(--cm-accent) !important; text-align: center; }
.cm-drawer-menu { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 16px; margin: 0; text-align: center; width: 100%; }
.cm-drawer-menu a { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--cm-text-static); transition: 0.3s; }
.cm-drawer-divider { border: 0; height: 1px; background: var(--cm-border); margin: 25px auto; width: 50%; }
.cm-drawer-socials { display: flex; justify-content: center; gap: 20px; margin-top: 20px; font-size: 24px; }

/* --- DYNAMIC SUBMENU STYLES --- */
.cm-has-dropdown { position: relative; width: 100%; }

.cm-menu-item-wrap {
    display: flex;
    justify-content: center; /* Keeps your category names perfectly centered */
    align-items: center;
    position: relative;
    width: 100%;
}

.cm-drawer-dropdown-toggle {
    position: absolute; /* Floats the arrow to the right without pushing text */
    right: 0;
    background: transparent;
    border: none;
    color: var(--cm-text-static);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    opacity: 0.5;
}

.cm-drawer-dropdown-toggle:hover { opacity: 1; color: var(--cm-accent); }

.cm-drawer-dropdown-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

/* STRICT Rotation state: Only flip the arrow for the EXACT level that is open */
.cm-has-dropdown.is-open > .cm-menu-item-wrap > .cm-drawer-dropdown-toggle i {
    transform: rotate(180deg);
    color: var(--cm-accent);
}

.cm-drawer-submenu {
    display: none; /* Hidden by default, JS handles the slide */
    list-style: none;
    padding: 12px 0 0 0;
    margin: 0;
    text-align: center;
}

.cm-drawer-submenu li {
    margin-bottom: 12px;
}

.cm-drawer-submenu li:last-child {
    margin-bottom: 0;
}

.cm-drawer-submenu li a {
    font-size: 13px !important; /* Slightly smaller to differentiate from parents */
    font-weight: 500;
    opacity: 0.6;
}

.cm-drawer-submenu li a:hover {
    opacity: 1;
    color: var(--cm-accent);
}

/* --- RICH FOOTER --- */
@keyframes waveBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.cm-rich-footer { padding: 24px 20px 140px !important; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cm-footer-logo { font-family: 'Bebas Neue', sans-serif; font-size: 28px; margin: 0 0 15px 0; color: var(--cm-text-static) !important; }
.cm-footer-tagline { font-size: 14px; font-weight: 500; margin: 0 0 30px 0; color: var(--cm-text-static) !important; }
.cm-footer-hr { width: 60%; max-width: 300px; height: 1px; background: var(--cm-border); border: none; margin: 0 auto 30px; }
.cm-social-phosphor { display: flex; justify-content: center; gap: 24px; margin-bottom: 30px; font-size: 32px; }
.cm-social-phosphor a { display: block; animation: waveBounce 2.5s infinite ease-in-out; color: var(--cm-accent) !important; }
.cm-social-phosphor a:nth-child(1) { animation-delay: 0s; }
.cm-social-phosphor a:nth-child(2) { animation-delay: 0.15s; }
.cm-social-phosphor a:nth-child(3) { animation-delay: 0.3s; }
.cm-social-phosphor a:nth-child(4) { animation-delay: 0.45s; }
.cm-social-phosphor a:nth-child(5) { animation-delay: 0.6s; }

.cm-footer-text a { font-weight: 600 !important; font-size: 16px; margin: 6px 0; display: inline-block; white-space: nowrap; color: var(--cm-accent) !important; }

/* Payment Badges Row */
.cm-payment-badges { display: flex; flex-wrap: nowrap !important; justify-content: center; align-items: center; gap: 6px; margin-bottom: 30px; width: 100%; }
.cm-badge { 
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; 
    padding: 4px 6px; border-radius: 6px; height: 26px;
    background: var(--cm-glass-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--cm-glass-border); 
    animation: waveBounce 3s infinite ease-in-out; box-shadow: none !important;
}
/* =========================================================
   CUSTOM SIZING FOR INDIVIDUAL BADGES
========================================================= */

/* 1. Mastercard (Smaller) */
.cm-payment-badges .cm-badge:nth-child(1) { animation-delay: 0s; width: 30px; } 
.cm-payment-badges .cm-badge:nth-child(1) svg { height: 12px !important; }

/* 2. Visa */
.cm-payment-badges .cm-badge:nth-child(2) { animation-delay: 0.1s; } 

/* 3. Tabby (Bigger) */
.cm-payment-badges .cm-badge:nth-child(3) { animation-delay: 0.2s; width: 38px; } 
.cm-payment-badges .cm-badge:nth-child(3) svg { height: 18px !important; } 

/* 4. Tamara (Smaller) */
.cm-payment-badges .cm-badge:nth-child(4) { animation-delay: 0.3s; font-size: 11px; } 

/* 5. Apple Pay (Smaller) */
.cm-payment-badges .cm-badge:nth-child(5) { animation-delay: 0.4s; font-size: 11px; }
.cm-payment-badges .cm-badge:nth-child(5) i { font-size: 12px !important; margin-right: 3px !important; }

/* 6. Google Pay (Smaller) */
.cm-payment-badges .cm-badge:nth-child(6) { animation-delay: 0.5s; width: 38px; } 
.cm-payment-badges .cm-badge:nth-child(6) svg { height: 11px !important; }

/* 7. Cash */
.cm-payment-badges .cm-badge:nth-child(7) { animation-delay: 0.6s; font-weight: 800; font-size: 11px; letter-spacing: 0.5px; }

/* Default SVG Height (Fallback for anything else) */
.cm-badge svg { height: 14px !important; width: auto !important; }

/* Text & Custom Classes */
.cm-badge-visa { color: #1434CB !important; font-size: 11px; font-weight: 800; font-style: italic; }
.cm-badge-tamara { color: #D9AEFF !important; font-weight: 800; }
html[data-theme="light"] .cm-badge-tamara { color: #7c3aed !important; }
.cm-badge-cash svg { transform: scale(1.9) !important; }
/* Increase the internal size of the Tabby logo to ignore SVG canvas whitespace */
.cm-badge-tabby svg {
    transform: scale(3.0) !important; 
}

.cm-footer-links-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-bottom: 20px; font-weight: 600; }
.cm-footer-links-row a { color: var(--cm-text-muted); text-decoration: none; transition: color 0.2s ease; }
.cm-footer-links-row a:hover { color: var(--cm-accent); }

.cm-footer-app-wrap { margin: 12px auto 24px auto; text-align: center; }
.cm-footer-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 24px;
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    color: var(--cm-accent) !important;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cm-footer-app-btn:hover {
    background: var(--cm-accent);
    color: var(--cm-btn-accent-color, #ffffff) !important;
    border-color: var(--cm-accent);
    transform: translateY(-1px);
}
.cm-footer-app-btn i { font-size: 15px; }

.cm-copyright { font-size: 12px; font-weight: 500; margin: 0; color: var(--cm-text-static) !important; }

/* --- GLASSMORPHIC FLOATING BOTTOM NAV --- */
.cm-bottom-nav-container {
    position: fixed !important; bottom: max(16px, calc(10px + env(safe-area-inset-bottom, 0px))) !important; left: 50% !important; transform: translateX(-50%) !important;
    width: calc(100% - 32px) !important; max-width: 440px !important; height: 66px !important;
    background: var(--cm-surface) !important; 
    backdrop-filter: blur(30px) !important; -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid var(--cm-border) !important; border-radius: 40px !important; 
    box-shadow: none !important; /* STRICT: Pure Glassmorphism, Zero Unwanted Shadows */
    display: flex !important; flex-direction: row !important; justify-content: space-evenly !important; align-items: center !important;
    z-index: 99997 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
}
.cm-nav-item { 
    position: relative !important; 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center !important; 
    justify-content: center !important; 
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 100% !important; 
    font-size: 10px; 
    color: var(--cm-accent) !important; 
    text-decoration: none !important;
    box-sizing: border-box !important;
}
.cm-nav-item svg { width: 22px !important; height: 22px !important; margin-bottom: 2px; flex-shrink: 0; overflow: visible !important; }

/* Tawk Mobile Windowed Positioning */
@media (max-width: 768px) {
    #tawk-m-container,
    div[class*="tawk-mobile-container"] {
        max-height: 84vh !important;
        bottom: 10px !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 48px rgba(0,0,0,0.38) !important;
        overflow: hidden !important;
    }
}

body:not(.woocommerce-order-received) main#primary { 
    padding-top: 86px !important; 
    padding-bottom: max(16px, calc(10px + env(safe-area-inset-bottom, 0px))) !important; 
    min-height: 85vh !important; 
}

@media (display-mode: standalone) {
    html,
    body {
        background: var(--cm-bg) !important;
        background-color: var(--cm-bg) !important;
    }
    .cm-app-header {
        background: var(--cm-bg) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

body.woocommerce-order-received main#primary,
body.woocommerce-order-received .site-main,
body.woocommerce-order-received #primary,
body.woocommerce-order-received .woocommerce {
    padding-top: 10px !important;
    margin-top: 0 !important;
}

/* Hide Concierge Floating Bubble while Search Overlay, Menu Drawer, or Backdrop is Active */
body.cm-search-open #cm-chat-widget-root,
body:has(.cm-dropdown-search.active) #cm-chat-widget-root,
body:has(.cm-search-backdrop.active) #cm-chat-widget-root,
body.cm-drawer-open #cm-chat-widget-root:not(:has(#cmChatWindow.cm-chat-open)),
body:has(.cm-side-drawer.active) #cm-chat-widget-root:not(:has(#cmChatWindow.cm-chat-open)),
body:has(.cm-drawer-overlay.active) #cm-chat-widget-root:not(:has(#cmChatWindow.cm-chat-open)) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Force Cash SVG to adapt to Dark/Light Mode text colors */
.cm-badge-cash svg path, 
.cm-badge-cash svg .fil0 {
    fill: var(--cm-text-static) !important;
    stroke: var(--cm-text-static) !important;
}

/* =========================================================
   SHRINK RAY: HEADER, FOOTER & BOTTOM NAV (< 365px)
========================================================= */
@media (max-width: 365px) {
    /* 1. HEADER: Shrink logo and hide 'Welcome' to save space for Sign In */
    .site-header, .header-wrapper, header { gap: 5px !important; padding: 0 12px !important; }
    .custom-logo, .site-branding img, header img { max-width: 90px !important; }
    .header-account-link span.welcome-text { display: none !important; } /* Leaves only 'Sign In' */
    .header-login-text { font-size: 11px !important; }

    /* 2. BOTTOM NAV: Shrink icons and text slightly */
    .cm-bottom-nav, .mobile-bottom-nav { padding: 8px 5px !important; gap: 2px !important; }
    .cm-bottom-nav i, .mobile-bottom-nav i { font-size: 16px !important; }
    .cm-bottom-nav span, .mobile-bottom-nav span { font-size: 8px !important; }

    /* 3. FOOTER PAYMENTS: Force wrap so they drop to the next line */
    .footer-payment-icons, .payment-methods-list { 
        flex-wrap: wrap !important; 
        justify-content: center !important; 
        gap: 6px !important; 
    }
    .footer-payment-icons img, .payment-methods-list img { max-width: 30px !important; }
}