/**
 * ROUGE VINTAGE-INDUSTRIAL URBAN LOUNGE — MENU PAGE STYLES (REDESIGNED)
 * Main Color: #770b24 (Royal Velvet Rouge) | Accent: Antique Gold (#D4AF37)
 * Mobile-First Responsive
 */

.rg-page-menu {
    padding-bottom: 90px;
}

.rg-menu-stage {
    position: relative;
}

/* Menu Hero & Top Prelude */
.rg-menu-hero {
    padding: 18px 0 14px;
    position: relative;
}

@media (min-width: 640px) {
    .rg-menu-hero {
        padding: 30px 0 20px;
    }
}

.rg-menu-hero__plate {
    background: linear-gradient(180deg, rgba(35, 18, 25, 0.92) 0%, rgba(18, 13, 16, 0.98) 100%);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-lg);
    padding: 24px 16px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 35px var(--rg-primary-glow-soft);
    position: relative;
    overflow: hidden;
    text-align: center;
}

@media (min-width: 640px) {
    .rg-menu-hero__plate {
        padding: 38px 24px;
    }
}

/* Architectural Mural Sketch Watermark */
.rg-menu-hero__plate::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../../images/decor/coffee-compliments-mural.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    pointer-events: none;
    filter: sepia(30%) contrast(115%);
}

.rg-menu-hero__crest {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--rg-gold);
    margin: 0 auto 10px;
    box-shadow: 0 0 20px var(--rg-primary-glow), 0 0 12px var(--rg-gold-glow);
    display: block;
    position: relative;
    z-index: 1;
}

@media (min-width: 640px) {
    .rg-menu-hero__crest {
        width: 84px;
        height: 84px;
        margin-bottom: 12px;
    }
}

.rg-menu-hero__title {
    font-family: var(--rg-font-display);
    font-size: clamp(1.5rem, 5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--rg-parchment);
    margin: 2px 0 6px;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.85);
}

.rg-menu-hero__subtitle {
    font-size: clamp(0.82rem, 2.2vw, 0.95rem);
    color: var(--rg-parchment-muted);
    max-width: 620px;
    margin: 0 auto 18px;
    position: relative;
    z-index: 1;
    line-height: 1.65;
}

@media (min-width: 640px) {
    .rg-menu-hero__subtitle {
        margin-bottom: 24px;
    }
}

/* Instant Search Wrap (Optimized for Mobile Keyboards) */
.rg-search-wrap {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
    z-index: 1;
}

.rg-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rg-gold);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--rg-trans-fast);
}

.rg-search-input {
    width: 100%;
    padding: 13px 44px 13px 16px;
    background: rgba(18, 13, 16, 0.94);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-pill);
    color: var(--rg-parchment);
    font-family: var(--rg-font-sans);
    font-size: 16px; /* Prevents auto-zoom on iOS */
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all var(--rg-trans-smooth);
    min-height: 48px;
}

.rg-search-input:focus {
    border-color: var(--rg-primary-bright);
    box-shadow: 0 0 25px var(--rg-primary-glow), inset 0 2px 6px rgba(0, 0, 0, 0.4);
    background: rgba(26, 17, 22, 0.98);
}

.rg-search-input::placeholder {
    color: var(--rg-parchment-dim);
    font-size: 0.88rem;
}

/* Sticky Category Navigation Rail (Mobile-First Touch Rail) */
.rg-cat-nav-sticky {
    position: sticky;
    top: var(--rg-header-h);
    z-index: 900;
    background: rgba(17, 13, 16, 0.95);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--rg-primary-border);
    padding: 8px 0;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

@media (min-width: 640px) {
    .rg-cat-nav-sticky {
        padding: 12px 0;
        margin-bottom: 30px;
    }
}

.rg-cat-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.rg-cat-rail::-webkit-scrollbar {
    display: none;
}

.rg-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 40px;
    background: rgba(30, 20, 26, 0.8);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-pill);
    color: var(--rg-parchment-soft);
    font-family: var(--rg-font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-smooth);
}

@media (min-width: 640px) {
    .rg-cat-btn {
        gap: 8px;
        padding: 10px 20px;
        font-size: 0.88rem;
    }
}

.rg-cat-btn:hover {
    border-color: var(--rg-primary-light);
    color: #FFFFFF;
    background: rgba(119, 11, 36, 0.22);
}

.rg-cat-btn.is-active {
    background: linear-gradient(135deg, #9c1333 0%, #770b24 50%, #520719 100%);
    border-color: var(--rg-gold);
    color: #FAF7F2;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(119, 11, 36, 0.6), 0 0 10px rgba(212, 175, 55, 0.35);
}

.rg-cat-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--rg-radius-pill);
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.7rem;
    font-weight: 700;
}

.rg-cat-btn.is-active .rg-cat-btn__count {
    background: rgba(255, 255, 255, 0.18);
    color: #FAF7F2;
}

/* Featured / Signature Rail Strip (Mobile Swiper Strip) */
.rg-featured-strip {
    margin-bottom: 34px;
    padding: 18px 14px;
    background: linear-gradient(135deg, rgba(53, 3, 14, 0.82) 0%, rgba(22, 16, 20, 0.94) 100%);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-lg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 25px var(--rg-primary-glow-soft);
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .rg-featured-strip {
        margin-bottom: 48px;
        padding: 24px 20px;
    }
}

.rg-featured-strip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(119, 11, 36, 0.35);
}

.rg-featured-strip__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--rg-font-display);
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
    font-weight: 800;
    color: var(--rg-parchment);
    margin: 0;
}

.rg-featured-strip__rail {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rg-featured-strip__rail::-webkit-scrollbar {
    display: none;
}

.rg-featured-strip__rail .rg-card {
    min-width: 250px;
    max-width: 270px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Category Chapters & Catalog */
.rg-catalog {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

@media (min-width: 640px) {
    .rg-catalog {
        gap: 48px;
    }
}

.rg-chapter {
    scroll-margin-top: calc(var(--rg-header-h) + 65px);
}

.rg-chapter__head {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rg-primary-border);
    position: relative;
}

.rg-chapter__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rg-chapter__title {
    font-family: var(--rg-font-display);
    font-size: clamp(1.25rem, 3.8vw, 1.85rem);
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--rg-parchment);
    margin: 0;
}

.rg-chapter__desc {
    font-size: 0.84rem;
    color: var(--rg-parchment-muted);
    margin: 4px 0 0;
}

/* Product Cards Grid (Responsive Multi-Breakpoint) */
.rg-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 580px) {
    .rg-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (min-width: 960px) {
    .rg-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }
}

/* The Core Product Card Component */
.rg-card {
    background: var(--rg-bg-card);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--rg-shadow-md);
    transition: all var(--rg-trans-smooth);
    position: relative;
    touch-action: manipulation;
}

@media (min-width: 640px) {
    .rg-card {
        border-radius: var(--rg-radius-lg);
    }
}

.rg-card:hover,
.rg-card:active {
    border-color: var(--rg-primary-bright);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 25px var(--rg-primary-glow);
    transform: translateY(-3px);
    background: var(--rg-bg-card-hover);
}

.rg-card--sold {
    opacity: 0.65;
    filter: grayscale(40%);
}

.rg-card__media {
    position: relative;
    width: 100%;
    height: 165px;
    overflow: hidden;
    background: #141013;
    cursor: pointer;
}

@media (min-width: 640px) {
    .rg-card__media {
        height: 195px;
    }
}

.rg-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.92);
    transition: transform 0.5s ease;
}

.rg-card:hover .rg-card__img {
    transform: scale(1.06);
    filter: brightness(1.02);
}

/* Placeholder when no image exists */
.rg-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #2a111a 0%, #171115 100%);
    color: var(--rg-parchment-dim);
    padding: 16px;
    text-align: center;
}

.rg-card__placeholder-crest {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--rg-gold-border);
    opacity: 0.7;
    filter: drop-shadow(0 0 10px var(--rg-primary-glow));
}

.rg-card__media .rg-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

/* Card Body */
.rg-card__body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

@media (min-width: 640px) {
    .rg-card__body {
        padding: 18px;
        gap: 10px;
    }
}

.rg-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.rg-card__title {
    font-family: var(--rg-font-display);
    font-size: clamp(1.02rem, 2.5vw, 1.18rem);
    font-weight: 700;
    color: #FAF5EB;
    margin: 0;
    cursor: pointer;
    line-height: 1.35;
    transition: color var(--rg-trans-fast);
}

.rg-card:hover .rg-card__title {
    color: var(--rg-gold-warm);
}

.rg-card__desc {
    font-size: 0.82rem;
    color: var(--rg-parchment-muted);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Variants Selection Chips */
.rg-variants-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.rg-variant-chip {
    padding: 4px 9px;
    border-radius: var(--rg-radius-pill);
    background: rgba(36, 24, 30, 0.75);
    border: 1px solid var(--rg-primary-border);
    color: var(--rg-parchment-soft);
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

.rg-variant-chip:hover {
    border-color: var(--rg-gold);
    color: #FFFFFF;
}

.rg-variant-chip.is-active {
    background: rgba(119, 11, 36, 0.45);
    border-color: var(--rg-primary-bright);
    color: var(--rg-gold-light);
    font-weight: 700;
    box-shadow: 0 0 12px var(--rg-primary-glow);
}

/* Card Footer: Pricing and Ordering Actions */
.rg-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(119, 11, 36, 0.22);
}

.rg-card__pricing {
    display: flex;
    flex-direction: column;
}

.rg-card__price-orig {
    font-size: 0.74rem;
    color: var(--rg-parchment-dim);
    text-decoration: line-through;
    line-height: 1.1;
}

.rg-card__price-final {
    font-family: var(--rg-font-sans);
    font-size: clamp(0.98rem, 2.5vw, 1.12rem);
    font-weight: 800;
    color: var(--rg-gold);
    line-height: 1.2;
    text-shadow: 0 0 10px var(--rg-gold-glow);
}

/* Quantity Control (Touch-Optimized for Mobile) */
.rg-qty {
    display: inline-flex;
    align-items: center;
    background: rgba(28, 18, 24, 0.95);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-pill);
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.rg-qty__btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--rg-gold);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

.rg-qty__btn:hover,
.rg-qty__btn:active {
    background: var(--rg-primary);
    color: #FAF7F2;
    box-shadow: 0 0 12px var(--rg-primary-glow);
}

.rg-qty__val {
    min-width: 24px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--rg-parchment);
}

.rg-card__blocked {
    font-size: 0.78rem;
    color: var(--rg-parchment-dim);
    padding: 5px 10px;
    background: rgba(45, 27, 35, 0.7);
    border-radius: var(--rg-radius-pill);
}

/* Empty Search Alert */
.rg-empty-search {
    text-align: center;
    padding: 48px 18px;
    background: var(--rg-bg-card);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-lg);
    margin: 24px 0;
}

.rg-empty-search.is-hidden {
    display: none;
}

.rg-empty-search__crest {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--rg-gold-border);
    opacity: 0.6;
    margin-bottom: 14px;
    box-shadow: 0 0 16px var(--rg-primary-glow-soft);
}

.rg-empty-search__title {
    font-family: var(--rg-font-display);
    font-size: 1.28rem;
    color: var(--rg-parchment);
    margin: 0 0 6px;
}

.rg-empty-search__desc {
    font-size: 0.86rem;
    color: var(--rg-parchment-muted);
    margin: 0;
}

/* Product Details Modal Dialog (Mobile Bottom-Sheet on Phones!) */
.rg-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end; /* Mobile Bottom Sheet */
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 640px) {
    .rg-modal {
        align-items: center;
        padding: 20px;
    }
}

.rg-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.rg-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 8, 11, 0.88);
    backdrop-filter: blur(8px);
}

.rg-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--rg-bg-card);
    border: 1px solid var(--rg-primary-bright);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85), 0 0 40px var(--rg-primary-glow);
    display: flex;
    flex-direction: column;
    animation: rgSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rgSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (min-width: 640px) {
    .rg-modal__dialog {
        max-width: 480px;
        max-height: 90vh;
        border-radius: var(--rg-radius-lg);
        border-bottom: 1px solid var(--rg-primary-bright);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px var(--rg-primary-glow);
        animation: none;
    }
}

.rg-modal__close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(22, 14, 18, 0.85);
    border: 1px solid var(--rg-primary-border);
    color: var(--rg-parchment);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

.rg-modal__close:hover {
    background: var(--rg-primary);
    color: #FAF7F2;
    border-color: var(--rg-gold);
}

.rg-modal__media {
    width: 100%;
    height: 200px;
    position: relative;
    background: #141013;
}

@media (min-width: 640px) {
    .rg-modal__media {
        height: 240px;
    }
}

.rg-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rg-modal__body {
    padding: 18px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    .rg-modal__body {
        padding: 24px;
    }
}

.rg-modal__category {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rg-gold);
    letter-spacing: 1px;
}

.rg-modal__title {
    font-family: var(--rg-font-display);
    font-size: clamp(1.25rem, 3vw, 1.45rem);
    font-weight: 800;
    color: var(--rg-parchment);
    margin: 0;
}

.rg-modal__desc {
    font-size: 0.9rem;
    color: var(--rg-parchment-soft);
    line-height: 1.7;
    margin: 0;
}

.rg-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(119, 11, 36, 0.25);
    margin-top: 6px;
}

.rg-modal__price {
    font-family: var(--rg-font-sans);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--rg-gold);
}
