/* =============================================================================
   RATNA GEMS MEGA MENU
   Used on: Site-wide (header navigation) — desktop only (≥ 922 px)
   ============================================================================= */

/* --- Box-sizing reset for mega menu --- */

.rg-mega-overlay *,
.rg-mega-overlay *::before,
.rg-mega-overlay *::after {
    box-sizing: border-box;
}

/* =============================================================================
   1. BACKDROP — semi-transparent scrim behind panel
   ============================================================================= */

.rg-mega-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.rg-mega-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =============================================================================
   2. OVERLAY PANEL — contained, centered, slide-down entrance
   ============================================================================= */

.rg-mega-overlay {
    position: fixed;
    left: 50%;
    z-index: 999;
    transform: translateX(-50%) translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease,
                visibility 0.25s ease,
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.18),
                0 8px 20px -8px rgba(0, 0, 0, 0.1);
}

.rg-mega-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* =============================================================================
   3. PANEL SECTION — backgrounds & padding
   ============================================================================= */

.ratna-mm-section {
    padding: 1.5rem 2rem 1.75rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

/* Backgrounds */
.ratna-mm-bg-light {
    background-color: #ffffff;
}

.ratna-mm-bg-warm {
    background-color: #FDFAF5;
    padding: 1.75rem 2rem 2rem;
}

/* =============================================================================
   4. GRID SYSTEM — widths drive the panel size
   ============================================================================= */

.ratna-mm-container {
    margin: 0 auto;
    display: grid;
    gap: 0.75rem;
}

/* 2-col: 10 precious gems — compact panel */
.ratna-mm-grid--2-col {
    grid-template-columns: repeat(2, 1fr);
    width: 580px;
}

/* 4-col: 18 semi-precious gems — wider panel */
.ratna-mm-grid--4-col {
    grid-template-columns: repeat(4, 1fr);
    width: 1060px;
    gap: 0.65rem;
}

/* Rudraksha: 2 featured + 2 list columns */
.ratna-mm-grid--rudra-layout {
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
    width: 1100px;
    gap: 1.25rem;
    align-items: start;
}

/* =============================================================================
   5. CARD ITEMS — gem/rudraksha links
   ============================================================================= */

.ratna-mm-card {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.7rem;
    min-height: 44px;
    text-decoration: none;
    border-radius: 10px;
    background-color: #FFFFFF;
    border: 1px solid #E8ECF0;
    transition: transform 0.2s ease,
                box-shadow 0.2s ease,
                border-color 0.2s ease;
}

.ratna-mm-bg-warm .ratna-mm-card {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background-color: #FFFFFF;
    border-color: #E8E0D6;
}

.ratna-mm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 78, 129, 0.1);
    border-color: #B8D4E8;
}

.ratna-mm-bg-warm .ratna-mm-card:hover {
    box-shadow: 0 6px 20px rgba(93, 64, 55, 0.1);
    border-color: #C8B8A8;
}

.ratna-mm-card:focus-visible {
    outline: 2px solid #005A9C;
    outline-offset: 2px;
}

/* Card image */
.ratna-mm-card__img-wrap {
    width: 44px;
    height: 34px;
    flex-shrink: 0;
    margin-right: 0.65rem;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #E8ECF0;
}

.ratna-mm-bg-warm .ratna-mm-card__img-wrap {
    width: 48px;
    height: 28px;
    border-radius: 6px;
    border-color: #E8E0D6;
}

.ratna-mm-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card title */
.ratna-mm-card__title {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.35;
}

.ratna-mm-bg-warm .ratna-mm-card__title {
    font-size: 0.92rem;
    color: #44362E;
}

/* =============================================================================
   6. FEATURED ITEMS — Rudraksha panel
   ============================================================================= */

.ratna-mm-featured__link {
    display: block;
    text-decoration: none;
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E8E0D6;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ratna-mm-featured__link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(93, 64, 55, 0.12);
}

.ratna-mm-featured__link:focus-visible {
    outline: 2px solid #5D4037;
    outline-offset: 2px;
}

.ratna-mm-featured__figure {
    margin: 0;
}

.ratna-mm-featured__img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.ratna-mm-featured__caption {
    padding: 0.85rem 1rem;
    text-align: center;
    background: linear-gradient(to bottom, #FDFAF5, #F5EDE0);
}

.ratna-mm-featured__title {
    font-size: 1.05rem;
    color: #5D4037;
    margin: 0 0 0.2rem 0;
    font-weight: 700;
}

.ratna-mm-featured__desc {
    font-size: 0.82rem;
    color: #6D5D53;
    margin: 0;
    line-height: 1.45;
}

/* =============================================================================
   7. HELPERS
   ============================================================================= */

.ratna-mm-list-stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Bottom decorative accent */
.ratna-mm-decoration {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
}

.ratna-mm-decoration--cool {
    background: linear-gradient(90deg, #005A9C, #049553);
}

.ratna-mm-decoration--warm {
    background: linear-gradient(to right, #5D4037, #A1887F);
}

/* =============================================================================
   8. ACTIVE MENU TRIGGER HIGHLIGHT
   ============================================================================= */

.rg-has-mega-menu > .sub-menu {
    display: none !important;
}

.rg-has-mega-menu.rg-mega-active > a {
    color: #005A9C !important;
}

/* =============================================================================
   9. MOBILE SAFETY — should never load, but just in case
   ============================================================================= */

@media (max-width: 921px) {
    .rg-mega-overlay,
    .rg-mega-backdrop {
        display: none !important;
    }
}

/* =============================================================================
   10. REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    .ratna-mm-card,
    .ratna-mm-featured__link,
    .rg-mega-overlay,
    .rg-mega-backdrop {
        transition: none !important;
    }

    .ratna-mm-card:hover,
    .ratna-mm-featured__link:hover {
        transform: none !important;
    }

    .rg-mega-overlay.is-visible {
        transform: translateX(-50%) translateY(0) !important;
    }
}
