/* ==================================================================
   PALUBA — Coastal Editorial
   ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* base — землистая, тёплая, выгоревшая */
  --paper:        #F4ECDC;
  --canvas:       #EBE0CB;
  --ink:          #1B1410;
  --ink-soft:     #5C4D3F;
  --rule:         #D4C5A8;

  /* акценты */
  --terracotta:   #B85134;
  --terracotta-d: #963F26;
  --sea:          #4A6B6F;
  --saffron:      #D9914A;
  --olive:        #7A8159;
  --rust:         #9B3F2D;

  /* семантика */
  --success: var(--olive);
  --danger:  var(--rust);
  --warning: var(--saffron);

  /* типографика */
  --serif:  'Fraunces', 'Times New Roman', serif;
  --sans:   'Manrope', system-ui, sans-serif;

  /* размеры */
  --topbar-h: 60px;
  --chips-h: 52px;
  --r: 4px;            /* минимальное скругление */
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01' 1, 'tnum' 1;
}

body {
  min-height: 100vh;
  position: relative;
}

/* зернистая плёночная текстура — едва заметная */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

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

/* ============= TYPOGRAPHY ============= */

.serif { font-family: var(--serif); font-weight: 400; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.tnum { font-feature-settings: 'tnum' 1, 'lnum' 1; }

/* ============= TOP BAR ============= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--paper);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--rule);
}
.topbar .brand {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.01em;
  font-style: italic;
}
.topbar .brand .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--terracotta);
  border-radius: 50%;
  margin: 0 0 6px 4px;
  vertical-align: middle;
}
.topbar .point {
  margin-left: auto;
  margin-right: 56px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .point::before {
  content: '';
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}

/* ============= CHIPS / NAV ============= */

.chips {
  position: sticky;
  top: var(--topbar-h);
  z-index: 25;
  height: var(--chips-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}
.chips::-webkit-scrollbar { display: none; }
.chips-inner {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 22px;
  gap: 28px;
}
.chip {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .25s;
  background: none;
  border: none;
}
.chip::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 4px;
  height: 1.5px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}
.chip.active {
  color: var(--ink);
}
.chip.active::after { transform: scaleX(1); }

/* ============= LAYOUT ============= */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section {
  padding: 56px 0 16px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 0 22px 28px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  font-style: italic;
}
.section-head .num {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.section-empty {
  padding: 0 22px 24px;
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}

/* ============= GRID & CARDS ============= */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
  padding: 0 22px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 36px 24px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 48px 32px; } }

.card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.card .img-wrap {
  aspect-ratio: 1/1;
  position: relative;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card .img-wrap::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 70%;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(27,20,16,.18), transparent 70%);
  transform: translateX(-50%);
  z-index: 0;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  transform: scale(1.18);
  transition: transform .4s ease;
}
.card:active img { transform: scale(1.13); }

.card .badge {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  font-weight: 500;
  background: var(--terracotta);
  color: var(--paper);
  padding: 3px 10px 4px;
  letter-spacing: 0.02em;
}

.card .name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

.card .price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.card .price {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.card .price-old {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.card .qty {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}
.card .qty button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  transition: background .15s, color .15s;
}
.card .qty button:active { background: var(--ink); color: var(--paper); }
.card .qty .n { min-width: 14px; text-align: center; }

/* ============= BUTTONS ============= */

.btn {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 18px 24px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  transition: background .15s, transform .12s;
}
.btn:active { transform: scale(.985); }
.btn:disabled {
  background: var(--rule);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.btn-cta {
  background: var(--terracotta);
  color: var(--paper);
}
.btn-cta:active { background: var(--terracotta-d); }
.btn-cta:disabled { background: var(--rule); color: var(--ink-soft); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

/* ============= GLOBAL CART CIRCLE ============= */

.cart-orb {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: 22px;
  z-index: 35;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .12s;
}
.cart-orb:active { background: var(--ink); color: var(--paper); transform: scale(.94); }
.cart-orb svg { width: 18px; height: 18px; }
.cart-orb .badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  background: var(--terracotta);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}

/* on dish page header is overlaid, push orb to align with .back */
body.has-overlay .cart-orb {
  top: max(18px, env(safe-area-inset-top, 18px));
  width: 38px; height: 38px;
}

/* ============= FAB CART ============= */

.fab {
  position: fixed;
  left: 22px; right: 22px;
  bottom: max(20px, env(safe-area-inset-bottom, 16px));
  z-index: 40;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  padding: 16px 22px;
  border-radius: var(--r);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(27,20,16,.22);
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .25s, background .25s;
}
.fab.hidden { transform: translateY(160%); opacity: 0; pointer-events: none; }
.fab.ready { background: var(--terracotta); }
.fab.ready:active { background: var(--terracotta-d); }
.fab .progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: rgba(255,255,255,.10);
  transition: width .4s ease;
}
.fab .label { position: relative; flex: 1; text-align: left; }
.fab .total { position: relative; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.fab .arrow { position: relative; margin-left: 14px; opacity: .85; }

/* ============= BLOCK SCREEN ============= */

.block-screen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
}
.block-screen .ico {
  width: 64px; height: 64px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.block-screen h1 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.05;
}
.block-screen p {
  color: var(--ink-soft);
  max-width: 320px;
  font-size: 15px;
  line-height: 1.45;
}

/* ============= MODAL (askPhone, confirm, info) ============= */

.pl-backdrop {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(27,20,16,.55);
  display: flex;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: pl-fade .2s;
}
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
.pl-modal {
  background: var(--paper);
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 28px;
  border-radius: var(--r);
  border: 1px solid var(--rule);
  animation: pl-pop .35s cubic-bezier(.2,.9,.3,1.4);
  position: relative;
}
@keyframes pl-pop {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.pl-modal h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.1;
}
.pl-modal p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.pl-modal input {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color .2s;
}
.pl-modal input:focus { border-bottom-color: var(--terracotta); }
.pl-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}
.pl-modal .actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.pl-modal .actions .btn {
  font-size: 14px;
  padding: 14px 20px;
}

/* ============= SHARED HEAD (cart/checkout/order) ============= */

.page-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  display: flex;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  gap: 14px;
}
.page-head .back {
  width: 36px; height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.page-head .back:active { background: var(--ink); color: var(--paper); }
.page-head h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.015em;
  flex: 1;
}
.page-head .meta {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.loader {
  padding: 80px 22px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}
.error-line {
  background: rgba(155,63,45,.08);
  color: var(--rust);
  padding: 14px 22px;
  font-size: 14px;
  border-left: 2px solid var(--rust);
}
