/* Eevlatte storefront. "Style A" palette from the legacy design (docs/LEGACY-SYSTEM.md §1). */

:root {
  --bg: #fff7f3;
  --surface: #ffffff;
  --ink: #3a2a2e;
  --muted: #8a7479;
  --accent: #e88aa8;
  --accent-dark: #c9617f; /* accent darkened enough for text on white */
  --accent-2: #f5c2c8;
  --soft: #ffe4ec;
  --chip: #fff0e8;
  --danger: #ba2121;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(60, 40, 50, 0.04);
  --shadow-lift: 0 14px 30px rgba(60, 40, 50, 0.12);
  --font: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
h1, h2 { line-height: 1.2; margin: 0 0 0.5rem; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Header and footer ---------------------------------------------------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--soft); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mascot { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.brand-wordmark { height: 30px; width: auto; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-dark); }

.staff-banner {
  background: var(--ink); color: #fff; text-align: center; padding: 8px 16px; font-size: 0.85rem;
}
.staff-banner a { color: var(--accent-2); }

main { flex: 1; padding-block: 2rem 3rem; }

.site-footer {
  background: var(--surface); border-top: 1px solid var(--soft); padding-block: 1.25rem;
  font-size: 0.8rem; color: var(--muted); text-align: center;
}

/* --- Shop listing ---------------------------------------------------------- */

.shop-intro { margin-bottom: 1.5rem; }
.shop-intro p { margin: 0; max-width: 60ch; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--chip);
  color: var(--ink); text-decoration: none; font-size: 0.85rem; border: 1px solid transparent;
}
.pill:hover { border-color: var(--accent-2); }
.pill[aria-current="page"] { background: var(--accent); color: #fff; }

.sort-form { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.sort-form select, .button {
  font: inherit; font-size: 0.85rem; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--accent-2); background: var(--surface); color: var(--ink);
}

.product-grid {
  display: grid; gap: 20px; list-style: none; margin: 0; padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: block; height: 100%; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card-image { position: relative; aspect-ratio: 1; background: var(--soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card.is-sold-out .card-image img { opacity: 0.55; }
.card-body { padding: 12px 14px 16px; }
.card-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 4px; }

.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge {
  padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--surface); color: var(--ink);
}
.badge-new { background: var(--accent); color: #fff; }
.badge-sale { background: var(--ink); color: #fff; }
.badge-sold-out { background: var(--surface); color: var(--danger); }

.price { font-weight: 700; }
.price del { color: var(--muted); font-weight: 400; margin-left: 6px; }

.empty { text-align: center; padding: 3rem 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }

/* --- Product detail ---------------------------------------------------------- */

.breadcrumbs { font-size: 0.8rem; margin-bottom: 1.25rem; }
.breadcrumbs a { color: var(--muted); }

.product-detail { display: grid; gap: 2rem; }
@media (min-width: 820px) { .product-detail { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.gallery-main {
  aspect-ratio: 1; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; list-style: none; padding: 0; }
.gallery-thumbs a {
  display: block; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent;
}
.gallery-thumbs a[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info .price { font-size: 1.4rem; margin: 0.5rem 0 0.75rem; }
.availability { font-size: 0.9rem; margin-bottom: 1.25rem; }
.availability.is-low { color: #b26b00; }
.availability.is-sold-out { color: var(--danger); font-weight: 700; }
.description { margin-bottom: 1.5rem; }
.perks {
  list-style: none; padding: 14px 16px; margin: 0; background: var(--chip); border-radius: var(--radius);
  font-size: 0.85rem; display: grid; gap: 6px;
}

/* --- Buttons and messages ------------------------------------------------------ */

.button-primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
  padding: 10px 20px; cursor: pointer;
}
.button-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button:not(:disabled) { cursor: pointer; }
.link-button {
  font: inherit; font-size: 0.8rem; background: none; border: 0; padding: 0; color: var(--muted);
  text-decoration: underline; cursor: pointer;
}

.messages { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 8px; }
.message { padding: 10px 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.message-success { border-left: 4px solid #3c8d5a; }
.message-warning { border-left: 4px solid #b26b00; }
.message-error { border-left: 4px solid var(--danger); }

.cart-count {
  display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 0.75rem; text-align: center;
}

/* --- Add to cart and cart page --------------------------------------------------- */

.add-to-cart { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; }
.add-to-cart input, .cart-line-qty input {
  font: inherit; width: 4.5em; padding: 8px; border-radius: 8px; border: 1px solid var(--accent-2);
}

.cart-lines { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: 12px; }
.cart-line {
  display: grid; align-items: center; gap: 10px 16px; padding: 12px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  grid-template-columns: 72px 1fr auto;
  grid-template-areas: "image info total" "image qty remove";
}
.cart-line-image { grid-area: image; }
.cart-line-image img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.cart-line-info { grid-area: info; display: grid; font-size: 0.85rem; }
.cart-line-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.cart-line-qty { grid-area: qty; display: flex; gap: 8px; align-items: center; }
.cart-line-total { grid-area: total; font-weight: 700; text-align: right; }
.cart-line form:last-child { grid-area: remove; text-align: right; }
@media (min-width: 720px) {
  .cart-line {
    grid-template-columns: 72px 1fr auto 6em auto;
    grid-template-areas: "image info qty total remove";
  }
}

.cart-summary {
  margin-left: auto; max-width: 360px; padding: 16px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); font-size: 0.85rem;
}
.cart-summary p { margin: 0 0 8px; }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 1rem; }
.cart-summary .button-primary { width: 100%; margin-top: 8px; }

/* --- Order confirmation ------------------------------------------------------------ */

.order-confirmation { max-width: 640px; margin: 0 auto; }
.order-line {
  display: flex; justify-content: space-between; padding: 12px 16px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.order-confirmation .cart-summary { margin: 0 0 1.5rem auto; }
