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

:root {
    --primary: #f26b0f;
    --primary-dark: #d95a05;
    --primary-ink: #c2410c;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #ffffff;
    --card: #ffffff;
    --border: #e8e4de;
    --radius: 14px;
    --gutter: clamp(16px, 4vw, 64px);
    --header-gutter: clamp(12px, 1.6vw, 28px);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    padding-bottom: 70px;
}

button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1920px; margin: 0 auto; padding: 0 var(--gutter); }

/* Top announcement bar */
.topbar { display: none !important; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff; border-bottom: 1px solid var(--border);
}
.site-header .container { max-width: none; padding-left: var(--header-gutter); padding-right: var(--header-gutter); }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; font-weight: 700; font-size: 1.2rem; color: var(--primary); }
.brand img { height: 48px; width: auto; display: block; }
.main-nav { display: none; gap: 40px; align-items: center; justify-content: center; }
.main-nav a { font-size: 1.4rem; font-weight: 500; }
.main-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

/* Hamburger button + category drawer */
.burger {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 50px; height: 50px; padding: 0; border: 1px solid #d6d3cd; background: #fff;
    color: var(--text); border-radius: 999px; cursor: pointer; transition: background .15s;
}
.burger svg { width: 28px; height: 28px; }
.burger:hover { background: #f5f3f0; }
.drawer-overlay {
    position: fixed; inset: 0; z-index: 90; background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.drawer {
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 100;
    width: min(360px, 88vw); background: #fff; overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility .25s;
    box-shadow: -8px 0 30px rgba(17, 24, 39, .15);
}
.drawer-open { overflow: hidden; }
.drawer-open .drawer-overlay { opacity: 1; visibility: visible; }
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-head {
    position: sticky; top: 0; z-index: 1; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 1.35rem;
}
.drawer-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px;
    background: #f5f3f0; color: var(--text); font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.drawer-close:hover { background: #fff1e6; color: var(--primary); }
.drawer-section { padding: 10px 12px; }
.drawer-section + .drawer-section { border-top: 1px solid var(--border); }
.drawer-label { padding: 10px 12px 6px; font-size: 1rem; color: var(--muted); }
.drawer-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 12px; font-weight: 600; font-size: 1.2rem;
}
.drawer-link:hover, .drawer-link:active { background: #fff1e6; color: var(--primary-ink); }
.drawer-ico { display: none; }
.drawer-sub { display: block; padding: 9px 64px 9px 12px; font-size: 1.1rem; color: var(--muted); border-radius: 10px; }
.drawer-sub:hover, .drawer-sub:active { background: #fff1e6; color: var(--primary-ink); }
.drawer-main { display: block; }

/* Header search box */
.header-search {
    order: 3; flex: 1 0 100%;
    display: flex; align-items: center; gap: 8px;
    height: 50px; padding: 0 16px;
    background: #f5f3f0; border: 1px solid var(--border); border-radius: 999px;
    transition: border-color .15s, background .15s;
}
.header-search:focus-within { background: #fff; border-color: var(--primary); }
.header-search button { display: flex; align-items: center; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; }
.header-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1.25rem; color: var(--text); text-overflow: ellipsis; }
.header-search input::placeholder { color: var(--muted); }

/* Header pill and round buttons */
.pill-btn, .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 50px; border: 1px solid #d6d3cd; background: #fff; color: var(--text);
    border-radius: 999px; cursor: pointer; font-size: 1.25rem; white-space: nowrap;
    transition: background .15s;
}
.pill-btn { gap: 8px; padding: 0 20px; }
.icon-btn { width: 50px; padding: 0; }
.pill-btn:hover, .icon-btn:hover { background: #f5f3f0; }
.pill-user { cursor: default; }
.pill-user:hover { background: #fff; }
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

.btn {
    display: inline-block; background: var(--primary); color: #fff;
    padding: 10px 20px; border-radius: 10px; border: 0; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: var(--primary-dark); }
.btn-small { padding: 6px 14px; font-size: .9rem; }

/* Hero: full-width slider + side banner */
.hero { padding: 0; }
.hero .container { max-width: none; padding: 0; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.hero-swiper { border-radius: 0; overflow: hidden; min-width: 0; width: 100%; margin: 0; }
.hero-slide {
    height: 190px; display: flex; flex-direction: column; justify-content: center;
    padding: 0 24px; color: #fff;
}
.hero-slide h2 { margin: 0 0 6px; font-size: 1.3rem; }
.hero-slide p { margin: 0 0 12px; font-size: .95rem; opacity: .95; }
.hero-slide .btn { background: #fff; color: var(--primary-ink); align-self: flex-start; padding: 8px 18px; font-weight: 600; }
.slide-1 { background: linear-gradient(135deg, #ff9a3c, #f26b0f 55%, #c2410c); }
.slide-2 { background: linear-gradient(135deg, #111827, #374151); }
.slide-3 { background: linear-gradient(135deg, #fbbf24, #f97316 60%, #dc2626); }
.swiper-pagination-bullet-active { background: #fff !important; }
.swiper-pagination-bullet { background: #fff; opacity: .7; }
.hero-swiper .swiper-pagination-bullet { width: 8px; height: 8px; transition: width .2s; }
.hero-swiper .swiper-pagination-bullet-active { width: 24px; border-radius: 6px; }

.hero-side {
    display: none; flex-direction: column; justify-content: center; gap: 6px;
    padding: 24px; color: #fff; text-align: center;
    background: linear-gradient(160deg, #1f2937, #111827);
}
.hero-side b { font-size: 1.5rem; }
.hero-side span { font-size: .9rem; opacity: .9; }
.hero-side .btn { align-self: center; margin-top: 8px; padding: 8px 18px; }

/* Sections */
.section { padding: 28px 0 8px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 1.8rem; padding-inline-start: 12px; position: relative; }
.section-title h2::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%;
    width: 4px; border-radius: 4px; background: var(--primary);
}
.section-title a { color: var(--primary-ink); font-size: 1.3rem; }

/* Old category grid (kept for other pages) */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 8px; text-align: center; font-weight: 600;
}
.cat-card span { display: block; font-size: 1.8rem; margin-bottom: 4px; }

/* Round category row */
.cat-row {
    display: flex; justify-content: safe center; gap: 24px;
    overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 84px; font-size: .85rem; font-weight: 600; text-align: center; }
.cat-circle {
    width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
    font-size: 2rem; background: #fff1e6; border: 1px solid #fbd9bd;
    transition: transform .2s, box-shadow .2s;
}
.cat-item:nth-child(4n+2) .cat-circle { background: #fff7d6; border-color: #f6e19a; }
.cat-item:nth-child(4n+3) .cat-circle { background: #ffe9ec; border-color: #f8c6cd; }
.cat-item:nth-child(4n+4) .cat-circle { background: #eceff3; border-color: #d3d8e0; }
.cat-item:hover .cat-circle { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(17, 24, 39, .1); }

/* Shop block: tabbed products */
.shop-container { max-width: none; padding-left: var(--header-gutter); padding-right: var(--header-gutter); }
.shop { display: grid; grid-template-columns: 1fr; gap: 16px; }
.shop-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.shop-head h2 { margin: 0; font-size: 1.8rem; padding-inline-start: 12px; position: relative; }
.shop-head h2::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%;
    width: 4px; border-radius: 4px; background: var(--primary);
}
.shop-head .more { margin-inline-start: auto; color: var(--primary-ink); font-size: 1.3rem; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
    border: 1px solid #d6d3cd; background: #fff; color: var(--text);
    padding: 6px 22px; border-radius: 999px; font-size: 1.3rem; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.tab:hover { border-color: var(--primary); }
.tab.active { background: #fff1e6; border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* Products: big image cards, text and price in one row under the image */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.product-card {
    display: flex; flex-direction: column; gap: 8px;
    background: none; border: 0; border-radius: 0; overflow: visible;
}
.product-cover {
    position: relative; overflow: hidden;
    aspect-ratio: 4 / 3; border-radius: var(--radius);
    background: linear-gradient(135deg, #fff1e6, #fde7c8);
    display: flex; align-items: center; justify-content: center;
    transition: transform .25s, box-shadow .25s;
}
.product-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.cover-icon { font-size: 3rem; }
.product-card:hover .product-cover { box-shadow: 0 12px 28px rgba(17, 24, 39, .14); }
.product-card:hover .product-cover img { transform: scale(1.04); }
.product-body {
    display: flex; flex-direction: row; align-items: center; justify-content: space-between;
    gap: 10px; padding: 0 4px;
}
.product-info { display: flex; flex-direction: column; min-width: 0; }
.product-type { font-size: 1rem; color: var(--muted); }
.product-title { font-size: 1.25rem; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.5; }
.price-now { color: var(--primary-ink); font-weight: 700; font-size: 1.2rem; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 1rem; }
.price-free { color: #15803d; font-weight: 700; font-size: 1.2rem; }

/* Footer */
.site-footer {
    margin-top: 48px; padding: 56px 0 0;
    background: #fff; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 1.15rem;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.footer-col h3 { margin: 0 0 18px; font-size: 1.5rem; color: var(--text); }
.footer-col h4 { margin: 22px 0 14px; font-size: 1.2rem; color: var(--text); }
.footer-col a { display: block; padding: 8px 0; color: var(--muted); transition: color .15s; }
.footer-col a:hover { color: var(--primary); }
.footer-about p { margin: 0; line-height: 2; }

.footer-social { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-col .footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; padding: 0; border-radius: 50%;
    background: #fff1e6; color: var(--primary-ink);
    transition: background .15s, color .15s, transform .15s;
}
.footer-col .footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.footer-social svg { width: 28px; height: 28px; }
.footer-col .footer-social a.social-color:hover { background: #fff1e6; }

.footer-bottom {
    margin-top: 36px; padding: 22px 0; border-top: 1px solid var(--border);
    font-size: 1rem; text-align: center;
}

/* Mobile bottom nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 6px 0 8px; font-size: .75rem;
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.bottom-nav span { font-size: 1.3rem; line-height: 1.2; }

/* Tablet and desktop */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .brand img { height: 62px; }
    .header-inner { flex-wrap: nowrap; gap: 24px; }
    .header-search { order: 0; flex: 1 1 auto; max-width: 560px; }
    .hero-slide { height: clamp(260px, 24vw, 380px); padding: 0 48px; }
    .hero-slide h2 { font-size: 2rem; }
    .hero-slide p { font-size: 1.1rem; }
    .cat-grid { grid-template-columns: repeat(6, 1fr); }
    .cat-row { gap: 40px; }
    .cat-circle { width: 84px; height: 84px; font-size: 2.3rem; }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
    .product-title { font-size: 1.3rem; }
    .price-now { font-size: 1.25rem; }
    .price-free { font-size: 1.25rem; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
    .footer-bottom { text-align: start; }
}

@media (min-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr 24%; }
    .hero-side { display: flex; }
}

/* Wide screens: menu sits in the first header row, centered next to the search box */
@media (min-width: 1100px) {
    html { zoom: 0.7; }
    .header-search { flex: 0 1 420px; }
    .main-nav { display: flex; flex: 1 1 auto; }
    .drawer-main { display: none; }
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .shop-container { max-width: 2300px; }
}

/* Admin-managed banners */
.hero-slide.hero-img { padding: 0; display: block; position: relative; overflow: hidden; background: #e5e7eb; }
.hero-slide.hero-img picture,
.hero-slide.hero-img img,
.hero-side-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-side.hero-side-img { padding: 0; position: relative; overflow: hidden; background: none; }

/* Banner images: fixed ratio so the image is never cropped */
.hero-slide.hero-img { height: auto; aspect-ratio: 2 / 1; }
@media (min-width: 768px) {
    .hero-slide.hero-img { height: auto; aspect-ratio: 3 / 1; }
}