@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* رنگ‌های اصلی */
    --color-primary: #9caf88;
    --color-primary-dark: #6f815f;
    --color-primary-light: #dfe8d5;

    /* رنگ‌های پس‌زمینه */
    --color-background: #f7f4ec;
    --color-surface: #ffffff;

    /* رنگ‌های متن */
    --color-text: #263127;
    --color-text-muted: #70786f;

    /* رنگ وضعیت‌ها */
    --color-success: #5f7a55;
    --color-success-background: #e2ecdc;

    --color-danger: #a95c52;
    --color-danger-background: #f5dfdc;

    /* کادر و سایه */
    --color-border: #e7e4da;
    --shadow-card: 0 8px 24px rgba(45, 58, 44, 0.08);

    /* گردی گوشه‌ها */
    --radius-small: 10px;
    --radius-medium: 18px;
    --radius-large: 28px;
    --radius-round: 999px;

    /* فاصله‌ها */
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* عرض اصلی منو */
    --container-width: 430px;
}


/* =========================
   تنظیمات عمومی
========================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: 0;

    font-family: "Vazirmatn", sans-serif;
    line-height: 1.7;

    background-color: var(--color-background);
    color: var(--color-text);

    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: none;
}

body {
    font-weight: 400;
}

h1,
h2,
h3 {
    font-weight: 700;
}

.product-price,
.availability-badge {
    font-weight: 500;
}

/* =========================
   قاب اصلی منو
========================= */

.menu-container {
    width: 100%;
    max-width: var(--container-width);

    min-height: 100vh;

    margin: 0 auto;

    overflow: hidden;

    background-color: var(--color-background);


    /* قاب ظریف */
    border: 1px solid rgba(45, 58, 44, 0.12);

    /* گوشه نرم */
    border-radius: 22px;


    /* سایه طبیعی */
    box-shadow:
        0 10px 30px rgba(45, 58, 44, 0.12),
        0 2px 8px rgba(45, 58, 44, 0.06);
}

main {
    padding-inline: var(--space-md);
}


/* =========================
   هدر
========================= */

.site-header {
    width: 100%;
}

.hero-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;

    border-radius:
        0
        0
        24px
        24px;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;

    padding: var(--space-md);

    background:
        linear-gradient(
            to top,
            rgba(38, 49, 39, 0.72),
            rgba(38, 49, 39, 0.02) 65%
        );
}

.cafe-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);

    color: var(--color-surface);
}

.cafe-logo {
    width: 68px;
    height: 68px;
    flex-shrink: 0;

    padding: 5px;
    object-fit: contain;

    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
}

.cafe-brand h1 {
    font-size: 1.3rem;
    line-height: 1.4;
}

.cafe-brand p {
    margin-top: 2px;

    font-size: 0.78rem;
    opacity: 0.9;
}


/* =========================
   دسته‌بندی‌ها
========================= */

/* =========================
   دسته‌بندی‌ها
========================= */

.categories-section {
    margin-top: var(--space-lg);
}

.categories-section h2 {
    margin-bottom: var(--space-md);

    font-size: 1.2rem;
    line-height: 1.5;
}


/* لیست افقی دسته‌بندی‌ها */

.categories-list {
    display: flex;
    align-items: stretch;

    gap: 10px;

    padding:
        2px
        2px
        12px;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;

    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;

    -webkit-overflow-scrolling: touch;
}

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


/* کارت دسته‌بندی */

.category-button {
    width: 92px;
    min-width: 92px;
    height: 98px;

    flex: 0 0 92px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding:
        10px
        7px;

    background-color:
        var(--color-surface);

    color:
        var(--color-text);

    border:
        1px solid
        var(--color-border);

    border-radius: 17px;

    box-shadow:
        0 4px 14px
        rgba(45, 58, 44, 0.05);

    cursor: pointer;

    overflow: hidden;

    scroll-snap-align: start;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;

    -webkit-tap-highlight-color:
        transparent;
}


.category-button:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 7px 18px
        rgba(45, 58, 44, 0.08);
}


.category-button.active {
    background-color:
        var(--color-primary);

    color:
        var(--color-surface);

    border-color:
        var(--color-primary);

    transform:
        scale(0.97);
}


/* آیکن */

.category-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* Lucide */

.category-icon svg {
    width: 30px;
    height: 30px;

    display: block;

    stroke-width: 1.7;
}


/* PNG آپلودی */

.category-custom-icon {
    width: 30px;
    height: 30px;

    display: block;

    object-fit: contain;

    border-radius: 3px;
}


/* نام دسته‌بندی */

.category-title {
    width: 100%;

    min-height: 32px;

    display: -webkit-box;

    overflow: hidden;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    white-space: normal;

    overflow-wrap: anywhere;
    word-break: normal;

    color: inherit;

    font-size: 0.68rem;
    font-weight: 500;

    line-height: 1.45;

    text-align: center;
}


/* =========================
   محصولات
========================= */

.products-section {
    margin-top: var(--space-lg);
}

.section-header {
    margin-bottom: var(--space-md);
    text-align: center;
}

.section-header h2 {
    font-size: 1.2rem;
    line-height: 1.5;
}

.section-header p {
    margin-top: 2px;

    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.product-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    min-height: 98px;
    padding: 7px;

    background-color: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 16px;

    box-shadow: 0 5px 16px rgba(45, 58, 44, 0.06);

    animation: fadeInUp 0.45s ease;
}

@keyframes fadeInUp {
    from {
        transform: translateY(16px);
    }

    to {
        transform: translateY(0);
    }
}

.product-image {
    width: 82px;
    height: 82px;

    object-fit: cover;
    border-radius: 12px;
}

.product-content {
    min-width: 0;
    padding-inline-end: 3px;
}

.product-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.product-title-row h3 {
    min-width: 0;

    font-size: 0.92rem;
    line-height: 1.5;
}

.product-description {
    margin-top: 3px;

    color: var(--color-text-muted);
    font-size: 0.74rem;
    line-height: 1.65;
}

.product-price {
    margin-top: 4px;

    color: var(--color-primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.availability-badge {
    flex-shrink: 0;

    padding: 2px 7px;

    background-color: var(--color-success-background);
    color: var(--color-success);

    border-radius: var(--radius-round);

    font-size: 0.62rem;
    white-space: nowrap;
}

.availability-badge.unavailable {
    background-color: var(--color-danger-background);
    color: var(--color-danger);
}

.product-card-unavailable {
    opacity: 0.58;
    filter: grayscale(1);
}

.product-card-unavailable .availability-badge {
    opacity: 1;
    filter: none;
}

/* =========================
   فوتر
========================= */

.site-footer {
    width: 100%;

    margin-top: var(--space-xl);
    padding: 20px var(--space-md);

    background-color: var(--color-primary-dark);
    color: var(--color-surface);

    border-radius:
        var(--radius-large)
        var(--radius-large)
        0
        0;

    text-align: center;
    font-size: 0.75rem;
}

.site-footer address {
    margin-top: var(--space-xs);

    font-style: normal;
    opacity: 0.9;
}

.site-footer address + p {
    margin-top: var(--space-xs);
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}


/* =========================
   موبایل‌های کوچک
========================= */

@media (max-width: 380px) {
    body {
        padding: 0;
    }

    .menu-container {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    }

    .hero-image-wrapper {
        height: 205px;
        border-radius: 0 0 22px 22px;
    }

    main {
        padding-inline: 12px;
    }

    .cafe-logo {
        width: 60px;
        height: 60px;
    }

    .cafe-brand h1 {
        font-size: 1.15rem;
    }

    .category-button {
    width: 86px;
    min-width: 86px;
    height: 94px;

    flex-basis: 86px;
}

.category-title {
    font-size: 0.65rem;
}

    .product-card {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
    }

    .product-image {
        width: 76px;
        height: 76px;
    }

    .product-title-row h3 {
        font-size: 0.86rem;
    }

    .product-description {
        font-size: 0.7rem;
    }

    .product-price {
        font-size: 0.78rem;
    }
}

/* =========================
   سرچ باکس
========================= */

.search-box {
    position: relative;

    display: flex;
    align-items: center;

    margin-bottom: var(--space-md);
}

.search-icon {
    position: absolute;
    right: 14px;

    color: var(--color-primary-dark);
    font-size: 1.2rem;

    pointer-events: none;
}

#product-search {
    width: 100%;
    height: 48px;

    padding: 0 44px 0 14px;

    background-color: var(--color-surface);
    color: var(--color-text);

    border: 1px solid var(--color-border);
    border-radius: 15px;

    box-shadow: 0 4px 14px rgba(45, 58, 44, 0.05);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

#product-search::placeholder {
    color: var(--color-text-muted);
    opacity: 0.75;
}

#product-search:focus {
    border-color: var(--color-primary);
    background-color: #ffffff;

    box-shadow:
        0 0 0 3px rgba(156, 175, 136, 0.18),
        0 6px 18px rgba(45, 58, 44, 0.07);
}

.empty-state {
    padding: 32px 16px;

    background-color: var(--color-surface);

    border: 1px dashed var(--color-border);
    border-radius: 16px;

    text-align: center;
}

.empty-state-icon {
    display: block;
    margin-bottom: 8px;

    font-size: 1.8rem;
    filter: grayscale(1);
}

.empty-state-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.empty-state-description {
    margin-top: 4px;

    color: var(--color-text-muted);
    font-size: 0.75rem;
}


.hero-image-wrapper {
    background: #ece8dd;
}

.hero-image:not([src]),
.cafe-logo:not([src]) {
    visibility: hidden;
}

.dynamic-loading {
    opacity: 0;
}

.dynamic-ready {
    opacity: 1;
    transition: opacity 0.2s ease;
}

