/* Barangari Lab storefront */
:root {
  --bg: #faf8f5;
  --bg-alt: #f0ebe3;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --line: #e7e0d6;
  --accent: #9a3412;
  --accent-dark: #7c2d12;
  --cream: #fffdf9;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(28, 25, 23, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.875rem; }

/* Header */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}
.logo img { height: 42px; width: auto; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.search-box {
  display: none;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}
.search-box input {
  border: 0;
  background: transparent;
  outline: none;
  width: 180px;
  font: inherit;
}
.nav-bar {
  background: var(--ink);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
}
.nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav a {
  color: #e7e5e4;
  padding: 0.7rem 0.9rem;
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a:hover, .nav a.active { color: #fff; }
.cart-link {
  color: #fff !important;
  font-weight: 600;
  white-space: nowrap;
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid #44403c;
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
  background: #1c1917;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem 1rem;
  max-width: 720px;
}
.hero h1 { color: #fff; margin-bottom: 0.75rem; }
.hero p { color: #e7e5e4; font-size: 1.08rem; margin-bottom: 1.5rem; }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  text-align: center;
}
.section-head p { font-size: 1.05rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.feature-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.feature-card h3 { margin-bottom: 0.5rem; color: var(--ink); }
.feature-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffedd5;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.cat-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.cat-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.cat-card .body { padding: 1rem 1.1rem 1.2rem; }
.cat-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.cat-card h3 a { color: var(--ink); border-bottom: 2px solid var(--accent); }
.cat-card p { font-size: 0.92rem; margin: 0; }

.story {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.story img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.product-card img {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  background: var(--bg-alt);
}
.product-card .body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.product-card h3 {
  font-size: 1rem;
  margin: 0;
  font-family: var(--font);
  font-weight: 650;
}
.product-card h3 a { color: var(--ink); }
.price {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
}
.product-card .actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem 0 3.5rem;
}
.product-detail .gallery {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream);
}
.product-detail .gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.product-meta .price { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
.qty-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.qty-row input {
  width: 70px;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.breadcrumb {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 1.25rem 0 0;
}
.breadcrumb a { color: var(--ink-soft); }

/* Page hero small */
.page-hero {
  background: linear-gradient(135deg, #1c1917, #44403c);
  color: #fff;
  padding: 2.75rem 0;
}
.page-hero h1 { color: #fff; margin: 0; }
.page-hero p { color: #d6d3d1; margin: 0.5rem 0 0; }

/* Cart */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.cart-table th, .cart-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cart-table th {
  background: var(--bg-alt);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cart-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.cart-summary {
  margin-top: 1.5rem;
  max-width: 360px;
  margin-left: auto;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

/* Forms */
.form {
  display: grid;
  gap: 0.9rem;
  max-width: 520px;
}
.form label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.3rem; color: var(--ink); }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}
.form textarea { min-height: 120px; resize: vertical; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}
.info-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.info-card dt { font-weight: 700; color: var(--ink); margin-top: 0.85rem; }
.info-card dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* Prose */
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.75rem; }
.prose ul { color: var(--ink-soft); padding-left: 1.2rem; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #d6d3d1;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}
.site-footer a { color: #d6d3d1; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.footer-bottom {
  border-top: 1px solid #44403c;
  padding-top: 1.25rem;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--ink);
  color: #fff;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: 0.25s ease;
  z-index: 100;
}
.toast.show { transform: none; opacity: 1; }

@media (min-width: 768px) {
  .search-box { display: flex; }
}
@media (max-width: 900px) {
  .feature-grid, .story, .product-detail, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; padding: 0.5rem 0; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
  }
  .nav.open { display: flex; }
  .cart-link { margin-left: auto; }
  .cart-table thead { display: none; }
  .cart-table tr { display: block; border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
  .cart-table td { display: block; border: 0; padding: 0.35rem 1rem; }
}


/* Checkout */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.75rem;
  align-items: start;
}
.checkout-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.checkout-card h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  font-family: var(--font);
  font-weight: 700;
}
.checkout-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.checkout-card .form-row.full { grid-template-columns: 1fr; }
.order-line {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.order-line:last-of-type { border-bottom: 0; }
.order-line img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.order-line .meta { flex: 1; min-width: 0; }
.order-line .meta strong { display: block; font-size: 0.92rem; }
.order-line .meta span { color: var(--ink-soft); font-size: 0.85rem; }
.order-totals { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.order-totals .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}
.order-totals .row.total {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--ink);
}
.success-box {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  box-shadow: var(--shadow);
}
.success-box .order-id {
  display: inline-block;
  margin: 0.75rem 0 1.25rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg-alt);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.field-error { color: #b91c1c; font-size: 0.85rem; margin-top: 0.25rem; display: none; }
.field-error.show { display: block; }
input.invalid, textarea.invalid, select.invalid { border-color: #b91c1c; }
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-card .form-row { grid-template-columns: 1fr; }
}

/* Desktop search + nav polish */
@media (min-width: 768px) {
  .search-box { display: flex !important; }
  .menu-toggle { display: none !important; }
  .nav { display: flex !important; }
}
.nav.open { display: flex !important; flex-direction: column; width: 100%; }
@media (max-width: 767px) {
  .menu-toggle { display: inline-block; }
  .nav { display: none; }
  .nav.open { display: flex; }
}
