/* ==========================================================================
   FONTS
   ========================================================================== */
@font-face {
  font-family: 'Wangi';
  src: url('../assets/fonts/Wangi.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inclusive Sans';
  src: url('../assets/fonts/InclusiveSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
  --primary: #D1E535;
  --accent: #2C3522;
  --surface: #D8C5E4;
  --muted: #EDE6DC;
  --text: #1B2317;
  --text-muted: #5C6556;
  --border: #D2CAB8;
  
  --font-brand: 'Wangi', serif;
  --font-body: 'Inclusive Sans', system-ui, sans-serif;

  --radius: 20px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(28,35,22,0.1);
  
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(80px + var(--safe-bottom));
  overflow-x: hidden;
}

b, strong, .fw-bold {
  font-family: var(--font-body);
  font-weight: 700;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(216, 197, 228, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  padding-top: calc(16px + var(--safe-top));
}
.logo {
  font-family: var(--font-brand);
  font-size: 32px;
  color: #2C3522;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.acts { display: flex; gap: 8px; }
.ib {
  position: relative;
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}
.ib:active { background: var(--border); }
.ib b { font-size: 15px; font-weight: 700; color: #2C3522; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  margin: 20px;
  border-radius: 28px;
  overflow: hidden;
  background: #2C3522;
  color: #FFFFFF;
  display: grid;
  grid-template-columns: 1fr;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.hero-t {
  position: relative;
  z-index: 2;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(32px, 7vw, 50px);
  line-height: 1.1;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1px; 
}

.hero p {
  margin: 0 0 30px;
  font-size: 16px;
  color: #B5BCAE;
  max-width: 420px;
}

.hero-img-container {
  position: relative;
  min-height: 340px;
  background: #EDE6DC;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  width: fit-content;
}
.btn:active { transform: scale(0.97); }
.btn.y { background: #D1E535; color: #1B2317; }
.btn.o { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.r { background: #2C3522; color: #FFFFFF; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ==========================================================================
   SECTIONS & CATALOG
   ========================================================================== */
.sec { padding: 32px 20px; max-width: 1100px; margin: 0 auto; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sec h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--text);
}

input[type=search], .fld input, .fld select, .fld textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  transition: border-color 0.2s;
}
input[type=search]:focus, .fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none;
  border-color: #2C3522;
}
input::placeholder { color: var(--text-muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0; scrollbar-width: none; -ms-overflow-style: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.chip.on { background: #2C3522; color: #fff; border-color: #2C3522; }

/* ==========================================================================
   CARDS
   ========================================================================== */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.ph0 { aspect-ratio: 4/3; background: #D8D0C5; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; position: relative; }
.ph0 img { width: 100%; height: 100%; object-fit: cover; }
.cb { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cb h3 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.cb p { margin: 0; color: var(--text-muted); font-size: 15px; }
.price { font-family: var(--font-body); font-weight: 700; font-size: 24px; color: #2C3522; display: flex; align-items: baseline; gap: 4px; }
.price small { font-family: var(--font-body); font-size: 14px; color: var(--text-muted); font-weight: 400; }
.fav { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 4px; transition: color 0.2s; }
.fav.on { color: #D1E535; }
.fav.on svg { fill: currentColor; }

/* ==========================================================================
   QUANTITY SELECTOR
   ========================================================================== */
.opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 15px;
  color: var(--text-muted);
}
.st { display: flex; align-items: center; gap: 8px; background: #E3DCD3; border-radius: var(--radius-sm); padding: 4px; }
.st button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  transition: background 0.2s;
}
.st button:active { background: var(--border); }
.st button[disabled] { opacity: 0.3; cursor: not-allowed; }
.st span { min-width: 50px; text-align: center; font-weight: 700; color: var(--text); font-size: 15px; }
.tag { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ==========================================================================
   INFO
   ========================================================================== */
.info { display: grid; grid-template-columns: 1fr; gap: 16px; }
.info div { background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.info h3 { margin: 0 0 8px; font-family: var(--font-body); font-weight: 700; font-size: 18px; color: #2C3522; }
.info p { margin: 0; font-size: 15px; color: var(--text-muted); }

/* ==========================================================================
   BOTTOM NAV
   ========================================================================== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(216, 197, 228, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.2);
  display: flex;
  padding: 8px 16px calc(8px + var(--safe-bottom));
  gap: 8px;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  position: relative;
}
.bn-item svg { width: 24px; height: 24px; }
.bn-item.on { color: #2C3522; }
.bn-item.bn-cart { color: var(--text); background: #EDE6DC; }
.bn-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 24px);
  background: #2C3522;
  color: #D1E535;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.ov {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(44,53,34,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.ov[hidden] { display: none; }
.panel {
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--muted);
  border-radius: 28px 28px 0 0;
  padding: 24px 24px calc(24px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.ph h2 { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 24px; color: var(--text); }

/* ==========================================================================
   CHECKOUT ROWS
   ========================================================================== */
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; color: var(--text); }
.row:last-child { border-bottom: none; }
.row b { color: #2C3522; }

.fld { display: block; margin-top: 18px; font-weight: 600; font-size: 14px; color: var(--text-muted); }
.fld input, .fld select, .fld textarea { margin-top: 6px; font-weight: 400; font-size: 16px; background: #FFFFFF; }

.seg { display: flex; gap: 8px; margin: 16px 0; background: #E3DCD3; padding: 4px; border-radius: var(--radius-sm); }
.seg button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.seg button.on { background: #2C3522; color: #fff; }

.box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
  background: #FFFFFF;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.box b { color: var(--text); }

.tot { margin-top: 16px; background: #FFFFFF; border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--border); }
.tot .row { border: none; padding: 6px 0; }
.tot .row.t { font-size: 20px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.tot .row.t b { font-family: var(--font-body); font-weight: 700; font-size: 26px; color: #2C3522; }

.err { color: #D15228; min-height: 24px; font-weight: 600; font-size: 14px; margin-top: 12px; }
.nav { display: flex; gap: 10px; margin-top: 20px; }
.nav .btn { flex: 1; }
.steps { color: var(--text-muted); margin: 0 0 16px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: #2C3522;
  color: #D1E535;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 200;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 480px;
  }
  .hero-t {
    padding: 60px;
  }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .info { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .info { grid-template-columns: repeat(3, 1fr); }
}
