* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    background-color: #25343F; /* Mint green */
    color: #FF7F11;
    overflow: hidden; /* No scrolling, full viewport app */
    position: fixed; /* Stops iOS rubber-banding from revealing things out of bounds */
    display: flex;
    flex-direction: row; /* Explicit default for inherit */
    direction: ltr; 
}

.main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex: 1;
    flex-direction: inherit;
    position: relative;
}

/* Left Section */
.left-section {
    width: calc(100vw - 50vmin); /* The exact remaining space from the visible half of the wheel! */
    height: 100%;
    padding: 3% 5% 5% 8%; /* Reduced top padding to move text higher */
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Move contents to the top */
}

.main-title {
    font-weight: 900;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
    text-align: left; /* Align to the top left */
    direction: ltr; /* English text */
}

/* Title Font Scaling Matrix */
.main-title .small { 
    display: block;
    font-size: clamp(1.5rem, 3.5vw, 3rem); 
    font-weight: 700; 
    letter-spacing: 2px; 
    margin-bottom: 0.5vh; /* Better spacing */
}
.main-title .large { 
    display: block;
    font-size: clamp(2.5rem, 7.5vw, 8.5rem); 
    line-height: 0.85; 
    margin-bottom: 0.5vh;
}
.main-title .medium { 
    display: block;
    font-size: clamp(0.8rem, 2.5vw, 2rem); 
    letter-spacing: 3px; 
    color: #BFC9D1;
    margin-top: -0.5vh;
}

/* Dynamic Details Container */
.dynamic-content {
    margin-top: 2vh;
    background: rgba(255, 255, 255, 0.2);
    padding: clamp(15px, 3vh, 30px);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    max-width: 550px;
    direction: rtl; 
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.menu-scrollable-body {
    overflow-y: auto;
    flex: 1;
    padding-left: 10px;
}

.menu-scrollable-body::-webkit-scrollbar { width: 8px; }
.menu-scrollable-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 10px; }

/* For generic empty content fallback */
.dynamic-content::-webkit-scrollbar { width: 8px; }
.dynamic-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 10px; }

@keyframes slide-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.dynamic-content.active {
    animation: slide-up 0.5s ease forwards;
}

.dynamic-content h2 {
    margin: 0 0 10px 0;
    font-size: clamp(1.2rem, 2.5vw, 2.2rem);
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.dynamic-content p {
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    line-height: 1.6;
    margin: 0;
    color: #f7f7f7;
}

/* ---------------- RIGHT SECTION & WHEEL ---------------- */
.right-section {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(50%); /* Always hides exactly the right half */
    width: 100vmin; /* Always prominent, scales perfectly with the smallest dimension */
    height: 100vmin;
    min-width: 300px; 
    min-height: 300px;
    z-index: 1;
}

.wheel-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 80px rgba(0,0,0,0.15);
    transition: transform 0.1s linear; 
    cursor: grab;
}

.wheel.grabbing {
    cursor: grabbing;
}

/* Items inside the wheel */
.wheel-item {
    position: absolute;
    width: 50%;
    height: 25%; /* slightly increased hit area/height */
    top: 50%;
    left: 50%;
    transform-origin: 0 50%; 
    margin-top: -12.5%; 
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    padding-right: 5%; 
}

/* Image wrapper */
.item-content {
    position: relative;
    width: 32%; /* Increased size */
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(180deg); /* Fix upside-down issue on the active left side */
}

.item-content img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keep full transparent png visible */
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25)); /* Shadow conforms to image shape instead of circle block */
}

.center-circle {
    position: absolute;
    width: 55%;
    height: 55%;
    background: #25343F; 
    border-radius: 50%;
    z-index: 10;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.1), 0 0 20px rgba(0,0,0,0.05);
    pointer-events: none; 
}

@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.3) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.center-name {
    position: absolute;
    left: 8%; /* Shifted to the right slightly from the far left edge */
    top: 0;
    width: 45%; /* Adjusted width */
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    writing-mode: vertical-rl; /* Makes the Arabic text vertical! */
    font-size: clamp(2.5rem, 6vmin, 6rem); /* Larger size */
    font-weight: 900;
    color: #FF7F11;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
    margin: 0;
    opacity: 0; 
    padding: 0 10%; 
}

.center-name.animate {
    animation: pop-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Pointer logic */
.pointer {
    position: absolute;
    left: -15px; 
    top: 50%;
    transform: translateY(-50%) rotate(-45deg); /* Flipped to upright vertical heart */ 
    width: clamp(20px, 4vmin, 35px);
    height: clamp(20px, 4vmin, 35px);
    background-color: #ff5a5f;
    z-index: 20;
    filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.3));
}

.pointer::before,
.pointer::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff5a5f;
    border-radius: 50%;
}

.pointer::before {
    top: -50%;
    left: 0;
}

.pointer::after {
    top: 0;
    left: 50%;
}

/* Floating Emoji Animation from behind the heart */
.floating-emoji {
    position: absolute;
    left: -15px;
    top: 50%;
    font-size: 3rem;
    z-index: 15; /* Behind pointer (which is z-index 20) */
    transform: translate(-50%, -50%);
    animation: float-up-fade 1.2s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
    pointer-events: none;
}

@keyframes float-up-fade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -400%) scale(1);
    }
}

/* ---------------- MENU LAYOUT STYLES ---------------- */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(255,255,255,0.3);
    padding-bottom: 15px;
    flex-shrink: 0;
    padding-left: 26px; /* Align with .menu-prices */
    padding-right: 16px; /* Align with card .menu-info */
}
.menu-header h2 {
    font-size: 2rem;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.menu-header .badge {
    font-size: 0.9rem;
    background: #FCBF49;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 800;
}
.menu-price-labels {
    display: flex;
    gap: 10px;
}
.menu-price-labels span {
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    min-width: 65px;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-card {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, background 0.2s;
    flex-wrap: nowrap; /* Keep it on one line */
}
.menu-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-5px); 
}

.menu-info { 
    flex: 1; 
    min-width: 0; /* Prevents text overflow from pushing flex layout */
}
.menu-info h3 { margin: 0 0 8px 0; font-size: 1.25rem; color: #fff; font-weight: 800; word-wrap: break-word;}
.menu-info p { margin: 0; font-size: 0.9rem; color: #f0f0f0; line-height: 1.5; opacity: 0.95; }

.menu-prices {
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Never shrink the prices size */
}
.price-box {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 8px 5px;
    text-align: center;
    min-width: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.price-val {
    font-size: 1.2rem;
    font-weight: 900;
    color: #FCBF49; 
}

.misc-title {
    margin: 30px 0 15px 0;
    font-size: 1.6rem;
    color: #fff;
    border-bottom: 2px dashed rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.misc-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.misc-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 12px;
    border-right: 4px solid #FCBF49;
}
.misc-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.misc-price {
    color: #FCBF49;
    font-weight: 800;
    background: rgba(0,0,0,0.15);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
}
.misc-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #e0e0e0;
    line-height: 1.5;
}

.menu-footer-note {
    margin-top: 15px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 800;
    color:#FF7F11;
    line-height: 1.6;
    max-width: 550px;
    direction: rtl;
}

/* Fallback styles */
.cat-title { margin: 0 0 15px 0; font-size: 2.2rem; color: #fff; }
.cat-desc { margin: 0; font-size: 1.2rem; color: #f7f7f7; line-height: 1.6; }

/* Payment Info Footer */
.payment-info {
    margin-top: auto; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    direction: rtl;
    width: 100%;
    max-width: 550px;
    position: relative;
    z-index: 20;
    padding-bottom: 20px;
    padding-top: 10px;
}

.payment-info span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.cliq-code {
    color: #FCBF49 !important;
    cursor: pointer;
    font-weight: 900 !important;
    font-family: monospace;
    font-size: 1.1rem !important;
    transition: all 0.2s;
    user-select: none;
    display: inline-block;
    letter-spacing: 1px;
    text-decoration: underline;
}

.cliq-code:hover {
    transform: scale(1.05);
    color: #ffea8a !important;
}

.cliq-code:active {
    transform: scale(0.95);
}

.cliq-name {
    color: #e0f9f4 !important;
    font-size: 0.85rem !important;
    opacity: 0.9;
    margin-right: 5px;
}

.copy-feedback {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem !important;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
}

.copy-feedback::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.copy-feedback.show {
    opacity: 1;
    top: -35px;
}

/* ==========================================================================
   Responsive Design for Mobile & Portrait Tablets
   ========================================================================== */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
    body {
        flex-direction: column;
    }

    /* Left Section (Top Half) */
    .left-section {
        width: 100vw;
        height: calc(100dvh - 260px) !important; /* Stop 260px before screen bottom to absolutely avoid overlapping the wheel/heart */
        padding: 5% 5% 10px 5%; 
        align-items: center; /* Center the content horizontally */
        z-index: 10;
        position: relative;
        display: flex;
        flex-direction: column;
        pointer-events: none; /* Allows touches to pass through the empty padding to the wheel */
    }

    .main-title {
        text-align: center;
        flex-shrink: 0;
        pointer-events: auto; /* Re-enable touches for title */
    }

    .dynamic-content {
        max-width: 100%;
        width: 95%;
        margin: 10px auto 0 auto;
        /* Let menu scroll inside naturally flexed */
        flex: 1;
        min-height: 0; /* Extremely important for flex child to actually scroll instead of overflowing parent */
        overflow-y: auto; 
        pointer-events: auto; /* Re-enable touches for menu content */
    }
    
    /* Keep menu header horizontally aligned so 'Sandwich' & 'Meal' stay aligned with price boxes */
    .menu-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 5px;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .menu-header h2 {
        font-size: 1.2rem;
    }

    .menu-price-labels span {
        min-width: 50px;
        padding: 3px 5px;
        font-size: 0.8rem;
    }

    .menu-card {
        padding: 10px;
        gap: 10px;
    }

    .price-box {
        min-width: 50px;
        padding: 5px 2px;
    }
    
    .price-val {
        font-size: 1rem;
    }

    .menu-info h3 {
        font-size: 1rem;
    }
    .menu-info p {
        font-size: 0.8rem;
    }

    /* Hide Footer Note completely on mobile as requested */
    #menu-footer-container {
        display: none !important;
    }

    .payment-info {
        position: fixed;
        bottom: max(15px, env(safe-area-inset-bottom, 15px));
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        justify-content: center;
        z-index: 50;
        padding-bottom: 0;
        pointer-events: auto; /* Re-enable touches for payment info */
    }

    .payment-info span {
        font-size: 0.8rem;
    }

    /* Right Section (Wheel -> Bottom Half) */
    .right-section {
        position: fixed; /* Fixed prevents body scroll from pulling the wheel up and revealing the bottom half */
        top: auto;
        bottom: 0; /* Brings the wheel back to perfect semi-circle to fix image alignment */
        right: 50%;
        transform: translateY(50%) translateX(50%); /* Wheel is centered vertically */
        width: 105vmin; /* Reverted to proper size for perfect alignments */
        height: 105vmin;
        min-width: 380px;
        min-height: 380px;
        z-index: 5;
    }

    /* We let .center-circle fallback to its 55% default which fixes the white band image alignment! */

    /* Adjust Pointer Angle and Position */
    .pointer {
        left: 50%;
        top: -15px; /* Protrudes outside the very top edge */
        /* Center pointing exactly down into circle center */
        transform: translateX(-50%) translateY(0) rotate(-45deg); 
    }

    /* Floating emoji spawns from top point */
    .floating-emoji {
        left: 50%;
        top: -15px; 
        transform: translate(-50%, -50%);
    }

    /* Image rotation fix for the 270deg top angle */
    .item-content {
        transform: rotate(90deg); 
    }

    /* Adjust the center text so it's readable horizontally near the top edge */
    .center-name {
        left: 0;
        top: 8%; /* Top part of the black circle, fitting normally now */
        width: 100%;
        height: auto;
        writing-mode: horizontal-tb; /* Horizontal writing */
        padding: 0;
        text-align: center;
        font-size: clamp(1.2rem, 5vmin, 2.5rem); 
    }
}