/* Ruhratna Side Menu — Frontend drawer styles.
 * All selectors prefixed rmm- to avoid theme conflicts. */

:root {
    --rmm-font-heading: 'Cormorant Garamond', Georgia, serif;
    --rmm-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --rmm-gold: #c8a96e;
    --rmm-gold-light: #f9f3ec;
    --rmm-text: #1a1a1a;
    --rmm-text-muted: #666;
    --rmm-border: #e8e0d5;
    --rmm-bg: #ffffff;
    --rmm-overlay-bg: rgba(0, 0, 0, 0.5);

    /* Mobile: dynamic — covers 88% of the phone, capped at 400px so it
       scales to any device while always leaving a consistent gap. */
    --rmm-drawer-width: min(88vw, 400px);
    --rmm-transition: 300ms ease;
    --rmm-z-drawer: 99999;
    --rmm-z-overlay: 99998;
}

/* Desktop: fixed 400px to match the site's cart side-panel. */
@media (min-width: 768px) {
    :root {
        --rmm-drawer-width: 400px;
    }
}

/* ---------------- Overlay ---------------- */
.rmm-overlay {
    position: fixed;
    inset: 0;
    background: var(--rmm-overlay-bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--rmm-transition), visibility var(--rmm-transition);
    z-index: var(--rmm-z-overlay);
}
.rmm-overlay.rmm-open {
    opacity: 1;
    visibility: visible;
}

/* ---------------- Drawer ---------------- */
.rmm-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    /* Dynamic viewport height: avoids the bottom gap mobile browsers leave
       (their toolbar makes bottom:0 not reach the true visible bottom).
       top/bottom:0 stays as the fallback for browsers without dvh. */
    height: 100dvh;
    width: var(--rmm-drawer-width);
    max-width: 88vw;
    background: var(--rmm-bg);
    color: var(--rmm-text);
    font-family: var(--rmm-font-body);
    z-index: var(--rmm-z-drawer);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--rmm-transition);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}
.rmm-drawer *,
.rmm-drawer *::before,
.rmm-drawer *::after { box-sizing: border-box; }

/* Remove the blue mobile tap highlight inside the drawer and on the trigger. */
#ruhratna-menu-drawer *,
.rmm-hamburger {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.rmm-slide-left {
    left: 0;
    transform: translateX(-100%);
}
.rmm-slide-right {
    right: 0;
    transform: translateX(100%);
}
.rmm-drawer.rmm-open {
    transform: translateX(0);
}

/* ---------------- Button reset (drawer scope only) ----------------
 * Neutralizes inherited theme button styles (pink/red backgrounds,
 * borders, etc.). Specific button styles are re-added below, each
 * scoped under #ruhratna-menu-drawer. The hamburger trigger lives
 * OUTSIDE the drawer and is intentionally not affected. */
#ruhratna-menu-drawer button {
    all: unset;
    cursor: pointer;
}
/* Keep keyboard focus visible after the reset. */
#ruhratna-menu-drawer button:focus-visible {
    outline: 2px solid var(--rmm-gold);
    outline-offset: 2px;
}

/* ---------------- Header ---------------- */
/* Drawer header — align RUHRATNA and X on same baseline */
.rmm-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Fluid: caps at the desktop/big-phone size, scales down on small phones. */
    padding: clamp(13px, 4.2vw, 20px) 20px;
    border-bottom: 1px solid #e8e0d5;
    min-height: clamp(50px, 14vw, 60px);
}

/* Scrollable middle region: nav items + AI Stylist card + footer.
   min-height:0 is required so this flex child can shrink and scroll.
   It's a flex column so the footer can be pushed to the bottom. */
.rmm-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}
/* Children must keep their natural height — without this, flexbox shrinks them
   (clipping the AI card's CTA under its overflow:hidden) instead of scrolling. */
.rmm-scroll > * {
    flex-shrink: 0;
}

/* Contact footer — now inside .rmm-scroll. `margin-top:auto` parks it at the
   bottom when the menu is short (looks pinned) but lets it scroll away with
   the content when the menu is tall (e.g. expanded submenus). */
.rmm-footer {
    flex: 0 0 auto;
    margin-top: auto;
    background: #16233A;
}

/* ---------------- Search trigger (in drawer) ---------------- */
/* Wrapper — pinned below the header, above the scrolling nav. No divider. */
#ruhratna-menu-drawer .rmm-search-wrap {
    flex: 0 0 auto;
    padding: 14px 16px;
}

/* Compact field-looking button that opens the search overlay. box-sizing
   is forced because the drawer's `all: unset` button reset makes it content-box. */
#ruhratna-menu-drawer .rmm-search-trigger {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8e0d5;
    border-radius: 8px;
    background: #fafafa;
    color: #999;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease;
}
#ruhratna-menu-drawer .rmm-search-trigger:hover,
#ruhratna-menu-drawer .rmm-search-trigger:focus-visible {
    border-color: #9C7940;
    outline: none;
}
#ruhratna-menu-drawer .rmm-search-ico {
    width: 16px;
    height: 16px;
    color: #9C7940;
    flex-shrink: 0;
}

/* ---------------- Search overlay (outside the drawer) ---------------- */
/* Full-viewport fixed layer. Centered panel on desktop, full-screen on mobile. */
.rmm-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    font-family: 'Helvetica Neue', sans-serif;
}
.rmm-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.rmm-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.rmm-search-panel {
    position: relative;
    margin-top: 6vh;          /* sit near the top so results grow downward */
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 82vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    transform: translateY(-10px);
    transition: transform 200ms ease;
}
.rmm-search-overlay.is-open .rmm-search-panel {
    transform: translateY(0);
}
.rmm-search-panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e0d5;
}
.rmm-search-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
/* ID-scoped so these outrank the theme's button:hover rule (which was
   enlarging the ✕). Every state pinned to the same size — no jump. */
#rmm-search-overlay .rmm-search-close,
#rmm-search-overlay .rmm-search-close:hover,
#rmm-search-overlay .rmm-search-close:focus,
#rmm-search-overlay .rmm-search-close:active {
    -webkit-appearance: none;
    appearance: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #1a1a1a !important;
    font-size: 24px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    cursor: pointer;
    padding: 4px !important;
    transform: none !important;
    transition: none !important;
    zoom: 1 !important;
    -webkit-tap-highlight-color: transparent;
}
.rmm-search-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 24px;
}

/* Mobile: panel fills the whole screen. */
@media (max-width: 767px) {
    .rmm-search-backdrop { display: none; }
    .rmm-search-panel {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
}

/* ---------------- FiboSearch (scoped to the overlay) ----------------
   Let FiboSearch render its native Pirx bar (it looks right on its own —
   see FiboSearch's preview). We ONLY constrain width so the 600px form
   fits our panel; no structural overrides that fight its layout. */
#rmm-search-overlay .dgwt-wcas-search-wrapp,
#rmm-search-overlay .dgwt-wcas-search-form,
#rmm-search-overlay .dgwt-wcas-sf-wrapp {
    width: 100% !important;
    max-width: 100% !important;
}

/* Slightly larger result titles so they read well in the wider panel. */
#rmm-search-overlay .dgwt-wcas-st {
    font-size: 15px !important;
}

/* Optional brand accents (colour only — safe, no layout impact). */
#rmm-search-overlay .dgwt-wcas-sp .woocommerce-Price-amount {
    color: #9C7940 !important;
}
#rmm-search-overlay .dgwt-wcas-suggestion-btn-wrapp a,
#rmm-search-overlay .dgwt-wcas-sall {
    color: #9C7940 !important;
}

/* RUHRATNA logo — correct color from brand color meter */
.rmm-logo {
    font-family: 'Butler', serif;
    font-size: clamp(21px, 6vw, 26px);
    font-weight: 500;
    color: #9C7940;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1;
}

/* Close button — same visual weight as logo */
#ruhratna-menu-drawer .rmm-close {
    font-size: 22px;
    color: #9C7940;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* Force the ✕ dark across states (overrides the gold color above). */
#ruhratna-menu-drawer .rmm-close,
#ruhratna-menu-drawer .rmm-close:hover,
#ruhratna-menu-drawer .rmm-close:focus {
    color: #1a1a1a !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ---------------- Nav ---------------- */
.rmm-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.rmm-nav[hidden] { display: none; }

.rmm-item { margin: 0; }

.rmm-item-row {
    display: flex;
    align-items: center;
}
.rmm-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    text-decoration: none;
    color: var(--rmm-text);
    padding: 14px 20px;
}
.rmm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--rmm-gold);
    flex: 0 0 auto;
}
.rmm-icon svg { width: 20px; height: 20px; }
.rmm-icon img { width: 20px; height: 20px; object-fit: contain; }

/* Toggle (+ that rotates into ×) */
#ruhratna-menu-drawer .rmm-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    width: 44px;
    cursor: pointer;
    color: #1a1a1a;
    flex: 0 0 auto;
    align-self: stretch;
    /* Smooth toggle button — rotates + to ×.
       Scoped under the drawer ID so it outranks the
       `#ruhratna-menu-drawer button { all: unset }` reset. */
    transition: transform 200ms ease;
}
#ruhratna-menu-drawer .rmm-toggle.is-open {
    transform: rotate(45deg);
}
/* No focus ring on click; keep a visible ring for keyboard focus only. */
#ruhratna-menu-drawer .rmm-toggle:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
}
#ruhratna-menu-drawer .rmm-toggle:focus-visible {
    outline: 2px solid #c8a96e;
    outline-offset: 2px;
}

/* Smooth submenu expand/collapse using max-height.
   visibility:hidden also pulls collapsed links out of the tab order. */
.rmm-nav.rmm-level-2,
.rmm-nav.rmm-level-3 {
    overflow: hidden;
    max-height: 0;
    visibility: hidden;
    transition: max-height 500ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 500ms cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
}

.rmm-nav.rmm-level-2.is-open,
.rmm-nav.rmm-level-3.is-open {
    max-height: 1000px;
    visibility: visible;
}

/* Level 1 */
.rmm-level-1 > .rmm-item {
    border-bottom: 1px solid var(--rmm-border);
}
/* Feature item (gold highlight) */
.rmm-level-1 > .rmm-item.rmm-feature > .rmm-item-row {
    background: var(--rmm-gold-light);
}
.rmm-level-1 > .rmm-item.rmm-feature > .rmm-item-row .rmm-label {
    color: var(--rmm-gold);
}

/* L1 typography */
.rmm-level-1 > .rmm-item > .rmm-item-row > .rmm-item-link .rmm-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a1a;
}

/* ── L2 ── */
/* Line must sit centered under L1 icon.
   L1 icon is 20px wide, starting at padding-left 20px
   So icon center = 20px + 10px = 30px from drawer edge
   border-left of rmm-level-2 must land at 30px */
.rmm-level-2 {
    border-left: 2px solid #e8e0d5;
    margin-left: 30px;
    padding-left: 0;
}

/* L2 text must align with L1 text start.
   L1 text starts at: icon width 20px + gap 12px = 32px
   L2 row already starts at 30px (margin) + 2px (border) = 32px
   So padding-left on row should be 0 — text naturally aligns */
.rmm-level-2 > .rmm-item > .rmm-item-row {
    padding-left: 12px;
}

.rmm-level-2 > .rmm-item > .rmm-item-row > .rmm-item-link {
    padding-left: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-transform: none;
    letter-spacing: 0;
}

/* ── L3 ── */
.rmm-level-3 {
    border-left: 2px solid #e8e0d5;
    margin-left: 16px;
    padding-left: 0;
}

.rmm-level-3 > .rmm-item > .rmm-item-row {
    padding-left: 12px;
}

.rmm-level-3 > .rmm-item > .rmm-item-row > .rmm-item-link {
    padding-left: 0;
    font-size: 14px;    /* same size as L2, NOT smaller */
    font-weight: 400;   /* lighter weight to show hierarchy */
    color: #999999;     /* muted but readable */
    text-transform: none;
    letter-spacing: 0;
}

/* ---------------- AI Stylist card ---------------- */
/* Card — more spacious */
.rmm-ai-card {
    background: #0f0e0a;
    margin: 16px;
    border-radius: 12px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.rmm-ai-card-inner {
    padding: 16px 16px 0 16px;
}

.rmm-ai-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* AI Stylist label — NO box, just text + icon */
.rmm-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #C9A96E;
    letter-spacing: 0.03em;
    white-space: nowrap;
    /* Anchor the breathing glow that sits behind the (static) text. */
    position: relative;
    isolation: isolate;
}

/* Soft golden glow BEHIND the title that breathes in and out.
   The text itself never moves — only this glow grows and fades. */
.rmm-ai-pill::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: 150%;
    height: 220%;
    transform: translate(-50%, -50%) scale(0.8);
    background: radial-gradient(closest-side, rgba(201, 169, 110, 0.55), rgba(201, 169, 110, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: rmm-breathe-glow 3.6s ease-in-out infinite;
}

@keyframes rmm-breathe-glow {
    0%, 100% { opacity: 0.2;  transform: translate(-50%, -50%) scale(0.8); }
    50%      { opacity: 0.7;  transform: translate(-50%, -50%) scale(1.15); }
}

/* Respect users who prefer reduced motion: keep everything static. */
@media (prefers-reduced-motion: reduce) {
    .rmm-ai-pill::before,
    .rmm-ai-live-dot::before,
    .rmm-ai-live-dot::after {
        animation: none;
    }
}

.rmm-ai-spark {
    color: #C9A96E;
    flex-shrink: 0;
    display: block;
    width: 26px;
    height: 26px;
}

/* LIVE badge — bigger */
.rmm-ai-live {
    display: flex;
    align-items: center;
    /* Extra gap gives the dot's ripple room so it doesn't clip the "L". */
    gap: 14px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #C9A96E;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rmm-ai-live-dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #C9A96E;
    flex-shrink: 0;
}

/* Radar ripple — two staggered rings expand out from the solid dot,
   giving a continuous "broadcasting / live" pulse. */
.rmm-ai-live-dot::before,
.rmm-ai-live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #C9A96E;
    opacity: 0.5;
    animation: rmm-live-ripple 2.8s ease-out infinite;
}
.rmm-ai-live-dot::after {
    animation-delay: 1.4s;
}

@keyframes rmm-live-ripple {
    0%   { transform: scale(1);   opacity: 0.5; }
    100% { transform: scale(3.2); opacity: 0;   }
}

/* Body text — equal space above and below */
.rmm-ai-card-body {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
    margin: 0;
    padding-bottom: 14px;
}

/* CTA button — centered text, full bleed */
#ruhratna-menu-drawer .rmm-ai-card-cta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 52px !important;
    padding: 14px 16px !important;
    background: #C9A96E !important;
    color: #1A1200 !important;
    font-family: 'Helvetica Neue', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    border: none !important;
    border-radius: 0 0 12px 12px !important;
    cursor: pointer !important;
    text-align: center !important;
    -webkit-tap-highlight-color: transparent !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    /* `normal` (not 1) so symmetric leading keeps the label centered on
       Android's fallback font — Helvetica Neue doesn't exist there, and
       line-height:1 exposed that font's asymmetric vertical metrics. */
    line-height: normal !important;
}

#ruhratna-menu-drawer .rmm-ai-card-cta:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ---------------- Contact + social icon row ---------------- */
.rmm-contact-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fluid: caps at current size, scales down on small phones. */
    gap: clamp(12px, 3.6vw, 16px);
    padding: clamp(11px, 3.4vw, 16px) 20px clamp(13px, 4vw, 18px) 20px;
}

.rmm-contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 9vw, 36px);
    height: clamp(32px, 9vw, 36px);
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    text-decoration: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 200ms ease, border-color 200ms ease;
}

.rmm-contact-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.rmm-contact-icon:hover,
.rmm-contact-icon:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ---------------- Hamburger trigger ---------------- */
/* Base reset — applies to both shortcode and fixed variants.
 * !important is intentional: themes target buttons with element+class
 * selectors whose specificity beats `all: unset` alone, which is what
 * was bleeding a pink background/border through. */
.rmm-hamburger,
.rmm-hamburger:hover,
.rmm-hamburger:focus,
.rmm-hamburger:active {
    all: unset;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: #1a1a1a;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.rmm-hamburger svg {
    display: block;
    width: 24px;
    height: 24px;
}

.rmm-hamburger:focus-visible {
    outline: 2px solid #c8a96e;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Fixed variant only. These re-override the base reset above, so they must
 * also use !important to win against the base's !important declarations. */
.rmm-hamburger-fixed {
    background: #fff !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    padding: 8px;
    width: 40px;
    height: 40px;
}

/* Body scroll lock helper (set inline via JS as fallback). */
.rmm-no-scroll { overflow: hidden; }
