/* ==========================================================================
   Daisy and Petals - core stylesheet
   ========================================================================== */

:root {
  --bg: #faf0f5;
  --surface: #ffffff;
  --text: #2d1b2e;
  --muted: #8b5a7a;
  --line: #e0d5e5;
  --accent: #d94a6e;
  --accent-dark: #b43f61;
  --danger: #e06c75;
  --success: #4a90e2;
  --radius: 20px;
  --shadow: 0 2px 8px rgba(16, 16, 32, 0.08), 0 12px 24px rgba(16, 16, 32, 0.12);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 36px;
  height: 36px;
  background: url('../logo.svg') center/contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(255, 107, 107, 0.35));
}

.header__spacer { flex: 1; }

.header__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 9px;
}
.header__link:hover { color: var(--text); background: #f0f0f6; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #f3f3f9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn--danger { color: var(--danger); border-color: #f5c6c2; }
.btn--danger:hover { background: #fdf3f2; }

.btn--block { width: 100%; }

.btn--cart {
  position: relative;
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  padding: 10px 14px;
}
.btn--cart:hover { background: #2c2c38; }

.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- Hero ---------- */

.hero { padding: 42px 0 10px; }
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.hero p { color: var(--muted); margin: 0; font-size: 16px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 26px 0 20px;
}

.toolbar input[type="search"] {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
}
.toolbar input[type="search"]:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(109, 40, 217, .35);
  outline-offset: 1px;
  border-color: var(--accent);
}

.result-count { color: var(--muted); font-size: 14px; }

/* ---------- Product grid ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(16,16,32,.10); }

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0f0f5;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(221, 44, 63, 0.9);
  color: #fff;
}
.card__badge--out { background: #e06c75; }
.card__badge--low { background: #ff7849; }

.card__body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.card__name { font-size: 15px; font-weight: 650; margin: 0; }

.card__desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__price { font-size: 17px; font-weight: 700; margin: 4px 0 0; }

.card__stock { font-size: 12.5px; color: var(--muted); margin: 0; }
.card__stock.is-low { color: #b45309; font-weight: 600; }
.card__stock.is-out { color: var(--danger); font-weight: 600; }

.card__actions { margin-top: auto; padding-top: 12px; }

/* ---------- Empty state ---------- */

.empty {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  background: #fff0f7;
  margin-bottom: 60px;
}
.empty h2 { margin: 0 0 6px; color: var(--text); font-size: 19px; }
.empty p { margin: 0 0 18px; }

/* ---------- Cart drawer ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,16,28,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 90;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.cart {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(410px, 100%);
  background: var(--surface);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(16,16,32,.14);
}
.cart.is-open { transform: translateX(0); }

.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.cart__head h2 { margin: 0; font-size: 17px; }

.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}
.icon-btn:hover { background: #f3f3f9; color: var(--text); }

.cart__items { flex: 1; overflow-y: auto; padding: 6px 20px; }

.cart__empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 10px;
  font-size: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.cart-item:last-child { border-bottom: none; }

.cart-item__media {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f0f5;
}
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; }

.cart-item__name { font-size: 14px; font-weight: 650; margin: 0 0 2px; }
.cart-item__unit { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.cart-item__line { font-size: 14px; font-weight: 700; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.qty button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}
.qty button:hover { background: #f0f0f6; }
.qty span { min-width: 30px; text-align: center; font-size: 13.5px; font-weight: 650; }

.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.link-btn {
  border: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.link-btn:hover { color: var(--danger); }

.cart__foot { border-top: 1px solid var(--line); padding: 18px 20px 22px; background: #fbfbfe; }

.cart__row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--muted);
}
.cart__row--total {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0 16px;
}

/* ---------- Customer details in the cart ---------- */

.cart__fields { margin-bottom: 16px; }

.cart__fields label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}

.cart__fields input,
.cart__fields textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}

.cart__fields textarea { resize: vertical; min-height: 60px; }

.cart__fields input:focus,
.cart__fields textarea:focus { outline: 2px solid rgba(109, 40, 217, .35); }

#whatsappBtn { margin-top: 10px; }

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #16161d;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(16,16,32,.28);
  animation: toast-in .2s ease;
}
.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.page-head { padding: 38px 0 6px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 26px;
  align-items: start;
  padding: 26px 0 70px;
}

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel h2 { margin: 0 0 16px; font-size: 16px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px; }

.field input[type="text"],
.field input[type="number"],
.field input[type="file"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 74px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  background: #fbfbfe;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: #f6f2ff; }
.dropzone p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.dropzone strong { font-size: 14px; }

.preview {
  margin-top: 12px;
  display: none;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.preview.is-visible { display: flex; }
.preview img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 9px;
  background: #f0f0f5;
}
.preview__meta { font-size: 12.5px; color: var(--muted); }

.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-actions .btn { flex: 1; }

.admin-list { display: flex; flex-direction: column; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: none; }

.admin-row img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f0f5;
  flex: none;
}
.admin-row__info { flex: 1; min-width: 0; }
.admin-row__name { font-size: 14.5px; font-weight: 650; margin: 0 0 2px; }
.admin-row__meta { font-size: 12.5px; color: var(--muted); margin: 0; }
.admin-row__actions { display: flex; gap: 8px; flex: none; }

.thumb-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.thumb-strip img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }