/**
 * Omaaa Astrology — Global Shell, 9-Group Mega-Menu & Quick-Tools Dock Styles
 * Step S03 Deliverable (MASTER_PROMPT Part 2 §1 & §5)
 */

/* 1. BhaktiLok Radiant Saffron Announcement Ticker */
.announcement-ticker {
    background: linear-gradient(90deg, #ff5e00 0%, #ff7800 50%, #ff9600 100%);
    color: #ffffff;
    font-size: 13px;
    padding: 7px 16px;
    overflow: hidden;
    position: relative;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(230, 81, 0, 0.2);
}
.ticker-track {
    display: flex;
    align-items: center;
    gap: 32px;
    width: max-content;
    animation: tickerScroll 240s linear infinite;
}
.ticker-track:hover {
    animation-play-state: paused;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ticker-star {
    color: #ffe066;
    font-size: 14px;
}
.ticker-item a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.ticker-item a:hover {
    text-decoration: underline;
}
@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 2. BhaktiLok Floating Pill Header */
.site-header {
    position: sticky;
    top: 8px;
    z-index: 100;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 16px;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid rgba(230, 81, 0, 0.18);
    box-shadow: 0 4px 20px rgba(180, 70, 0, 0.08);
    min-height: 58px;
    gap: 8px;
}
@media (max-width: 1024px) {
    .header-inner {
        border-radius: 16px;
        padding: 8px 14px;
    }
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.2);
}
.brand-text {
    font-size: 18px;
    font-weight: 800;
    color: #541D24;
    line-height: 1.1;
    letter-spacing: -0.3px;
}
.brand-tagline {
    font-size: 9.5px;
    color: #7A5C4D;
    display: block;
    font-weight: 500;
}

/* Nav & Mega-Menu Dropdowns */
.mega-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    position: static;
    flex-wrap: nowrap !important;
}
@media (max-width: 1024px) {
    .mega-nav {
        display: none;
    }
}
.mega-menu-item {
    position: static;
    flex-shrink: 0;
}
.mega-menu-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 10px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1c1917;
    cursor: pointer;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap !important;
    word-break: keep-all !important;
    text-wrap: nowrap !important;
    flex-shrink: 0;
    transition: all 0.18s ease;
}
.mega-menu-btn span {
    white-space: nowrap !important;
    word-break: keep-all !important;
    text-wrap: nowrap !important;
}
.mega-menu-btn:hover,
.mega-menu-btn:focus-visible,
.mega-menu-item.active .mega-menu-btn {
    background: #FFF7EE;
    border-color: #F8D8B8;
    color: #c2410c;
    outline: none;
    font-weight: 800;
}
.mega-menu-arrow {
    font-size: 8px;
    transition: transform 0.2s;
    opacity: 0.5;
}
.mega-menu-item.active .mega-menu-arrow {
    transform: rotate(180deg);
}

/* Mega-Menu Dropdown Panel — Centered within Header, Zero Viewport Clipping */
.mega-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 1080px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(44, 24, 16, 0.15);
    border: 1px solid #ebd9c8;
    padding: 24px 28px;
    z-index: 120;
    grid-template-columns: 3.2fr 1.2fr;
    gap: 24px;
}
.mega-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
    pointer-events: auto;
}
.mega-menu-item.active .mega-dropdown-panel {
    display: grid;
    animation: megaFadeIn 0.2s ease-out;
}
.mega-menu-item:not(.active) .mega-dropdown-panel {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
@keyframes megaFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.mega-columns-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.mega-columns-grid.cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mega-dropdown-panel {
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.mega-col,
.mega-promo-card {
    min-width: 0;
}
.mega-menu-btn { min-height: 44px; }
.mega-menu-btn:focus-visible,
.drawer-group-btn:focus-visible,
.mobile-drawer a:focus-visible,
.mobile-drawer button:focus-visible,
#mobile-menu-open-btn:focus-visible {
    outline: 2px solid #9a3412;
    outline-offset: 2px;
}
.drawer-group-content[hidden] { display: none !important; }
.drawer-menu-link {
    font-size: 14px;
    color: #1f2937;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 6px;
    border-radius: 7px;
    overflow-wrap: anywhere;
}
.drawer-menu-link:hover { background: #fff7ed; color: #9a3412; }
.drawer-menu-link > span:first-child { min-width: 0; }
.mobile-drawer { max-width: 100%; overscroll-behavior: contain; }
#mobile-drawer-close-btn { min-width: 44px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
    .mega-menu-item.active .mega-dropdown-panel { animation: none; }
    .mega-menu-btn, .mega-menu-arrow, .mobile-drawer { transition: none; }
}
@media (max-width: 1220px) {
    .mega-dropdown-panel {
        grid-template-columns: 1fr;
        max-height: 80vh;
        overflow-y: auto;
    }
    .mega-columns-grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.mega-col-title {
    font-size: 13px;
    font-weight: 800;
    color: #9a3412;
    letter-spacing: 0.2px;
    margin-bottom: 10px;
    border-bottom: 2px solid #fed7aa;
    padding-bottom: 6px;
}
.mega-col-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mega-col-list li {
    margin-bottom: 4px;
}
.mega-col-list a {
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 7px;
    overflow-wrap: break-word;
}
.mega-col-list a:hover,
.mega-col-list a:focus-visible {
    color: #c2410c;
    background: #fff7ed;
    outline: 2px solid rgba(234, 88, 12, 0.35);
    outline-offset: 1px;
}
.mega-link-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.mega-link-badge--vip {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}
.mega-link-badge--trial {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Promo Card Slot (BhaktiLok Style) */
.mega-promo-card {
    background: #FFFDF9;
    border: 1px solid #ebd9c8;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.mega-promo-badge {
    align-self: flex-start;
    background: #E8F8F5;
    color: #0E6251;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #A3E4D7;
}
.mega-promo-title {
    font-size: 16px;
    font-weight: 800;
    color: #541D24;
    margin: 0 0 8px 0;
    line-height: 1.3;
}
.mega-promo-desc {
    font-size: 12.5px;
    color: #5C4033;
    line-height: 1.6;
    margin-bottom: 16px;
}
.mega-promo-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 9px 18px;
    background: #00796b;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.25);
}
.mega-promo-cta:hover {
    background: #00796B;
    transform: translateY(-1px);
}

/* Header Utilities & BhaktiLok Badges */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.header-action-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    font-size: 14px;
}
.header-action-circle:hover {
    transform: scale(1.08);
}
.header-cal-badge {
    background: #E8F8F5;
    border-color: #A3E4D7;
    color: #0E6251;
    font-weight: 700;
    font-size: 12px;
}
.header-fav-badge {
    background: #FCE4EC;
    border-color: #F8BBD0;
    font-size: 14px;
}
.header-bell-badge {
    background: #FFF3E0;
    border-color: #FFE0B2;
    color: #E65100;
    font-size: 15px;
    padding: 0;
}
.header-actions .lang-switch {
    position: relative;
    flex-shrink: 0;
}
.header-actions .lang-switch summary {
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    min-height: 30px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #FFF7EE !important;
    border: 1.5px solid #F5C7A9 !important;
    color: #9A3412 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
}
.header-actions .lang-switch summary:hover {
    background: #FFEDD5 !important;
    border-color: #EA580C !important;
    color: #7C2D12 !important;
}
.header-actions .lang-switch summary .ui-icon {
    width: 14px !important;
    height: 14px !important;
}
.header-actions .lang-switch .lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #ebd9c8;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 1050;
    max-height: 380px;
    overflow-y: auto;
}
.header-icon-btn {
    background: #FFFDF9;
    border: 1px solid #ebd9c8;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}
.header-icon-btn:hover {
    background: #fdf5ea;
    border-color: var(--color-gold);
}
.icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-saffron);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
}

/* 3. Mobile Bottom Bar */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fffffffa;
    backdrop-filter: blur(8px);
    border-top: 1px solid #ebd9c8;
    z-index: 95;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
}
@media (max-width: 900px) {
    .mobile-bottom-bar {
        display: flex;
    }
    body {
        padding-bottom: 64px;
    }
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--color-charcoal-soft);
    font-size: 11px;
    font-weight: 600;
    gap: 2px;
    flex: 1;
    padding: 6px 0;
}
.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--color-saffron);
}
.mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
}

/* 4. Slide-in Mobile Drawer */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 39, 46, 0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
}
.mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(31, 39, 46, 0.2);
}
.mobile-drawer.open {
    transform: translateX(0);
}
.mobile-drawer-overlay.open {
    display: block;
}
.drawer-header {
    padding: 16px;
    border-bottom: 1px solid #ebd9c8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-accordion {
    padding: 12px;
    flex: 1;
}
.drawer-group-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-charcoal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f5ede6;
    cursor: pointer;
}
.drawer-group-content {
    display: none;
    padding: 8px 14px;
    background: #faf7f2;
    border-radius: 6px;
    margin-bottom: 8px;
}
.drawer-group.expanded .drawer-group-content {
    display: block;
}

/* 5. Floating Quick-Tools Dock */
.quick-dock-trigger {
    position: fixed;
    bottom: 74px;
    right: 20px;
    z-index: 90;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-saffron), var(--color-saffron-dark));
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(180, 75, 22, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s ease;
}
.quick-dock-trigger:hover {
    transform: scale(1.08);
}
.quick-dock-tray {
    display: none;
    position: fixed;
    bottom: 130px;
    right: 20px;
    z-index: 91;
    background: #fff;
    border: 1px solid #ebd9c8;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(31, 39, 46, 0.18);
    padding: 14px;
    width: 280px;
}
.quick-dock-tray.open {
    display: block;
    animation: dockSlideUp 0.2s ease-out;
}
@keyframes dockSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.quick-dock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.quick-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-charcoal);
    font-size: 11px;
    text-align: center;
    gap: 4px;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.quick-dock-item:hover {
    background: #faf7f2;
    color: var(--color-saffron);
}
.quick-dock-icon {
    font-size: 20px;
}

/* 6. Granular Consent Banner */
.consent-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ebd9c8;
    border-radius: var(--radius-md);
    padding: 18px 22px;
    box-shadow: 0 12px 36px rgba(31, 39, 46, 0.15);
    z-index: 140;
}
.consent-banner.show {
    display: block;
}
@media (max-width: 900px) {
    .consent-banner {
        bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        padding: 14px 16px !important;
        z-index: 150 !important;
    }
    body:has(.consent-banner.show) .quick-dock-trigger,
    .consent-banner.show ~ .quick-dock-trigger {
        display: none !important;
    }
}
.consent-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.consent-btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.consent-accept {
    background: var(--color-saffron);
    color: #fff;
}
.consent-essential {
    background: #fdf5ea;
    color: var(--color-charcoal);
    border-color: #ebd9c8;
}

/* 7. Dark Mode Overrides */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] #site-page,
html[data-theme="dark"] main,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .stories-section {
    background-color: #14181c !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] {
    --color-saffron: #FB923C;
    --color-saffron-light: #FDBA74;
    --color-saffron-dark: #EA580C;
    --ink: #F1F5F9;
    --ink-soft: #CBD5E1;
    --muted: #94A3B8;
    --bg: #14181c;
    --bg-alt: #1a2026;
    --card: #1E252D;
    --line: #334155;
    --brand: #FB923C;
    --brand-dark: #FDBA74;
    --forest: #F8FAFC;
    --color-charcoal: #f0f3f6;
    --color-charcoal-soft: #cbd5e1;
    --color-ivory: #14181c;
    --color-sand: #1c2126;
    background: #14181c;
    color: #f0f3f6;
}
html[data-theme="dark"] .section-alt,
html[data-theme="dark"] .hero-picker,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .sign-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .aside-card,
html[data-theme="dark"] .panchang-card,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .lang-tile,
html[data-theme="dark"] .puja-home-banner,
html[data-theme="dark"] .quick-path,
html[data-theme="dark"] .reassurance-row,
html[data-theme="dark"] .day-special-banner,
html[data-theme="dark"] .rashi-explorer-section,
html[data-theme="dark"] .cta-band,
html[data-theme="dark"] .bhaktilok-tile-card,
html[data-theme="dark"] .story-ring-inner {
    background: #1e252d !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html[data-theme="dark"] .bhaktilok-tile-card .tile-title,
html[data-theme="dark"] .story-ring-title,
html[data-theme="dark"] .stories-header h2,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .hero-picker-head,
html[data-theme="dark"] .pf-v,
html[data-theme="dark"] .feature h3,
html[data-theme="dark"] .article-card h3 {
    color: #f8fafc !important;
}
html[data-theme="dark"] .bhaktilok-tile-card .tile-sub,
html[data-theme="dark"] .sign-card-teaser,
html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .hero-sub,
html[data-theme="dark"] .pf-k {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .site-footer {
    background: #101418 !important;
    border-top: 1px solid #2e363e;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .site-footer a {
    color: #fdba74 !important;
}
[data-theme="dark"] .site-header,
[data-theme="dark"] .mobile-bottom-bar,
[data-theme="dark"] .mobile-drawer,
[data-theme="dark"] .mega-dropdown-panel,
[data-theme="dark"] .quick-dock-tray,
[data-theme="dark"] .consent-banner {
    background: #1a1f24f5;
    border-color: #2e363e;
    color: #f0f3f6;
}
[data-theme="dark"] .mobile-drawer a,
[data-theme="dark"] .mobile-drawer summary,
[data-theme="dark"] .mobile-nav-item,
[data-theme="dark"] .quick-dock-item,
[data-theme="dark"] .consent-essential {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .consent-essential,
[data-theme="dark"] .header-icon-btn,
[data-theme="dark"] .lang-switch summary,
[data-theme="dark"] .lang-menu {
    background: #232a31 !important;
    border-color: #38424d !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .lang-menu a {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .mega-promo-card,
[data-theme="dark"] .guidance-box {
    background: #232a31;
    border-color: #35404b;
}

/* Dark mode accessible text contrast (WCAG AAA >= 7:1) */
[data-theme="dark"] .mega-col-title {
    color: #fdba74 !important;
}
[data-theme="dark"] .mega-col-list a {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .mega-col-list a:hover,
[data-theme="dark"] .mega-col-list a:focus-visible {
    color: #fed7aa !important;
    background: #28313b !important;
}
[data-theme="dark"] .mega-promo-card h4 {
    color: #fef3c7 !important;
}
[data-theme="dark"] .mega-promo-desc {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .nav-cat-btn {
    color: #f1f5f9;
    background: #222931;
    border-color: #38424d;
}
[data-theme="dark"] .nav-cat-btn:hover,
[data-theme="dark"] .nav-cat-btn[aria-expanded="true"] {
    color: #fed7aa;
    background: #2b3540;
    border-color: #ea580c;
}
/* 8. Quick Tools Modal System (Zero document-flow leakage) */
.modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1060;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background: rgba(0, 0, 0, 0.65);
    padding: 16px;
    box-sizing: border-box;
}
.modal.show,
.modal.is-active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: auto;
    pointer-events: auto;
}
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid #ebd9c8;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #faf6f0;
    border-bottom: 1px solid #ebd9c8;
}
.modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #3b1e08;
}
.modal-body {
    position: relative;
    padding: 18px;
}
.btn-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    color: #7a5c4d;
}
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    opacity: 0.5;
    z-index: 1050;
}

/* Reduced-motion drawer rule must follow the base transition declaration. */
@media (prefers-reduced-motion: reduce) {
    .mobile-drawer { transition: none; }
}

/* Responsive Desktop Header Optimization (1025px - 1360px) to prevent action overflow */
@media (min-width: 1025px) and (max-width: 1360px) {
    .site-header {
        padding: 0 8px;
    }
    .header-inner {
        gap: 6px;
        padding: 4px 10px;
    }
    .mega-menu-btn {
        padding: 5px 6px;
        font-size: 13px;
        gap: 2px;
    }
    .brand-tagline {
        display: none;
    }
    .header-actions {
        gap: 4px;
    }
    .header-action-circle {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .header-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Mobile-First Header & Navigation Fixes (WCAG 2.1 AA, Viewports 320px - 768px)
   Resolves MA-001 (Header clipping & Hamburger visibility) and MA-014 (Touch targets)
   ========================================================================== */
@media (max-width: 1024px) {
    /* Anchor the language list to the full header on narrow screens. */
    .header-actions .lang-switch {
        position: static;
    }
    .header-actions .lang-switch .lang-menu {
        inset-inline-end: 8px;
        width: min(260px, calc(100% - 16px));
        min-width: 0;
        max-height: min(380px, calc(100dvh - 100px));
    }
    #mobile-menu-open-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-hide-mobile {
        display: none !important;
    }
    .header-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    #mobile-menu-open-btn {
        display: inline-flex !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 22px !important;
        border-radius: 10px !important;
        background: #FFF7EE !important;
        border: 1.5px solid #F5C7A9 !important;
        color: #9A3412 !important;
        box-shadow: 0 2px 6px rgba(180, 75, 22, 0.12);
        cursor: pointer;
    }
    #mobile-menu-open-btn:hover,
    #mobile-menu-open-btn:active {
        background: #FFEDD5 !important;
        border-color: #EA580C !important;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0 6px;
    }
    .header-inner {
        padding: 5px 8px;
        gap: 6px;
        min-height: 54px;
        box-sizing: border-box;
    }
    .brand-tagline {
        display: none !important;
    }
    .brand-text {
        font-size: 15.5px !important;
        white-space: nowrap;
    }
    .site-logo-img {
        width: 32px !important;
        height: 32px !important;
    }
    .header-actions {
        gap: 4px;
        flex-shrink: 0;
    }
    .header-actions .lang-switch summary {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-height: 44px !important;
        min-width: 44px !important;
    }
    .header-icon-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

@media (max-width: 360px) {
    .site-header {
        padding: 0 4px;
    }
    .header-inner {
        padding: 4px 5px;
        gap: 4px;
    }
    .brand {
        gap: 4px;
    }
    .site-logo-img {
        width: 28px !important;
        height: 28px !important;
    }
    .brand-text {
        font-size: 13.5px !important;
    }
    .header-actions .lang-switch summary {
        padding: 3px 6px !important;
        font-size: 11px !important;
        gap: 2px !important;
        min-height: 44px !important;
        min-width: 44px !important;
    }
    .header-icon-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    #mobile-menu-open-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 20px !important;
    }
}
