/* carlol — minimalist storefront */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #F5F2EC;
  --bg-elev: #FBF9F4;
  --ink: #1C1C1A;
  --ink-soft: #6B6860;
  --line: #E3DED4;
  --accent: #B5573A;
  --accent-hover: #9E4A30;
  --radius: 4px;
  --maxw: 1180px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 242, 236, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  transition: color .2s;
}
.nav-links a:hover { color: var(--ink); }
.cart-btn {
  position: relative;
  font-size: 14px; font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s;
}
.cart-btn:hover { border-color: var(--ink); }
.cart-count {
  display: inline-block; min-width: 18px; height: 18px;
  background: var(--accent); color: #fff;
  border-radius: 9px; font-size: 11px; font-weight: 600;
  line-height: 18px; text-align: center;
  margin-left: 6px; padding: 0 5px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}
.hero .eyebrow {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -1.5px;
  max-width: 820px; margin: 0 auto;
}
.hero p {
  max-width: 540px; margin: 28px auto 0;
  color: var(--ink-soft); font-size: 18px;
}

/* ---------- Filter bar ---------- */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 40px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}
.filter-chip {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  transition: all .2s;
}
.filter-chip:hover { border-color: var(--ink); color: var(--ink); }
.filter-chip.active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

/* ---------- Product grid ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  padding-bottom: 96px;
}
.product-card {
  display: flex; flex-direction: column;
  transition: transform .3s ease;
}
.product-card:hover { transform: translateY(-4px); }
.product-image {
  aspect-ratio: 4 / 5;
  background: var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}
.product-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.product-card:hover .product-image img { transform: scale(1.04); }
.product-cat {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500; margin-bottom: 6px;
}
.product-name {
  font-family: var(--serif);
  font-size: 22px; font-weight: 500;
  line-height: 1.2; margin-bottom: 6px;
}
.product-price {
  font-size: 16px; font-weight: 600;
  color: var(--accent); margin-bottom: 10px;
}
.product-desc {
  font-size: 14px; color: var(--ink-soft);
  margin-bottom: 16px; flex: 1;
}
.add-btn {
  width: 100%;
  padding: 12px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: background .2s;
}
.add-btn:hover { background: var(--accent); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  text-align: center;
}
footer .brand { font-size: 22px; margin-bottom: 8px; }
footer p { color: var(--ink-soft); font-size: 13px; }

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 26, 0.4);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  z-index: 90;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(420px, 100%);
  background: var(--bg);
  box-shadow: -8px 0 40px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 100;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}
.cart-head h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.close-btn { font-size: 24px; color: var(--ink-soft); line-height: 1; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 28px; }
.cart-item {
  display: flex; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 72px; height: 90px; object-fit: cover; border-radius: var(--radius);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.cart-item-price { color: var(--accent); font-weight: 600; font-size: 14px; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.remove-btn {
  margin-left: auto; font-size: 12px; color: var(--ink-soft); text-decoration: underline;
}
.cart-empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; }
.cart-foot {
  border-top: 1px solid var(--line);
  padding: 20px 28px 28px;
}
.cart-total {
  display: flex; justify-content: space-between;
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  margin-bottom: 16px;
}
.checkout-btn {
  width: 100%; padding: 14px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: background .2s;
}
.checkout-btn:hover { background: var(--accent-hover); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg);
  padding: 12px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all .3s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Admin styles ---------- */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 40px 28px 80px; }
.admin-wrap h1 { font-family: var(--serif); font-size: 36px; font-weight: 600; margin-bottom: 8px; }
.admin-wrap .sub { color: var(--ink-soft); margin-bottom: 32px; }
.admin-form {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px; font-family: inherit;
  color: var(--ink);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
}
.img-preview {
  margin-top: 8px; width: 80px; height: 100px;
  object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.btn-primary {
  padding: 11px 22px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: background .2s;
}
.btn-primary:hover { background: var(--accent); }
.btn-secondary {
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-export {
  padding: 11px 22px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: background .2s;
}
.btn-export:hover { background: var(--accent-hover); }

.admin-list { margin-top: 16px; }
.admin-item {
  display: flex; gap: 16px; align-items: center;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}
.admin-item img { width: 56px; height: 70px; object-fit: cover; border-radius: var(--radius); }
.admin-item-meta { flex: 1; }
.admin-item-name { font-weight: 600; font-size: 15px; }
.admin-item-sub { font-size: 13px; color: var(--ink-soft); }
.admin-item-actions { display: flex; gap: 8px; }
.icon-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.danger:hover { border-color: var(--accent); color: var(--accent); }

.empty-state {
  text-align: center; padding: 48px;
  background: var(--bg-elev); border: 1px dashed var(--line);
  border-radius: 8px; color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
  .nav-links { display: none; }
  .hero { padding: 64px 0 40px; }
}
@media (max-width: 560px) {
  .products-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
}
