:root {
  --green: #1f9d55;
  --green-dark: #17803f;
  --green-soft: #e8f6ee;
  --text: #1d2a22;
  --muted: #66756c;
  --bg: #f6f8f7;
  --card: #ffffff;
  --border: #e3e8e5;
  --danger: #d93838;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--green-dark); }
button { font: inherit; cursor: pointer; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--green-dark); text-decoration: none; }
.logo-icon { font-size: 24px; }
.phone-link { margin-left: auto; text-decoration: none; font-weight: 600; white-space: nowrap; }
.cart-btn {
  position: relative; border: 0; background: var(--green); color: #fff;
  border-radius: 12px; padding: 8px 14px; font-size: 18px;
}
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px;
}

.header { transition: box-shadow .25s, background .25s; }
.header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .08); background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); }
.logo:hover .logo-icon { animation: wiggle .5s; }
.cart-btn { transition: transform .15s; }
.cart-btn.bump { animation: bump .45s; }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 44px 0 90px;
  background: linear-gradient(120deg, #0d6b35, #1f9d55, #2bb673, #13894a, #0d6b35);
  background-size: 300% 300%;
  animation: gradientMove 14s ease infinite;
}
.hero-blob { position: absolute; z-index: 1; border-radius: 50%; filter: blur(60px); opacity: .4; pointer-events: none; }
.hero-blob.b1 { width: 380px; height: 380px; background: #ffd166; top: -140px; right: -80px; animation: blob 12s ease-in-out infinite; }
.hero-blob.b2 { width: 300px; height: 300px; background: #06d6a0; bottom: -120px; left: -60px; animation: blob 15s ease-in-out infinite reverse; }

/* Fondagi bozor rasmi: sekin yaqinlashadi, ustida yashil parda */
.hero-photo {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: url("images/hero/bozor.jpg") center / cover no-repeat;
  opacity: .28; mix-blend-mode: luminosity;
  animation: kenburns 30s ease-in-out infinite alternate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(10, 80, 40, .75) 0%, rgba(10, 80, 40, .35) 60%, rgba(10, 80, 40, .1) 100%);
}

.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero-text > * { animation: fadeUp .7s both; }
.hero-text > :nth-child(2) { animation-delay: .1s; }
.hero-text > :nth-child(3) { animation-delay: .2s; }
.hero-text > :nth-child(4) { animation-delay: .3s; }
.hero-text > :nth-child(5) { animation-delay: .4s; }

.open-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
  font-size: 13px; font-weight: 600; backdrop-filter: blur(6px);
}
.open-badge i { width: 8px; height: 8px; border-radius: 50%; background: #7CFFB2; box-shadow: 0 0 0 0 rgba(124, 255, 178, .7); animation: pulse 1.8s infinite; }
.open-badge.closed i { background: #ff8a8a; animation: none; }

.hero h1 { margin: 14px 0 10px; font-size: clamp(28px, 5.4vw, 50px); line-height: 1.1; letter-spacing: -.5px; }
.rotator {
  display: inline-block; color: #ffd166;
  background: linear-gradient(90deg, #ffe08a, #ffb703); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  transition: opacity .35s, transform .35s;
}
.rotator.out { opacity: 0; transform: translateY(12px); }
.hero p { margin: 0 0 20px; font-size: 17px; opacity: .92; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.btn-light, .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 13px 22px; border-radius: 14px;
  font-weight: 700; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-light { background: #fff; color: var(--green-dark); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .24); }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.hero-chips span { background: rgba(0, 0, 0, .14); border-radius: 999px; padding: 7px 12px; }

/* Slayder */
.hero-slider { position: relative; height: 320px; animation: fadeUp .8s .3s both; }
.slide {
  position: absolute; inset: 0 0 26px; border-radius: 24px; overflow: hidden; cursor: pointer;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .3); border: 3px solid rgba(255, 255, 255, .85);
  opacity: 0; transform: translateX(40px) scale(.94) rotate(2deg);
  transition: opacity .6s, transform .6s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none; background: #0d6b35;
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.12); transition: transform 4.5s ease-out; }
.slide.active img { transform: scale(1); }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .25) 45%, transparent 70%);
}
.slide.active { opacity: 1; transform: none; pointer-events: auto; }
.slide.leave { opacity: 0; transform: translateX(-40px) scale(.94) rotate(-2deg); }
.slide-text { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; display: grid; gap: 4px; }
.slide-text .tag {
  justify-self: start; background: var(--c); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; opacity: 1;
}
.slide-text b { font-size: 24px; line-height: 1.2; }
.slide-text span { opacity: .92; font-size: 15px; }
.slide.active .slide-text > * { animation: fadeUp .6s both; }
.slide.active .slide-text > :nth-child(2) { animation-delay: .1s; }
.slide.active .slide-text > :nth-child(3) { animation-delay: .2s; }
.dots { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: rgba(255, 255, 255, .45); transition: width .3s, background .3s; }
.dots button.active { width: 24px; background: #fff; }

.hero-wave { position: absolute; z-index: 2; left: 0; bottom: -1px; width: 100%; height: 60px; }

/* Mahsulot kartalari paydo bo'lish animatsiyasi */
.products.anim .card { animation: fadeUp .45s both; animation-delay: calc(var(--i) * 35ms); }

@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12) translateX(-2%); } }
@keyframes gradientMove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-40px, 30px) scale(1.15); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(124, 255, 178, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 255, 178, 0); } }
@keyframes bump { 30% { transform: scale(1.18); } 60% { transform: scale(.95); } }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

@media (max-width: 820px) {
  .hero { padding: 28px 0 70px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .hero-slider { height: 240px; }
  .slide-text b { font-size: 20px; }
  .hero::before { background: rgba(10, 80, 40, .55); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Katalog sarlavhasi */
.catalog { padding-bottom: 48px; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 22px 0 6px; }
.catalog-head h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.5px; }
.catalog-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sort-select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 36px 10px 14px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2366756c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
  transition: border-color .2s;
}
.sort-select:hover, .sort-select:focus { border-color: var(--green); outline: 0; }

/* Qidiruv va kategoriyalar paneli: pastga tushganda yuqorida yopishib turadi */
.catalog-bar {
  position: sticky; top: 60px; z-index: 15;
  margin: 0 -16px 18px; padding: 10px 16px 6px;
  background: rgba(246, 248, 247, .92); backdrop-filter: blur(12px);
  transition: box-shadow .25s;
}
.catalog-bar.stuck { box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .25); }

.search-box {
  display: flex; align-items: center; background: var(--card);
  border: 1.5px solid var(--border); border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04); transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 157, 85, .14); }
.search-box svg { flex: none; width: 20px; height: 20px; margin-left: 16px; color: var(--muted); transition: color .2s; }
.search-box:focus-within svg { color: var(--green); }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 14px 12px; font: inherit; font-size: 16px; color: var(--text);
}
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear-btn { flex: none; border: 0; width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 13px; }
.clear-btn:hover { background: var(--border); color: var(--text); }

.categories {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 6px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent); mask-image: linear-gradient(90deg, #000 94%, transparent);
}
.categories::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: none; display: flex; align-items: center; gap: 8px;
  border: 0; background: var(--card); color: var(--text);
  border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07); transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.cat-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0, 0, 0, .1); }
.cat-thumb { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--green-soft); font-size: 16px; flex: none; }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 7px; }
.cat-btn.active { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(31, 157, 85, .35); }
.cat-btn.active .cat-thumb { box-shadow: 0 0 0 2px #fff; }
.cat-btn.active .cat-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* Mahsulot kartalari */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px; padding: 8px 8px 12px;
  border: 1px solid rgba(0, 0, 0, .04); box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -14px rgba(0, 0, 0, .22); }
.card-img {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--green-soft); display: grid; place-items: center; font-size: 56px;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .card-img img { transform: scale(1.07); }
.card-badge {
  position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 8px; background: #fff1d0; color: #9a5b00;
}
.card-badge.out { background: rgba(29, 42, 34, .85); color: #fff; }
.card-unit {
  position: absolute; bottom: 8px; left: 8px; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(4px);
}
.card-body { flex: 1; padding: 10px 4px; }
.card-price { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.card-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-name {
  margin-top: 2px; font-size: 14px; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-action { padding: 0 4px; }
.add-btn {
  width: 100%; height: 40px; border: 0; border-radius: 12px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green-soft); color: var(--green-dark); transition: background .2s, color .2s, transform .1s;
}
.add-btn:hover { background: var(--green); color: #fff; }
.add-btn:active { transform: scale(.97); }
.add-btn .plus { font-size: 20px; line-height: 1; font-weight: 600; }
.add-btn:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.card.out .card-img img { filter: grayscale(1); opacity: .55; }

.qty { display: flex; align-items: center; justify-content: space-between; background: var(--green-soft); border-radius: 10px; }
.qty button { border: 0; background: transparent; width: 38px; height: 38px; font-size: 20px; color: var(--green-dark); font-weight: 700; }
.qty span { font-weight: 700; }
.card .qty { height: 40px; background: var(--green); border-radius: 12px; animation: popIn .25s; }
.card .qty button, .card .qty span { color: #fff; }
.card .qty button { height: 40px; border-radius: 12px; }
.card .qty button:hover { background: rgba(255, 255, 255, .15); }

/* Yuklanayotganda skelet kartalar */
.skeleton .card-img, .sk-line {
  background: linear-gradient(90deg, #edf1ee 25%, #f8faf9 50%, #edf1ee 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
.sk-line { height: 14px; border-radius: 6px; margin: 12px 4px 0; }
.sk-line.short { width: 55%; }
.sk-line.btn { height: 40px; border-radius: 12px; margin-top: 14px; }

.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state .icon { font-size: 48px; }
.empty-state b { display: block; color: var(--text); font-size: 18px; margin: 8px 0 4px; }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes popIn { from { transform: scale(.92); opacity: .4; } }

/* Footer */
.footer { background: var(--text); color: #cfd8d2; padding: 32px 0 90px; font-size: 14px; }
.footer a { color: #fff; }
.footer p { margin: 6px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 24px; align-items: start; }
.footer-brand { font-size: 18px; color: #fff; }
.map-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.map-links a {
  text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); transition: background .2s;
}
.map-links a:hover { background: rgba(255, 255, 255, .2); }
.map-box { border-radius: var(--radius); overflow: hidden; height: 220px; }
.map-box iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 13px; color: #9fb0a6;
}
.footer-legal nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-legal a { color: #cfd8d2; text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }
.consent { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; line-height: 1.5; }

/* Drawer */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--card); z-index: 40; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 20px; }
.icon-btn { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }
.drawer-body { overflow-y: auto; padding: 12px 16px 24px; flex: 1; }

.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item .ci-emoji { font-size: 30px; width: 44px; text-align: center; }
.cart-item .ci-emoji img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14px; }
.cart-item .ci-price { color: var(--muted); font-size: 13px; }
.cart-item .qty { width: 112px; }
.cart-item .qty button { width: 34px; height: 34px; }

.totals { margin: 14px 0; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 4px; }

form h3 { margin: 18px 0 10px; }
form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
form input:not([type=radio]):not([type=checkbox]), form textarea, form select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--text); border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.radio-group label {
  margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 14px;
}
.radio-group label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.error { color: var(--danger); font-size: 14px; }

.primary-btn, .secondary-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 14px; font-weight: 700; font-size: 16px;
}
.primary-btn { background: var(--green); color: #fff; }
.primary-btn:disabled { opacity: .6; }
.secondary-btn { background: var(--bg); color: var(--text); margin-top: 10px; }

#orderDone { text-align: center; padding-top: 20px; }
.done-icon { font-size: 56px; }
.send-buttons { display: grid; gap: 8px; margin-top: 14px; }
.send-buttons a { display: block; text-decoration: none; border-radius: 12px; padding: 13px; font-weight: 700; color: #fff; }
.send-tg { background: #229ed9; }
.send-sms { background: var(--text); }
.send-call { background: var(--green); }
.send-pay { background: #0b6bcb; }


.call-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 26px; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 520px) {
  .phone-link span { display: none; }
  .products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { border-radius: 16px; padding: 6px 6px 10px; }
  .card-img { font-size: 44px; border-radius: 12px; }
  .card-price { font-size: 17px; }
  .catalog-head h2 { font-size: 22px; }
  .sort-select { padding: 8px 30px 8px 10px; font-size: 13px; }
}
