/**
 * ROUGE VINTAGE-INDUSTRIAL URBAN LOUNGE — SHOPPING CART & ORDER DRAWER (REDESIGNED)
 * Main Color: #770b24 (Royal Velvet Rouge) | Accent: Antique Gold (#D4AF37)
 * Mobile-First Responsive
 */

/* Floating Cart Action Button (FAB) */
.rg-cart-fab {
    position: fixed;
    bottom: calc(var(--rg-dock-h) + 12px);
    left: 16px;
    z-index: 950;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 46px;
    background: linear-gradient(135deg, #9c1333 0%, #770b24 50%, #520719 100%);
    border: 1px solid var(--rg-gold);
    border-radius: var(--rg-radius-pill);
    color: #FAF7F2;
    font-family: var(--rg-font-sans);
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 25px rgba(119, 11, 36, 0.6), 0 0 10px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-smooth);
}

@media (min-width: 640px) {
    .rg-cart-fab {
        bottom: calc(var(--rg-dock-h) + 16px);
        left: 20px;
        padding: 12px 22px;
        gap: 10px;
        font-size: 0.94rem;
    }
}

@media (min-width: 840px) {
    .rg-cart-fab {
        bottom: 28px;
        left: 28px;
    }
}

.rg-cart-fab:hover,
.rg-cart-fab:active {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(119, 11, 36, 0.8), 0 0 15px rgba(212, 175, 55, 0.6);
}

.rg-cart-fab__crest {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--rg-gold);
}

.rg-cart-fab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--rg-radius-pill);
    background: #110d10;
    color: var(--rg-gold);
    border: 1px solid var(--rg-gold-border);
    font-size: 0.78rem;
    font-weight: 800;
}

/* Slide-Out Order Drawer Panel */
.rg-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    transition: visibility 0.35s ease;
    visibility: hidden;
}

.rg-drawer.is-active {
    pointer-events: auto;
    visibility: visible;
}

.rg-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 8, 11, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.rg-drawer.is-active .rg-drawer__overlay {
    opacity: 1;
}

.rg-drawer__panel {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: var(--rg-bg-card);
    border-right: 1px solid var(--rg-primary-border);
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.85), 0 0 35px var(--rg-primary-glow-soft);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

@media (min-width: 540px) {
    .rg-drawer__panel {
        max-width: 460px;
    }
}

.rg-drawer.is-active .rg-drawer__panel {
    transform: translateX(0);
}

.rg-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(28, 18, 24, 0.96);
    border-bottom: 1px solid var(--rg-primary-border);
}

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

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

.rg-drawer__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(36, 24, 30, 0.8);
    border: 1px solid var(--rg-primary-border);
    color: var(--rg-parchment);
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

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

.rg-drawer__body {
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 640px) {
    .rg-drawer__body {
        padding: 20px 24px 30px;
        gap: 20px;
    }
}

/* Cart Items List */
.rg-cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rg-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(26, 17, 22, 0.85);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-md);
    transition: border-color var(--rg-trans-fast);
}

@media (min-width: 640px) {
    .rg-cart-item {
        gap: 14px;
        padding: 12px;
    }
}

.rg-cart-item:hover {
    border-color: var(--rg-primary-light);
}

.rg-cart-item__thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--rg-radius-sm);
    object-fit: cover;
    background: #141013;
    border: 1px solid rgba(212, 175, 55, 0.25);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .rg-cart-item__thumb {
        width: 56px;
        height: 56px;
    }
}

.rg-cart-item__info {
    flex: 1;
    min-width: 0;
}

.rg-cart-item__title {
    font-family: var(--rg-font-display);
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--rg-parchment);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rg-cart-item__variant {
    font-size: 0.72rem;
    color: var(--rg-gold);
}

.rg-cart-item__price {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--rg-gold);
    margin-top: 3px;
}

/* Empty Drawer State */
.rg-drawer__empty {
    text-align: center;
    padding: 36px 10px;
}

.rg-drawer__empty.is-hidden {
    display: none;
}

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

.rg-drawer__empty p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--rg-parchment);
    margin: 0 0 4px;
}

.rg-drawer__empty small {
    font-size: 0.82rem;
    color: var(--rg-parchment-dim);
}

/* Order Summary Box */
.rg-summary-box {
    background: rgba(35, 18, 25, 0.8);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 640px) {
    .rg-summary-box {
        padding: 16px;
    }
}

.rg-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--rg-parchment-soft);
}

.rg-summary-row--discount {
    color: #FF8F87;
}

.rg-summary-row--payable {
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid rgba(119, 11, 36, 0.35);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--rg-gold);
}

/* Order Form */
.rg-order-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rg-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rg-form-field label,
.rg-form-field__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--rg-parchment-soft);
}

/* Order Type Switcher */
.rg-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rg-mode input {
    display: none;
}

.rg-mode__face {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-height: 44px;
    background: rgba(28, 18, 24, 0.85);
    border: 1px solid var(--rg-primary-border);
    border-radius: var(--rg-radius-md);
    color: var(--rg-parchment-soft);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-smooth);
}

.rg-mode input:checked + .rg-mode__face {
    background: linear-gradient(135deg, rgba(156, 19, 51, 0.45) 0%, rgba(119, 11, 36, 0.6) 100%);
    border-color: var(--rg-gold);
    color: #FAF7F2;
    font-weight: 700;
    box-shadow: 0 0 14px var(--rg-primary-glow);
}

/* Table Selector Grid (Responsive 4/3 Columns) */
.rg-tables-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding: 4px 2px;
}

@media (max-width: 380px) {
    .rg-tables-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.rg-table-chip {
    padding: 8px 4px;
    min-height: 48px;
    border-radius: var(--rg-radius-md);
    background: rgba(28, 18, 24, 0.85);
    border: 1px solid var(--rg-primary-border);
    color: var(--rg-parchment);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

.rg-table-chip:hover {
    border-color: var(--rg-primary-light);
    background: rgba(119, 11, 36, 0.2);
}

.rg-table-chip.is-selected {
    background: linear-gradient(135deg, #9c1333 0%, #770b24 100%);
    border-color: var(--rg-gold);
    color: #FAF7F2;
    box-shadow: 0 0 14px var(--rg-primary-glow);
}

.rg-table-chip.is-reserved {
    border-color: rgba(212, 175, 55, 0.4);
    opacity: 0.8;
}

.rg-table-chip.is-busy {
    opacity: 0.35;
    cursor: not-allowed;
    background: #161214;
}

/* Captcha Row */
.rg-captcha-row {
    display: flex;
    gap: 10px;
}

.rg-captcha-btn {
    width: 48px;
    min-width: 48px;
    border-radius: var(--rg-radius-md);
    background: rgba(30, 20, 26, 0.9);
    border: 1px solid var(--rg-primary-border);
    color: var(--rg-gold);
    font-size: 1.3rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--rg-trans-fast);
}

.rg-captcha-btn:hover,
.rg-captcha-btn:active {
    border-color: var(--rg-gold);
    color: #FFFFFF;
    background: rgba(119, 11, 36, 0.3);
}

/* Order Feedback Alert */
.rg-order-alert {
    padding: 12px 14px;
    border-radius: var(--rg-radius-md);
    font-size: 0.86rem;
    line-height: 1.5;
}

.rg-order-alert.is-hidden {
    display: none;
}

.rg-order-alert--error {
    background: rgba(192, 66, 56, 0.2);
    border: 1px solid rgba(192, 66, 56, 0.6);
    color: #FFB0AA;
}

.rg-order-alert--success {
    background: rgba(62, 142, 88, 0.2);
    border: 1px solid rgba(62, 142, 88, 0.6);
    color: #B5E8C3;
}

/* Toast */
.rg-toast {
    position: fixed;
    bottom: calc(var(--rg-dock-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    padding: 12px 22px;
    background: #1c1418;
    border: 1px solid var(--rg-primary-bright);
    border-radius: var(--rg-radius-pill);
    color: var(--rg-parchment);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), 0 0 25px var(--rg-primary-glow);
    transition: all 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
}

.rg-toast.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 15px);
}
