/* ======================= */
/* 1. GLOBAL VARIABLES     */
/* ======================= */
:root {
    --primary-color: #000000;
    --accent-color: #b98e00;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    box-sizing: border-box;
}

/* ======================= */
/* 2. RESTAURANT HEADER    */
/* ======================= */
.rma-restaurant-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0; 
    padding: 16px 0;
    background: var(--light-bg);
    color: white;
    position: relative;
    z-index: 50;
    text-align: center;
    width: 100%;
    margin: 0;
}

.rma-restaurant-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    position: relative;
}

/* ======================= */
/* 3. CATEGORY NAVIGATION  */
/* ======================= */
/* Main navigation container */
.rma-category-nav {
    display: flex;
    overflow-x: auto;
    padding: 0.7rem 0.5rem;
    background: var(--light-bg);
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    align-items: center;
    transition: var(--transition);
    mask-image: linear-gradient(
        to right,
        transparent,
        black 20px,
        black 90%,
        transparent
    );
    max-width: 100%;
}

/* Sticky navigation state */
.rma-category-nav.sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 249, 250, 0.95);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Navigation link styling */
.rma-category-link {
    padding: 0.3rem 0.5rem;
    background: transparent !important;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.4rem;
    transition: none !important;
    border: none !important;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: max-content;
    position: relative;
}

.rma-category-link.active {
    color: var(--accent-color);
}

/* Active state indicator */
.rma-category-link.active::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: -7px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: #b98e00 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Sticky navigation animations */
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Sticky placeholder element */
.rma-sticky-placeholder {
    display: none;
    height: 50px;
    width: 100%;
}

.rma-category-nav.sticky + .rma-sticky-placeholder {
    display: block;
}

/* ======================= */
/* 4. MENU ITEMS GRID      */
/* ======================= */
/* Main grid container */
.rma-menu-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Category section styling */
.rma-category-section {
    scroll-margin-top: 100px;
}

.rma-category-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

/* Items grid layout */
.rma-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 100%;
}

/* Individual menu item card */
.rma-grid-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
    position: relative;
}

/* Item thumbnail styling */
.rma-item-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

/* Item content area */
.rma-item-content {
    padding: 1rem;
}

.rma-item-name {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0;
    color: var(--primary-color);
    min-height: 3.2em;
}

.rma-item-price {
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

/* ======================= */
/* 5. ITEM MODAL           */
/* ======================= */
.rma-item-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.rma-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalEnter 0.3s ease;
}

/* Modal animations */
@keyframes modalEnter {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal components */
.rma-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    cursor: pointer;
    color: var(--light-bg);
    background: none;
    border: none;
    padding: 0;
    z-index: 1;
}

.rma-modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

/* Price list styling */
.rma-price-list {
    list-style: none;
    padding:0;
    margin: 0;
    display: grid;
}

.rma-price-list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f5f5f5;
}

/* Special offer badges */
.rma-offer-badge {
    background: #000000;
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin: 0.1rem;
}

.rma-modal-details {
    padding: 10px;
}

/* ======================= */
/* 6. SEARCH COMPONENTS    */
/* ======================= */
/* Search toggle button */
.rma-search-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 500;
    cursor: pointer;
    background: var(--primary-color);
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: var(--transition);
}

/* Favorites Counter in Header */
.rma-favorites-toggle {
    position: absolute;
    top: 80px; /* Adjusted to place below the search toggle */
    right: 20px;
    z-index: 500;
    cursor: pointer;
    background: var(--primary-color);
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.rma-search-icon {
    fill: white;
    width: 24px;
    height: 24px;
    display: block;
}

.rma-favorites-icon {
    fill: white;
    width: 24px;
    height: 24px;
    display: block;
}

/* Search input container */
.rma-search-container {
    position: fixed;
    top: -100px;
    right: 20px;
    z-index: 1000;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.rma-search-container.active {
    top: 20px;
    opacity: 1;
    pointer-events: all;
}

/* Search input field */
.rma-search-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    background: transparent;
}

.rma-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

/* Search close button */
.rma-search-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    opacity: 0.7;
}

.rma-search-close:hover {
    opacity: 1;
}

/* Mobile search adjustments */
@media (max-width: 480px) {
    .rma-search-container {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
}

/* ======================= */
/* 7. FAVORITES SYSTEM     */
/* ======================= */
.rma-favorite-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.rma-favorite-icon:hover, 
.rma-favorite-icon.active {
    transform: scale(1.1);
}

.rma-favorite-icon svg {
    width: 28px;
    height: 28px;
}

.rma-favorite-icon .heart-fill {
    fill: transparent;
    transition: fill 0.3s ease;
}

.rma-favorite-icon .heart-stroke {
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.rma-favorite-icon.active .heart-fill {
    fill: #ff3b30 !important;
}

.rma-favorites-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Favorites List */
.rma-favorites-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    z-index: 1001;
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.rma-favorites-container.active {
    right: 0;
}

.rma-favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--primary-color);
    color: white;
}

.rma-favorites-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.rma-favorites-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.rma-favorites-items {
    padding: 20px;
}

.rma-favorites-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.rma-favorites-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.rma-favorites-item-content {
    flex: 1;
}

.rma-favorites-item-name {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 5px;
}

.rma-favorites-item-price {
    font-size: 14px;
    color: var(--text-color);
    margin: 0 0 8px;
}

.rma-favorites-item-remove {
    color: #ff3b30;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.rma-favorites-item-remove svg {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.rma-favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color);
}

.rma-favorites-empty svg {
    width: 60px;
    height: 60px;
    fill: #ccc;
    margin-bottom: 20px;
}

.rma-favorites-empty-text {
    font-size: 18px;
    margin: 0 0 10px;
}

.rma-favorites-empty-subtext {
    font-size: 14px;
    color: #666;
}

/* Overlay for favorites panel */
.rma-favorites-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.rma-favorites-overlay.active {
    display: block;
}

@media (max-width: 480px) {
    .rma-favorites-container {
        max-width: 100%;
    }
}

.rma-favorites-empty-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 1rem 0;
}

.rma-favorites-empty-subtext {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.rma_favorites_head_title {
    font-size: 1.2rem;
    color: white;
    margin: 1rem 0;
}

/* ======================= */
/* 8. UTILITY CLASSES      */
/* ======================= */
.vc_column_inner {
    display: none !important;
}

/* ======================= */
/* 9. LEGAL MODALS         */
/* ======================= */
.rma-legal-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    max-width: 100%;
}

.rma-legal-modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    padding: 0;
    position: relative;
    animation: modalEnter 0.3s ease;
    overflow-y: auto;
}

.rma-legal-content {
    font-size: 14px;
    overflow-y: auto;
    padding: 0 20px 20px;
    flex-grow: 1;
    scroll-behavior: smooth;
}

.rma-legal-modal-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rma-legal-content::-webkit-scrollbar {
    width: 8px;
}

.rma-legal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.rma-legal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.rma-legal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.rma-legal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: var(--light-bg);
}

.rma-legal-footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid #eee;
}

.rma-legal-link {
    display: inline-block;
    margin: 0 15px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.rma-legal-link:hover {
    text-decoration: underline;
}

/* ======================= */
/* 10. BACK TO TOP BUTTON  */
/* ======================= */
/* Back to Top Button */
.rma-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rma-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.rma-back-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}