/* Mi Dulce — phase 1 storefront styles.
   Warm artisanal palette: cream, cocoa, mango amber. Mobile-first. */

:root {
  --cream: #faf5ec;
  --cream-deep: #f3ead9;
  --cocoa: #3d2b1f;
  --cocoa-soft: #6b5445;
  --amber: #d97b29;
  --amber-deep: #b85c14;
  --jam: #a63d2f;
  --leaf: #5c7a4d;
  --card: #ffffff;
  --line: #e5dac5;
  --shadow: 0 10px 30px rgba(61, 43, 31, 0.10);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cocoa);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: var(--amber-deep); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cocoa);
}

.brand img { width: 34px; height: 34px; }

.brand .name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand .name em { color: var(--amber); font-style: normal; }

.site-nav { display: flex; align-items: center; gap: 6px; }

.site-nav a {
  text-decoration: none;
  color: var(--cocoa-soft);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover { background: var(--cream-deep); color: var(--cocoa); }

.site-nav a.nav-order {
  background: var(--amber);
  color: #fff;
}

.site-nav a.nav-order:hover { background: var(--amber-deep); }

/* ---------- hero ---------- */

.hero {
  padding: 48px 0 40px;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(217, 123, 41, 0.14), transparent 60%),
    var(--cream);
}

.hero .container {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  align-items: center;
}

.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-deep);
  margin-bottom: 10px;
}

.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }

.hero p.lead {
  font-size: 1.08rem;
  color: var(--cocoa-soft);
  max-width: 46ch;
  margin: 0 0 22px;
}

.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--amber); color: #fff; box-shadow: 0 6px 18px rgba(217, 123, 41, 0.35); }
.btn-primary:hover { background: var(--amber-deep); }

.btn-outline {
  background: transparent;
  color: var(--cocoa);
  border: 2px solid var(--line);
}
.btn-outline:hover { border-color: var(--amber); color: var(--amber-deep); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- sections ---------- */

.section { padding: 52px 0; }

.section-head { text-align: center; max-width: 60ch; margin: 0 auto 34px; }

.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }

.section-head p { color: var(--cocoa-soft); margin: 0; }

/* ---------- product cards ---------- */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.product-card .photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-deep);
  cursor: zoom-in;
}

.product-card .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card .photo:hover img { transform: scale(1.05); }

.product-card .body { padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.product-card h3 { margin: 0; font-size: 1.35rem; }

.product-card .tagline {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber-deep);
  margin: 0;
}

.product-card .desc { margin: 0; color: var(--cocoa-soft); font-size: 0.95rem; flex: 1; }

.product-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.price small { font-size: 0.8rem; color: var(--cocoa-soft); font-weight: 400; }

/* qty stepper */

.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.stepper button {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cocoa);
  cursor: pointer;
  line-height: 1;
}

.stepper button:hover { background: var(--cream-deep); }

.stepper .qty {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- order form ---------- */

.order-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.97rem;
}

.order-summary-row .line-name { font-weight: 600; }

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 2px 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field .hint { font-weight: 400; color: var(--cocoa-soft); font-size: 0.82rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cocoa);
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s;
}

.field textarea { resize: vertical; min-height: 84px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--amber);
}

.field .error {
  color: var(--jam);
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--jam); }
.field.invalid .error { display: block; }

.form-error {
  display: none;
  background: rgba(166, 61, 47, 0.08);
  border: 1px solid rgba(166, 61, 47, 0.35);
  color: var(--jam);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.form-error.show { display: block; }

/* ---------- confirmation panel ---------- */

.confirmation {
  display: none;
  text-align: center;
}

.confirmation.show { display: block; }

.confirmation .check {
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  border-radius: 50%;
  background: rgba(92, 122, 77, 0.12);
  color: var(--leaf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.order-code-box {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  background: var(--cream);
  border: 2px dashed var(--amber);
  border-radius: var(--radius);
  padding: 18px 10px;
  margin: 18px auto;
  max-width: 380px;
}

.payment-steps {
  text-align: left;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 22px;
  margin: 24px 0;
}

.payment-steps ol { margin: 0; padding-left: 22px; }
.payment-steps li { margin-bottom: 10px; }
.payment-steps li:last-child { margin-bottom: 0; }

.qr-box {
  max-width: 340px;
  margin: 16px auto 4px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.pay-contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--cocoa);
}

.chip:hover { border-color: var(--amber); }

/* ---------- status timeline (lookup) ---------- */

.timeline {
  display: flex;
  gap: 0;
  margin: 26px 0 10px;
}

.timeline .step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-top: 34px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cocoa-soft);
}

.timeline .step::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line);
}

.timeline .step:first-child::before { left: 50%; }
.timeline .step:last-child::before { right: 50%; }

.timeline .step::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--line);
}

.timeline .step.done { color: var(--leaf); }
.timeline .step.done::before { background: var(--leaf); }
.timeline .step.done::after { border-color: var(--leaf); background: var(--leaf); }

.timeline .step.current { color: var(--amber-deep); }
.timeline .step.current::after { border-color: var(--amber); box-shadow: 0 0 0 5px rgba(217, 123, 41, 0.2); }

.status-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-placed   { background: rgba(217, 123, 41, 0.12); color: var(--amber-deep); }
.status-confirmed{ background: rgba(92, 122, 77, 0.14); color: var(--leaf); }
.status-shipped  { background: rgba(61, 43, 31, 0.10); color: var(--cocoa); }
.status-cancelled{ background: rgba(166, 61, 47, 0.12); color: var(--jam); }

/* ---------- about / info ---------- */

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-card h3 { font-size: 1.15rem; }

.info-card ul { padding-left: 20px; margin: 0; color: var(--cocoa-soft); }

/* ---------- admin ---------- */

.admin-gate { max-width: 460px; margin: 40px auto; }

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.stat-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.stat-chip strong { font-family: var(--font-display); font-size: 1.25rem; display: block; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

table.orders { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 760px; }

table.orders th, table.orders td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }

table.orders th {
  background: var(--cream);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cocoa-soft);
}

table.orders tr:last-child td { border-bottom: none; }

table.orders select {
  font-size: 0.88rem;
  padding: 7px 10px;
  border-radius: 9px;
  border: 2px solid var(--line);
  font-family: var(--font-body);
  color: var(--cocoa);
}

.code-cell { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.1em; }

.muted { color: var(--cocoa-soft); font-size: 0.85rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 40px;
  margin-top: 40px;
  text-align: center;
  color: var(--cocoa-soft);
  font-size: 0.9rem;
}

.site-footer .socials { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- lightbox ---------- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(40, 28, 18, 0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(92vw, 720px);
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* ---------- responsive ---------- */

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .hero { padding: 72px 0 64px; }
  .hero .container { grid-template-columns: 1.05fr 0.95fr; gap: 48px; }
  .section { padding: 72px 0; }
}
