@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Pacifico&display=swap');

:root {
    --primary: #FF6B6B;
    /* Accent Red */
    --primary-dark: #FF5252;
    --bg-body: #F9F9F9;
    /* Very light gray background */
    --bg-card: #FFFFFF;
    --text-main: #2D3436;
    /* Dark gray for headings */
    --text-sub: #636E72;
    /* Softer gray for descriptions */
    --text-light: #B2BEC3;
    --radius-lg: 30px;
    /* Large rounded corners */
    --radius-md: 20px;
    --radius-sm: 12px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
    /* Very soft shadow */
    --shadow-float: 0 20px 40px rgba(0, 0, 0, 0.1);
    --bg-gray: #F0F0F0;
    --bg-qty: #E8F5E9;
    /* Light Green */
}

[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1E1E1E;
    --text-main: #FFFFFF;
    --text-sub: #B0B3B8;
    --text-light: #606770;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.03);
    --bg-gray: #2C2C2C;
    --bg-qty: #1b4d2e;
    /* Dark Green */
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-bottom: 100px;
    /* Space for floating cart */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* --- Header & Nav --- */
.app-header {
    padding: 30px 25px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.welcome-text p {
    color: var(--text-sub);
    margin: 5px 0 0;
    font-size: 16px;
}

.search-btn {
    width: 45px;
    height: 45px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-soft);
    font-size: 18px;
    color: var(--text-main);
}

/* --- Categories --- */
/* --- Categories --- */
/* (Moved to later section with sticky styles) */

.categories-wrapper::-webkit-scrollbar {
    display: none;
}

.category-pill {
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: 0.3s;
    font-weight: 600;
    color: var(--text-sub);
}

.category-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

.category-pill i {
    font-size: 18px;
}

/* --- Product Grid --- */
.section-title {
    padding: 0 25px;
    margin-top: 30px;
    font-size: 20px;
    font-weight: 700;
}

.products-grid {
    padding: 20px 25px;
    display: grid;
    /* Default: Responsive auto-fill */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

/* Force 2 columns on mobile */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        /* Reduce gap to ensure fit */
        padding: 20px 10px;
        /* Reduce padding */
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 10px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    display: block;
    /* Link wrap */
}

.product-card:active {
    transform: scale(0.98);
}

.prod-img-box {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.prod-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-title {
    font-size: 16px;
    font-weight: 700;
    margin: 5px 0;
    color: var(--text-main);
}

.prod-meta {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.prod-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.currency {
    font-size: 12px;
    color: var(--text-light);
}

/* --- Floating Cart Bar --- */
.floating-cart {
    position: fixed;
    bottom: 30px;
    left: 25px;
    right: 25px;
    background: #2D3436;
    color: white;
    padding: 18px 25px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-float);
    z-index: 100;
    cursor: pointer;
}

.cart-info {
    display: flex;
    flex-direction: column;
}

.cart-items-count {
    font-size: 12px;
    opacity: 0.7;
}

.cart-total {
    font-size: 18px;
    font-weight: 700;
}

.cart-action {
    background: var(--primary);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* --- Details Page --- */
.details-hero {
    height: 45vh;
    width: 100%;
    position: relative;
}

.details-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.back-btn {
    position: absolute;
    top: 30px;
    left: 25px;
    /* RTL switch handled by HTML dir */
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    /* Darker transparent */
    backdrop-filter: blur(5px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f1c40f;
    /* Gold Icon */
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
}

[dir="rtl"] .back-btn {
    right: 25px;
    left: auto;
}

.details-card {
    background: var(--bg-card);
    margin-top: -40px;
    border-radius: 40px 40px 0 0;
    padding: 35px 25px 120px;
    /* Bottom padding for button */
    position: relative;
    min-height: 60vh;
}

.line-indicator {
    width: 50px;
    height: 5px;
    background: #eee;
    margin: 0 auto 20px;
    border-radius: 5px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 5px;
}

.detail-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.detail-desc {
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Nutrition Mockup */
.nutrition-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.nut-box {
    background: #F8F9FA;
    padding: 12px 15px;
    border-radius: 15px;
    text-align: center;
    min-width: 70px;
}

.nut-val {
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.nut-label {
    font-size: 12px;
    color: var(--text-light);
}

/* User Review Mockup */
.user-review {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ccc;
}

/* Quantity & Add */
.action-box {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 25px 30px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-qty);
    padding: 10px 15px;
    border-radius: 15px;
    font-weight: 700;
}

.btn-mini {
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: 0.2s;
}

.btn-mini:active {
    transform: scale(0.9);
}

.qty-btn {
    font-size: 18px;
    color: var(--text-main);
    background: transparent;
}

.add-btn {
    flex: 1;
    margin-right: 20px;
    /* Switch for RTL */
    background: var(--primary);
    color: white;
    padding: 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

[dir="rtl"] .add-btn {
    margin-right: 20px;
    margin-left: 0;
}

/* --- Checkout Bottom Sheet --- */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    /* Toggled via JS .active class */
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.bottom-sheet.active {
    display: flex;
    opacity: 1;
}

.sheet-content {
    background: var(--bg-card);
    width: 100%;
    border-radius: 30px 30px 0 0;
    padding: 30px 25px 40px;
    animation: slideUpSheet 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sheet-header {
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 800;
}

.sheet-header::before {
    content: '';
    display: block;
    width: 50px;
    height: 5px;
    background: #ddd;
    margin: -10px auto 20px;
    border-radius: 5px;
}

/* Form Elements */
.type-select-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.type-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 15px;
    background: var(--bg-card);
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.type-btn.selected {
    border-color: var(--primary);
    background: #fff0f0;
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #f9f9f9;
    font-family: inherit;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--text-main);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    margin-top: 10px;
}

/* Overlay for Success */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.overlay-content {
    background: var(--bg-card);
    padding: 40px;
    text-align: center;
    border-radius: 20px;
    width: 80%;
    max-width: 400px;
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    margin: 0 2px;
}

.star-rating label:before {
    content: "\f005";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: #FFD700;
}

/* --- New Header Design --- */
.app-header-grid {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    /* position: sticky;  <-- Removed sticky */
    /* top: 0; */
    z-index: 100;
}

/* ... existing code ... */

/* --- Categories --- */
.categories-wrapper {
    margin-top: 10px;
    /* Reduced from 25px */
    overflow-x: auto;
    padding: 15px 25px;
    /* Increased padding properly */
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    gap: 15px;

    /* Sticky Magic */
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-body);
    /* Match body bg so it covers content */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    /* Optional shadow for effect */
}

.header-left,
.header-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-center {
    text-align: center;
}

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Pacifico&display=swap');

/* ... (rest of imports) */

.brand-title {
    font-family: "BBH Bartle", sans-serif;
    /* Beautiful handwriting style */
    font-size: 28px;
    font-weight: 400;
    color: #FF6B6B;
    /* Carrot/Orange color - very appetizing */
    margin: 0;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    /* Soft square */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    color: #666;
    text-decoration: none;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.profile-pic img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Search & Filter --- */
.search-section {
    display: flex;
    gap: 15px;
    padding: 10px 20px;
    background: #fff;
}

.search-box {
    flex-grow: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    background: #f8f9fa;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    color: #555;
    outline: none;
    direction: ltr;
}

/* Adjust for RTL */
html[dir="rtl"] .search-box input {
    padding: 12px 40px 12px 15px;
    direction: rtl;
}

.search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    left: 15px;
}

html[dir="rtl"] .search-icon {
    left: auto;
    right: 15px;
}

.filter-btn {
    width: 48px;
    height: 46px;
    background: #FF6B6B;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

/* --- Banner Slider --- */
.banner-slider {
    padding: 15px 20px;
    display: flex;
    overflow-x: auto;
    gap: 15px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
}

.banner-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.banner-slide {
    min-width: 100%;
    border-radius: 20px;
    overflow: hidden;
    scroll-snap-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.banner-slide img {
    width: 100%;
    height: 180px;
    /* Adjust height as needed */
    object-fit: cover;
    display: block;
}

/* --- Golden Offers Theme --- */
:root {
    --gold-primary: #f1c40f;
    --gold-secondary: #f39c12;
    --gold-text: #7f6000;
}

/* Golden Category Pill */
.category-pill.golden-category {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #fff;
    border: 1px solid #d4ac0d;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    animation: goldPulse 2s infinite;
}

@keyframes goldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(243, 156, 18, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}

/* Golden Product Card */
.product-card.golden-mode {
    border: none;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    /* Full Golden Background */
    box-shadow: 0 10px 25px rgba(243, 156, 18, 0.4);
    transform: scale(1.02);
    /* Slight pop */
}

.product-card.golden-mode .prod-title,
.product-card.golden-mode .prod-meta span {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.product-card.golden-mode .prod-price {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 800;
}

.product-card.golden-mode .add-btn {
    background: #fff;
    color: #f39c12;
    /* Gold text */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Countdown Timer */
#countdown-container {
    background: linear-gradient(90deg, #111, #333);
    color: var(--gold-primary);
    padding: 15px;
    margin: 15px 25px;
    border-radius: 12px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    gap: 20px;
    border: 1px solid var(--gold-secondary);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease;
}

#countdown-timer {
    font-family: monospace;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#reviewForm {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px dashed #eee;
    transition: all 0.3s ease;
}

[data-theme="dark"] #reviewForm {
    background: #2D3436;
    /* Darker card background */
    border-color: #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* Deep shadow for pop */
}

/* Make the title inside pop too */
[data-theme="dark"] #reviewForm h4 {
    color: var(--primary);
}

/* Review Form Submit Button */
#reviewForm .submit-btn {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
}

#reviewForm .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.6);
}

/* Enhance Stars */
.star-rating label {
    font-size: 24px;
    /* Bigger stars */
    transition: color 0.2s;
}

.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: #f1c40f !important;
    /* Force gold */
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    /* Glow effect */
}