/* ===== Ranglar va o‘lchamlar ===== */
:root {
  --cream: #F6EDE0;
  --cream-2: #EFE2CE;
  --white: #FFFDF9;
  --brown: #5B3A24;
  --brown-2: #7A5134;
  --brown-dark: #2E1D12;
  --text: #2E1D12;
  --muted: #6F5A49;
  --line: #E4D4BE;
  --accent: #C0782F;
  --ok: #3F7D4E;
  --err: #B3412C;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(46, 29, 18, .06), 0 8px 24px rgba(46, 29, 18, .08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 72px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brown); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.eyebrow--light { color: #F3C998; }

/* ===== Tugmalar ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brown); color: var(--white); }
.btn--outline { border-color: var(--brown); color: var(--brown); background: transparent; }
.btn--light { background: var(--white); color: var(--brown-dark); }
.btn--ghost-light { border-color: rgba(255,255,255,.7); color: #fff; background: rgba(255,255,255,.06); backdrop-filter: blur(4px); }
.btn--text { background: none; border: 0; color: var(--muted); min-height: 40px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--brown-dark); }
  .btn--outline:hover { background: var(--brown); color: var(--white); }
  .btn--light:hover { background: var(--cream); }
  .btn--ghost-light:hover { background: rgba(255,255,255,.18); }
}

.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream); display: grid; place-items: center; font-size: 1rem; }

/* ===== Bosh qism ===== */
.header {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--header-h);
  background: rgba(255, 253, 249, .92); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px rgba(46, 29, 18, .06); }
.header__row { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; color: var(--brown); }
.logo img { border-radius: 10px; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--brown); }
.nav__phone { display: none; }
.header__actions { display: flex; align-items: center; gap: 16px; }
.header__phone { font-weight: 700; text-decoration: none; color: var(--brown); white-space: nowrap; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .78rem; line-height: 22px; text-align: center;
}
.cart-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.35); } }

.burger { display: none; width: 44px; height: 44px; border: 0; background: var(--cream); border-radius: 12px; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--brown); border-radius: 2px; transition: transform .3s var(--ease); }
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ===== Banner ===== */
.hero {
  position: relative; min-height: min(92svh, 820px); display: flex; align-items: flex-end;
  color: #fff; overflow: hidden; background: var(--brown-dark);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: heroZoom 1.6s var(--ease) both; }
@keyframes heroZoom { from { transform: scale(1.06); opacity: .4; } }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(46,29,18,.25) 0%, rgba(46,29,18,.15) 35%, rgba(46,29,18,.85) 100%); }
.hero__content { position: relative; padding-top: calc(var(--header-h) + 40px); padding-bottom: clamp(48px, 9vh, 96px); }
.hero h1 { font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.4rem); max-width: 14ch; font-weight: 500; }
.hero__lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); max-width: 46ch; margin-top: 18px; color: rgba(255,255,255,.88); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__content > * { animation: rise .9s var(--ease) both; }
.hero__content > :nth-child(2) { animation-delay: .08s; }
.hero__content > :nth-child(3) { animation-delay: .16s; }
.hero__content > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ===== Bo‘limlar ===== */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--cream { background: var(--cream); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white);
  font-weight: 600; color: var(--muted); transition: all .2s var(--ease);
}
.tab:hover { border-color: var(--brown-2); color: var(--brown); }
.tab[aria-selected="true"] { background: var(--brown); border-color: var(--brown); color: var(--white); }

/* ===== Mahsulot kartalari ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .card:hover .card__img img { transform: scale(1.05); }
}
.card__img { position: relative; aspect-ratio: 4 / 3; background: var(--cream-2); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--white); color: var(--brown); font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 20px; flex: 1; }
.card__desc { color: var(--muted); font-size: .95rem; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--brown-dark); white-space: nowrap; }
.price small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.add-btn { min-height: 44px; padding: 0 16px; font-size: .92rem; }
.add-btn.is-added { background: var(--ok); }

/* ===== Biz haqimizda ===== */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about__media { position: relative; }
.about__media img { border-radius: var(--radius); aspect-ratio: 9 / 11; object-fit: cover; width: 100%; }
.about__stamp {
  position: absolute; right: -14px; bottom: 28px; background: var(--brown); color: var(--cream);
  padding: 16px 20px; border-radius: var(--radius-sm); text-align: center; box-shadow: var(--shadow);
}
.about__stamp strong { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.about__stamp span { font-size: .85rem; }
.about__text > p:not(.eyebrow) { margin-top: 18px; color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.features li { display: flex; gap: 14px; }
.features__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--white); color: var(--brown); display: grid; place-items: center; }
.features p { color: var(--muted); font-size: .93rem; margin-top: 2px; }

/* ===== Aloqa ===== */
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact__card { background: var(--cream); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.contact__card p { color: var(--muted); }
.link { font-weight: 700; color: var(--brown); text-decoration: none; margin-top: auto; }
.link:hover { text-decoration: underline; }
.hours { margin: 0; display: grid; gap: 8px; }
.hours div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.hours dt { color: var(--muted); }
.hours dd { margin: 0; font-weight: 700; }
.contact__links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact__links a { font-weight: 700; color: var(--brown); text-decoration: none; }
.contact__links a:hover { text-decoration: underline; }

.footer { background: var(--brown-dark); color: var(--cream-2); padding: 28px 0; font-size: .92rem; }
.footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { text-decoration: none; }

/* ===== Savat (drawer) ===== */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(46, 29, 18, .45); opacity: 0; transition: opacity .3s; }
.overlay.is-open { opacity: 1; }
.drawer {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--white); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s var(--ease); visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 1.5rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 22px; overscroll-behavior: contain; }
.drawer__foot { padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
.drawer__actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 14px; }
.drawer__actions:has(> :only-child) { grid-template-columns: 1fr; }
.drawer__actions--col { grid-template-columns: 1fr; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.total strong { font-size: 1.4rem; }

.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; animation: cardIn .3s var(--ease) both; }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.cart-item__name { font-weight: 700; line-height: 1.3; }
.cart-item__price { color: var(--muted); font-size: .88rem; }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item__sum { font-weight: 800; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; margin-top: 6px; }
.qty button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.15rem; font-weight: 700; color: var(--brown); border-radius: 50%; }
.qty button:hover { background: var(--cream); }
.qty output { min-width: 26px; text-align: center; font-weight: 700; }
.remove { border: 0; background: none; color: var(--muted); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
.remove:hover { color: var(--err); }
.cart-empty { text-align: center; padding: 48px 0; color: var(--muted); display: grid; gap: 18px; justify-items: center; }

.order-form { display: grid; gap: 16px; align-content: start; }
.order-form label { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; }
.order-form small { color: var(--muted); font-weight: 500; }
.order-form input, .order-form textarea, .order-text {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .2s;
}
.order-form input:focus, .order-form textarea:focus { outline: none; border-color: var(--brown-2); }
.order-form [aria-invalid="true"] { border-color: var(--err); }
.seg { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg legend { font-weight: 600; font-size: .93rem; margin-bottom: 6px; padding: 0; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-height: 46px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; transition: all .2s; cursor: pointer; }
.seg input:checked + span { border-color: var(--brown); background: var(--cream); color: var(--brown); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.form-error { color: var(--err); font-weight: 600; font-size: .93rem; }

.steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; color: var(--muted); }
.steps li::marker { color: var(--accent); font-weight: 800; }
.order-text { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.5; background: var(--cream); resize: none; }

/* Mobil savat paneli */
.cart-bar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 12px; padding: 0 20px; min-height: 56px;
  border: 0; border-radius: 999px; background: var(--brown); color: var(--white); box-shadow: 0 10px 30px rgba(46,29,18,.3);
  animation: rise .4s var(--ease) both;
}
.cart-bar strong { margin-left: auto; }
.cart-bar__go { font-weight: 700; opacity: .85; }

.toast {
  position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--brown-dark); color: var(--white); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Scroll bo‘yicha paydo bo‘lish */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

body.lock { overflow: hidden; }

/* ===== Moslashuvchanlik ===== */
@media (max-width: 1024px) {
  .header__phone { display: none; }
  .contact { grid-template-columns: 1fr 1fr; }
  .contact__card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .burger { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 8px 20px 20px;
    background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px rgba(46,29,18,.08);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .3s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .nav__phone { display: block; color: var(--brown) !important; border: 0 !important; }
  .header__actions { margin-left: auto; gap: 10px; }
  .about { grid-template-columns: 1fr; }
  .about__media { max-width: 520px; }
  .about__media img { aspect-ratio: 4 / 3; }
  .about__stamp { right: 14px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card__body { padding: 12px 12px 14px; }
  .card h3 { font-size: 1.02rem; }
  .card__desc { display: none; }
  .card__foot { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 8px; }
  .price { font-size: 1.02rem; }
  .add-btn { width: 100%; padding: 0 10px; }
  .badge { top: 8px; left: 8px; font-size: .7rem; }
  .features { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
  .hide-xs { display: none; }
  .cart-bar:not([hidden]) { display: flex; }
  body.has-cart .footer { padding-bottom: 96px; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .card__desc { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 640px) { body.has-cart .toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
