/* Modern High-End Styling - The Fork Inspired */
:root {
    --rtr-white: #ffffff;
    --rtr-black: #1a1a1b;
    --rtr-gray-light: #f4f6f8;
    --rtr-gray-medium: #e8ecef;
    --rtr-gray-dark: #697684;
    --rtr-radius-lg: 16px;
    --rtr-radius-md: 12px;
    --rtr-shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
    --rtr-shadow-pill: 0 4px 12px rgba(0,0,0,0.05);
    
    /* Dynamic Accent from Backend (Fallback) */
    --rtr-accent: #006567; 
}

#advanced-table-selector-wrapper {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--rtr-black);
    margin: 30px auto;
    transition: max-width 0.4s ease;
}

/* Layout Differentiations */
#advanced-table-selector-wrapper.rtr-layout-horizontal {
    max-width: 1000px;
}

#advanced-table-selector-wrapper.rtr-layout-vertical {
    max-width: 600px;
}

#advanced-table-selector-wrapper.rtr-layout-horizontal .rtr-nav-item {
    flex-direction: column;
    gap: 0px;
    padding: 8px 10px;
}

#advanced-table-selector-wrapper.rtr-layout-vertical .rtr-nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 10px 20px;
}

/* Accordion Mode (Vertical) */
.rtr-layout-vertical .rtr-pill-nav {
    display: none;
}

.rtr-layout-vertical .rtr-stage {
    display: block !important;
    border-bottom: 1px solid var(--rtr-gray-medium);
    margin-bottom: 0;
}

.rtr-layout-vertical .rtr-stage:last-child {
    border-bottom: none;
}

.rtr-layout-vertical .rtr-modern-header {
    background: var(--rtr-gray-light);
    margin-bottom: 0;
    padding: 15px 25px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: var(--rtr-black);
    transition: all 0.3s ease;
}

.rtr-layout-vertical .rtr-stage.active .rtr-modern-header {
    background: var(--rtr-white);
    color: var(--rtr-accent);
}

.rtr-layout-vertical .rtr-stage-content {
    display: none;
    padding: 30px 25px;
}

.rtr-layout-vertical .rtr-stage.active .rtr-stage-content {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Navigation (Pill Nav) */
.rtr-pill-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background: var(--rtr-white);
    padding: 8px;
    border-radius: 16px;
    box-shadow: var(--rtr-shadow-pill);
    margin-bottom: 25px;
    border: 1px solid var(--rtr-gray-medium);
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}

/* Sticky navigation in horizontal mode */
.rtr-layout-horizontal .rtr-pill-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.96);
}

.rtr-pill-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.rtr-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 5px;
    min-width: 60px;
}

.rtr-nav-item.active {
    background: var(--rtr-accent);
    color: var(--rtr-white);
}

.rtr-nav-item:not(.active):hover {
    background: var(--rtr-gray-light);
}

.rtr-nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1.2;
}

.rtr-nav-value {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.85;
    line-height: 1.2;
}

/* Layout Containers */
.rtr-modern-container {
    background: var(--rtr-white);
    border-radius: var(--rtr-radius-lg);
    box-shadow: var(--rtr-shadow-soft);
    border: 1px solid var(--rtr-gray-medium);
    overflow: visible; /* Allow sticky nav to work */
    margin-bottom: 50px;
}

/* Interaction area content */
.rtr-interaction-area {
    width: 100% !important;
    padding: 0; /* Let stages handle padding in vertical mode */
}

/* Horizontal Mode (Original Stages) */
.rtr-layout-horizontal .rtr-stage {
    display: none;
    animation: fadeIn 0.4s ease;
    scroll-margin-top: 80px; /* Offset for sticky nav */
}

.rtr-layout-horizontal .rtr-stage.active {
    display: block;
}

.rtr-layout-horizontal .rtr-interaction-area {
    padding: 40px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Common Stages */
.rtr-stage.rtr-locked {
    pointer-events: none;
    opacity: 0.5;
}

.rtr-modern-header {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: var(--rtr-accent);
}

/* Modern Calendar */
.rtr-calendar {
    max-width: 450px;
    margin: 0 auto;
}

.rtr-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.rtr-cal-month-year {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: capitalize;
}

.rtr-cal-prev, .rtr-cal-next {
    background: var(--rtr-gray-light) !important;
    border: none !important;
    color: var(--rtr-black) !important;
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rtr-cal-prev:hover, .rtr-cal-next:hover {
    background: var(--rtr-accent) !important;
    color: #fff !important;
}

.rtr-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rtr-gray-dark);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.rtr-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.rtr-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    font-size: 1.1rem;
}

.rtr-day.available:hover {
    background: var(--rtr-gray-light);
    color: var(--rtr-accent);
}

.rtr-day.active {
    background: var(--rtr-accent) !important;
    color: var(--rtr-white) !important;
    border-color: var(--rtr-accent);
}

.rtr-day.disabled {
    color: #cbd5e0;
    cursor: default;
    text-decoration: line-through;
}

.rtr-day.today {
    border-color: var(--rtr-accent);
}

/* Grouped Times */
.rtr-time-group {
    margin-bottom: 30px;
}

.rtr-group-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rtr-gray-dark);
    margin-bottom: 15px;
    display: block;
    border-left: 3px solid var(--rtr-accent);
    padding-left: 10px;
}

.rtr-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.rtr-slot-btn {
    background: var(--rtr-white);
    border: 1px solid var(--rtr-gray-medium);
    padding: 12px;
    border-radius: var(--rtr-radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rtr-slot-time {
    font-size: 1.1rem;
}

.rtr-availability-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rtr-gray-dark);
}

.rtr-availability-badge.full {
    color: #e53e3e;
    font-weight: 700;
}

.rtr-slot-btn.full {
    background: var(--rtr-gray-light);
    border-color: var(--rtr-gray-medium);
    cursor: not-allowed;
    opacity: 0.8;
}

.rtr-slot-btn.full:hover {
    border-color: var(--rtr-gray-medium);
    color: inherit;
    background: var(--rtr-gray-light);
}

.rtr-slot-btn:hover {
    border-color: var(--rtr-accent);
    color: var(--rtr-accent);
    background: var(--rtr-gray-light);
}

.rtr-slot-btn.active {
    background: var(--rtr-accent);
    color: var(--rtr-white);
    border-color: var(--rtr-accent);
}

/* Party Size */
.rtr-party-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.rtr-party-box {
    background: var(--rtr-white);
    border: 1px solid var(--rtr-gray-medium);
    padding: 18px;
    border-radius: var(--rtr-radius-md);
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.rtr-party-box:hover {
    border-color: var(--rtr-accent);
    color: var(--rtr-accent);
    background: var(--rtr-gray-light);
}

.rtr-party-box.active {
    background: var(--rtr-accent);
    color: var(--rtr-white);
    border-color: var(--rtr-accent);
}

/* Map Interactions */
.ass-front-zone {
    position: absolute;
    padding: 5px;
    background-color: var(--rtr-accent);
    opacity: var(--ass-table-opacity, 0.6);
    color: white;
    border: 2px solid #fff;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 0.8rem;
}

.ass-front-zone.occupied {
    background-color: var(--rtr-gray-dark) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.ass-front-zone.selected {
    background-color: #28a745 !important; /* Solid Green */
    opacity: 1 !important;
    border-color: #fff !important;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
    transform: scale(1.05);
    z-index: 10;
}

/* Map Legend Styling */
.ass-map-legend {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 14px 20px;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.legend-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}

.legend-box.available { background-color: var(--rtr-accent); }
.legend-box.occupied { background-color: var(--rtr-gray-dark); }
.legend-box.partially-occupied { 
    background: repeating-linear-gradient(45deg, var(--rtr-accent), var(--rtr-accent) 4px, var(--rtr-gray-dark) 4px, var(--rtr-gray-dark) 8px);
}

.legend-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* Responsiveness */
@media (max-width: 768px) {
    .rtr-main-wrapper {
        flex-direction: column !important;
    }
    .rtr-info-sidebar {
        width: 100% !important;
        padding: 30px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--rtr-gray-medium);
    }
    .rtr-interaction-area {
        padding: 30px 20px !important;
    }
    .rtr-party-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Hide native quantity box on reservation product page */
body.page-product #add-to-cart-or-refresh .product-add-to-cart,
body.page-product #quantity_wanted,
body.page-product .product-quantity .qty,
body.page-product .bootstrap-touchspin {
    display: none !important;
}

/* STAGE 5: FOOD CATEGORIES & ACCORDIONS */
.rtr-food-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.rtr-category-item {
    border: 1px solid var(--rtr-gray-medium);
    border-radius: var(--rtr-radius-md);
    overflow: hidden;
    background: var(--rtr-white);
    transition: all 0.3s ease;
    scroll-margin-top: 120px;
}

.rtr-category-header {
    padding: 15px 25px;
    background: var(--rtr-cat-bg, var(--rtr-gray-light));
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--rtr-cat-txt, var(--rtr-black));
    transition: all 0.3s ease;
}

.rtr-category-item.active .rtr-category-header {
    background: var(--rtr-cat-bg-active, var(--rtr-white));
    color: var(--rtr-cat-txt-active, var(--rtr-accent));
    border-bottom: 1px solid var(--rtr-gray-medium);
}

.rtr-category-icon {
    transition: transform 0.3s ease;
    color: var(--rtr-cat-txt, var(--rtr-gray-dark));
}

.rtr-category-item.active .rtr-category-icon {
    transform: rotate(180deg);
    color: var(--rtr-cat-txt-active, var(--rtr-accent));
}

.rtr-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
    background: var(--rtr-white);
}

.rtr-category-item.active .rtr-category-content {
    max-height: 10000px; /* High enough to fit content */
    transition: max-height 0.5s cubic-bezier(1, 0, 1, 0);
}

.rtr-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--rtr-food-cols, 4), 1fr);
    gap: 20px;
    padding: 25px;
}

@media (max-width: 992px) {
    .rtr-products-grid {
        grid-template-columns: repeat(var(--rtr-food-cols-mobile, 2), 1fr);
    }
}

@media (max-width: 480px) {
    .rtr-products-grid {
        grid-template-columns: repeat(var(--rtr-food-cols-mobile, 1), 1fr);
    }
}

.rtr-food-item {
    background: var(--rtr-white);
    border: 1px solid var(--rtr-gray-medium);
    border-radius: var(--rtr-radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--rtr-shadow-pill);
    display: flex;
    flex-direction: column;
}

.rtr-food-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--rtr-shadow-soft);
    border-color: var(--rtr-accent);
}

.rtr-food-img {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--rtr-gray-light);
    position: relative;
}

/* Quick View overlay */
.rtr-quickview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.rtr-food-item:hover .rtr-quickview-overlay {
    background: rgba(0, 0, 0, 0.35);
    opacity: 1;
    pointer-events: auto;
}

.rtr-quickview-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--rtr-black);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    transform: scale(0.8);
}

.rtr-food-item:hover .rtr-quickview-btn {
    transform: scale(1);
}

.rtr-quickview-btn:hover {
    background: var(--rtr-accent);
    color: #fff;
    transform: scale(1.1);
}

.rtr-food-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rtr-food-item:hover .rtr-food-img img {
    transform: scale(1.1);
}

.rtr-food-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.rtr-food-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--rtr-black);
}

.rtr-food-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--rtr-accent);
    margin: 0;
}

.rtr-food-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--rtr-gray-light);
    border-radius: 30px;
    padding: 5px;
    margin-top: auto;
}

.btn-qty {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--rtr-white);
    color: var(--rtr-black);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-qty:hover {
    background: var(--rtr-accent);
    color: var(--rtr-white);
}

.qty-val {
    font-weight: 700;
    font-size: 1rem;
    color: var(--rtr-black);
}

.rtr-loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--rtr-gray-medium);
    border-top: 4px solid var(--rtr-accent);
    border-radius: 50%;
    margin: 50px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
/* ===== RTR QUICK VIEW MODAL ===== */
.rtr-qv-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.rtr-qv-modal.open { display: flex; }
.rtr-qv-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: rtrFadeIn 0.25s ease;
}
.rtr-qv-dialog {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 95%;
    max-width: 1000px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    animation: rtrSlideUp 0.3s ease;
    z-index: 100000;
    overflow: visible; /* Prevent clipping the close button */
}
.rtr-qv-body { 
    display: grid; 
    grid-template-columns: 1fr 1fr;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden; /* Remove bottom scrollbar */
    border-radius: 20px;
}
.rtr-qv-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #000; /* Solid background */
    border: 2px solid #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    line-height: 1;
    padding: 0;
    font-weight: bold;
}
.rtr-qv-close:hover { 
    background: var(--rtr-accent); 
    color: #fff; 
    transform: scale(1.1) rotate(90deg);
}
.rtr-qv-body { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .rtr-qv-body { grid-template-columns: 1fr; } }
.rtr-qv-gallery {
    background: var(--rtr-gray-light);
    border-radius: 20px 0 0 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@media (max-width: 600px) { .rtr-qv-gallery { border-radius: 20px 20px 0 0; } }
.rtr-qv-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 20px;
}
.rtr-qv-img-wrap img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
}
.rtr-qv-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: rgba(0,0,0,0.04);
}
.rtr-qv-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.rtr-qv-thumb.active, .rtr-qv-thumb:hover { border-color: var(--rtr-accent); }
.rtr-qv-info { padding: 35px 30px; display: flex; flex-direction: column; gap: 16px; }
.rtr-qv-info h2 { font-size: 1.5rem; font-weight: 800; color: var(--rtr-black); margin: 0; }
.rtr-qv-price { font-size: 1.6rem; font-weight: 800; color: var(--rtr-accent); margin: 0; }
.rtr-qv-desc { font-size: 0.95rem; line-height: 1.7; color: var(--rtr-gray-dark); flex: 1; }
.rtr-qv-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rtr-accent);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: all 0.2s;
    align-self: flex-start;
    margin-top: auto;
}
.rtr-qv-link-btn:hover { background: var(--rtr-black); transform: translateY(-2px); }
@keyframes rtrFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rtrSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}



