/* CSS Custom Properties */
:root {
    /* Primary brand color - neutral green */
    --primary-color: oklch(0.65 0.08 145);
    --primary-color-light: oklch(0.75 0.06 145);
    --primary-color-dark: oklch(0.55 0.10 145);
    
    /* Neutral accent colors - grays with slight warmth */
    --accent-color: oklch(0.60 0.02 85);
    --accent-color-light: oklch(0.70 0.02 85);
    --accent-color-dark: oklch(0.50 0.02 85);
    
    /* Text colors - neutral grays */
    --text-color: oklch(0.25 0 0);
    --text-color-muted: oklch(0.45 0 0);
    --text-color-faded: oklch(0.25 0 0 / 0.5);
    --text-color-light: oklch(0.85 0 0);
    
    /* Background colors - warm neutral */
    --background-color: oklch(0.98 0.005 85);
    --background-color-faded: oklch(0.98 0.005 85 / 0.5);
    --background-color-dark: oklch(0.95 0.005 85);
    --background-color-darker: oklch(0.90 0.005 85);
    
    /* Surface colors for cards and overlays */
    --surface-color: oklch(1 0 0);
    --surface-color-faded: oklch(1 0 0 / 0.8);
    --surface-color-dark: oklch(0.95 0 0);
    
    /* Border and divider colors */
    --border-color: oklch(0.85 0 0 / 0.2);
    --border-color-strong: oklch(0.70 0 0 / 0.3);
    
    /* Status colors */
    --success-color: oklch(0.70 0.15 145);
    --error-color: oklch(0.65 0.20 25);
    --warning-color: oklch(0.75 0.15 85);
    --info-color: oklch(0.70 0.12 220);
    
    --border-radius: 1rem;
    --content-max-width: calc(min(1400px, 100vw) - 2rem);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom focus styles to replace default browser focus rings */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--border-color-strong);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Button focus styles */
button:focus-visible {
    outline: 2px solid var(--border-color-strong);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Input focus styles */
input:focus-visible {
    outline: 2px solid var(--border-color-strong);
    outline-offset: 1px;
    border-radius: 4px;
}

body {
    font-family: Alegreya;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    width: 100%;
}

/* Header */
.header {
    background: var(--primary-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;

}

.header-content {
    width: var(--content-max-width);
    margin-inline: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    height: 2rem;
}

.language-toggle {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-color-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    opacity: 0.7;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--text-color-light / 0.1);
    opacity: 1;
    color: var(--text-color-light);
}

/* Phone Section */
.phone-section {
    background: var(--background-color);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    width: 100%;
    top: 4.5rem; /* Position below the header */
    z-index: 90; /* Below header but above content */
}

.phone-section {
    @media (prefers-reduced-motion: no-preference) {
        animation: phone--leaveview 0.5s linear both;
        animation-timeline: scroll(root);
        animation-range: 0 10vh;
    }
}

.phone-content {
    width: var(--content-max-width);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.phone-content:hover {
    opacity: 0.8;
}

.phone-content .material-icons {
    font-size: 1rem;
    color: var(--text-color-muted);
}

.phone-number {
    color: var(--text-color-muted);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.phone-number:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Main Content */
.main {
    padding: 2rem 0;
    max-width: 100%;
    overflow: clip;
    margin-top: 5rem; /* Account for fixed header + phone section */
}

.menu-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Carousel Container */
.carousel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flavour-carousel {
    display: grid;
    height: 100%;
    gap: 2rem;
    grid-auto-flow: column;
    grid-auto-columns: min(20rem, 70vw);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    list-style: none;
    
    /* Hide scrollbar completely */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    
    /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
    &::-webkit-scrollbar {
        display: none;
    }
    padding-inline: calc(100% - 50% - 10rem);
    padding-block: 8rem;
    width: 100vw; /* Full viewport width */
    
    /* Smooth scrolling with motion preference */
    @media (prefers-reduced-motion: no-preference) {
        scroll-behavior: smooth;
    }
    
    /* Snap to center */
    & li {
        scroll-snap-align: center;
    }
    
    /* Create scroll markers */
    scroll-marker-group: before;
    
    /* Scroll marker group container */
    &::scroll-marker-group {
        /* Position at bottom of carousel content, not the padding */
        /* Start of Selection */
        position: absolute;
        inset-block-end: 0rem; /* 2rem from the bottom of content area */
        inset-inline: 0; /* Full width for centering */
        
        /* Center horizontally */
        margin-inline: auto;
        width: fit-content;
        z-index: 20;
        
        /* Horizontal flex layout for dots */
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        padding-inline: 1rem;
        /* Handle overflow if too many markers */
        overflow: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        
        @media (prefers-reduced-motion: no-preference) {
            scroll-behavior: smooth;
        }
        /* End of Selection */
    }
    
    /* Individual markers for each card */
    & > li::scroll-marker {
        content: " "; /* Empty content creates the marker */
        
        /* Style as circular dots */
        width: 0.75rem;
        height: 0.75rem;
        border: 1px solid var(--border-color-strong);
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
        transition: all 0.2s ease;
        outline-offset: 2px;
        -webkit-tap-highlight-color: transparent;
        
        /* Snap if marker group overflows */
        scroll-snap-align: center;
    }
    
    /* Hover and focus states */
    & > li::scroll-marker:is(:hover, :focus-visible) {
        border-color: var(--primary-color);
        background: var(--primary-color / 0.2);
    }
    
    /* Active state when marker's target is in view */
    & > li::scroll-marker:target-current {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }
    
    /* Scroll button styles */
    &::scroll-button(*) {
        /* Make them round and easy to press */
        inline-size: 3rem;
        aspect-ratio: 1;
        border-radius: 1e3px;
        border: 2px solid var(--border-color-strong);
        background: var(--primary-color);
        color: var(--text-color-light);
        cursor: pointer;
        transition: all 0.2s ease;
        
        /* Position absolutely over the carousel */
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15),rgba(50, 50, 93, 0.25) 0px 30px 60px -12px, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;
        
        /* Space from edges */
        margin: 0;
    }
    
    &::scroll-button(*):focus-visible {
        outline: 2px solid var(--border-color-strong);
        outline-offset: 5px;
    }
    
    &::scroll-button(*):not(:disabled):is(:hover, :active) {
        background: var(--primary-color-dark);
        border-color: var(--primary-color-dark);
    }
    
    &::scroll-button(*):not(:disabled):active {
        scale: 90%;
    }
    
    &::scroll-button(*):disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    &::scroll-button(left) {
        content: "⬅" / "Scroll Left";
        left: 1rem; /* Position from left edge */
    }
    
    &::scroll-button(right) {
        content: "⮕" / "Scroll Right";
        right: 1rem; /* Position from right edge */
    }
}

/* Flavour Card Wrapper */
.card-wrapper {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    container-type: scroll-state;
    list-style: none;
}

/* Start of Selection */
/* Flavour Card */
.flavour-card {
    position: relative;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
    /* Default state for mobile: flat with clipped overflow */
    overflow: clip;
    transition: transform 0.3s ease;
    height: 100%;
}

/* Container query to scale the entire card when its wrapper is snapped */
@supports (container-type: scroll-state) {

    /* Ensure smooth transition regardless of snapped state */
    .card-wrapper>.flavour-card {
        transition: scale 0.3s ease, box-shadow 0.3s ease;
        transition-delay: 0s;
    }

    @container scroll-state(snapped: x) {
        .card-wrapper>.flavour-card {
            scale: 1.125;
            box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;
        }
    }
}
/* End of Selection */


/* Apply opacity to card-cart when NOT snapped */
@supports (container-type: scroll-state) {
    .card-wrapper > .flavour-card .card-cart {
        transition: opacity 0.3s ease;
        transition-delay: 0.1s;
    }

    .card-wrapper > .flavour-card .card-cart {
        opacity: 0.2;
        pointer-events: none;
    }

    @container scroll-state(snapped: x) {
        .card-wrapper > .flavour-card .card-cart {
            opacity: 1;
            pointer-events: auto;
        }
    }
}

/* Card Image */
.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4/5;
    position: relative;
    overflow: clip;
}
/* End of Selection */

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Card Content */
.card-content {
    padding-inline: 1rem;
    padding-block: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Alegreya', serif;
    text-transform: uppercase;
    font-size: calc(1.25rem + 0.5vw);
    line-height: 1.2;
    color: var(--primary-color);
}

.card-price {
    white-space: nowrap;
}

.card-description {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-color-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    flex: 1;
}

.tag {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.card-icon {
    width: 24px;
    height: 24px;
    opacity: 0.6;
    margin-left: 0.5rem;
}

/* Shisha Icon */
.shisha-icon {
    width: 1.8em;
    height: auto;
    opacity: 0.5;
}

/* Card bottom row with shisha icon and cart controls */
.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

/* Scroll-driven cover-flow animation */
@media (min-width: 1550px) {

    .flavour-carousel {
        gap: 5rem;
    }

    .flavour-card {
        will-change: transform;
 /* Apply the scroll-driven animation */
        animation: rotate-cover linear both;
        animation-timeline: view(inline);
    }

    @keyframes rotate-cover {
        0%   { transform: translateX(-100%); }
        35%  { transform: translateX(0); }
        50%  { transform: translateX(0); }
        65%  { transform: translateX(0); }
        100% { transform: translateX(100%); }   
    }
}

@keyframes phone--leaveview {
    to {
        opacity: 0;
        translate: 0 -20px;
    }
}


/* ------------------ Shopping Cart Styles ------------------ */

/* Cart Button inside header */
.cart-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.cart-btn:hover {
    background: var(--text-color-light / 0.15);
    transform: scale(1.05);
}

.cart-btn:active {
    transform: scale(0.95);
}

.cart-count {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: var(--error-color);
    color: #fff;
    border-radius: 4px;
    font-size: 0.65rem;
    padding: 0.1rem 0.25rem;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--background-color);
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.cart-overlay.open {
    transform: translateX(0);
}

.cart-overlay .close-cart {
    align-self: flex-end;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-color-muted);
    font-family: 'Montserrat', sans-serif;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-overlay .close-cart:hover {
    background: var(--background-color-dark);
    color: var(--text-color);
}

.cart-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: 'Montserrat', sans-serif;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: 'Montserrat', sans-serif;
}

.cart-item-name {
    font-weight: 500;
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--text-color-muted);
    font-family: 'Montserrat', sans-serif;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.cart-qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: var(--background-color-dark);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.cart-qty-btn:hover {
    box-shadow: 0 1px 3px var(--text-color / 0.1);
}

.cart-qty-btn .material-icons {
    font-size: 1rem;
}

.cart-qty {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
}

.cart-remove-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: var(--error-color / 0.1);
    color: var(--error-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.cart-remove-btn:hover {
    background: var(--error-color);
    color: white;
}

.cart-remove-btn .material-icons {
    font-size: 1rem;
}

.cart-total {
    margin-top: auto;
    font-weight: 600;
    text-align: right;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.whatsapp-order-btn {
    background: #01E676;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-order-btn:hover {
    background: #00c767;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-order-btn:active {
    transform: translateY(0);
}

.whatsapp-icon {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Card cart controls */
.card-cart {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: var(--background-color-dark);
    color: var(--text-color);
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--background-color);
    box-shadow: 0 1px 3px var(--text-color / 0.1);
}


.qty-input {
    text-align: center;
    height: 1.5rem;
    width: 2.5rem;
    padding: 0.25rem 0;
    border: none;
    background: var(--background-color-dark);
    color: var(--text-color);
    font-size: 0.75em;
    padding: 0.25rem 0;
    border-radius: 4px;
    /* Hide number input arrows/spinners */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: all 0.2s ease;
}

.qty-input:focus {
    background: var(--background-color);
    box-shadow: 0 0 0 1px var(--border-color-strong);
}

/* Additional webkit-specific rules to hide arrows */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-cart-btn {
    background: var(--accent-color);
    height: 1.5rem;
    width: 1.5rem;
    border: none;
    color: var(--text-color-light);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.add-cart-btn:hover {
    background: var(--accent-color-dark);
    box-shadow: 0 1px 3px var(--text-color / 0.1);
}

.add-cart-btn:active {
    transform: scale(0.95);
}

.add-cart-btn .material-icons {
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
}