/* Storefront styles for shop.tomchad.net's home page.
   Standalone: does not use the main site's style.css. */

:root {
  --brand: #1d4ed8;
  --brand-dark: #173ea8;
  --sale: #d92d20;
  --ink: #16181d;
  --muted: #5f6672;
  --line: #e3e6eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --star: #f5a623;
  --sun: #ffe27a;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { 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);
  line-height: 1.45;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #f5a623;
  outline-offset: 2px;
}

[hidden] { display: none !important; }

/* ---------- Announcement strip ---------- */
.promo {
  padding: 0.45rem 1rem;
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--brand);
  color: #fff;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.search {
  display: flex;
  flex: 1 1 320px;
  max-width: 600px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.search input::placeholder { color: #7b8190; }

.search button {
  padding: 0 1.1rem;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: #f5a623;
  color: #1b1b1b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search button:hover { background: #ffb941; }

.cart {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.cart:hover { background: var(--brand-dark); }

.cart-count {
  min-width: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 700px) {
  .search { order: 3; flex-basis: 100%; max-width: none; }
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  max-width: 1240px;
  margin: 1.25rem auto 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--sun);
  border-radius: 10px;
  width: calc(100% - 2.5rem);
}

.hero-text { flex: 1 1 320px; }

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero p { margin: 0 0 1.25rem; max-width: 34rem; font-size: 1.1rem; }

.hero .cta {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.hero .cta:hover { background: var(--brand-dark); }

.hero img {
  display: block;
  width: min(100%, 240px);
  height: auto;
  border-radius: 10px;
  border: 4px solid #fff;
}

/* ---------- Product grid ---------- */
.shelf {
  width: calc(100% - 2.5rem);
  max-width: 1240px;
  margin: 2rem auto 0;
}

.shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
}

.shelf-head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.shelf-head p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover,
.card:focus-visible {
  border-color: #c3c9d4;
  box-shadow: 0 8px 22px -10px rgba(20, 30, 60, 0.35);
}

.thumb { position: relative; background: #eceef2; }

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--sale);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.8rem 0.9rem 1rem;
}

.body h3 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }

.stars { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--star); }
.stars .count { color: var(--muted); }

.price { margin: 0.4rem 0 0; font-size: 1.35rem; font-weight: 800; }
.price s { margin-left: 0.3rem; font-size: 0.9rem; font-weight: 400; color: var(--muted); }

.ship { margin: 0.1rem 0 0.8rem; font-size: 0.85rem; color: #1a7f4b; }

.btn {
  margin-top: auto;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.card:hover .btn,
.card:focus-visible .btn { background: var(--brand-dark); }

#none { padding: 2rem 0; color: var(--muted); text-align: center; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1.25rem;
  background: #0f2a6b;
  color: #cdd6f0;
  font-size: 0.9rem;
  text-align: center;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: #fff; }

main { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Inner pages: product + checkout ---------- */
.crumb {
  width: calc(100% - 2.5rem);
  max-width: 1000px;
  margin: 1.25rem auto 0;
  font-size: 0.95rem;
}

.crumb a { color: var(--brand); font-weight: 600; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.wrap {
  width: calc(100% - 2.5rem);
  max-width: 1000px;
  margin: 1rem auto 0;
}

.wrap.narrow { max-width: 640px; }

.panel {
  padding: clamp(1rem, 3vw, 1.75rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.panel + .panel { margin-top: 1rem; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
}

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

.product-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eceef2;
}

.product-info h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.tagline { margin: 0.35rem 0 0; color: var(--muted); }
.product-info .stars { margin-top: 0.6rem; }

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.75rem;
  margin: 0.9rem 0 0;
}

.price-big { font-size: 2.2rem; font-weight: 800; }
.price-old { color: var(--muted); text-decoration: line-through; }
.price-off { color: var(--sale); font-weight: 800; }

.ship-note { margin: 0.25rem 0 0; color: #1a7f4b; font-weight: 600; }

.features { margin: 1rem 0 0; padding-left: 1.2rem; color: #3a404a; }
.features li { margin-bottom: 0.4rem; }

.buyrow { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }

.buyrow select {
  padding: 0.7rem 0.8rem;
  border: 1px solid #c3c9d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

select:focus-visible { outline: 3px solid #f5a623; outline-offset: 2px; }

.buy {
  padding: 0.75rem 2rem;
  border: 0;
  border-radius: 6px;
  background: #f5a623;
  color: #1b1b1b;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.buy:hover { background: #ffb941; }

.reviews h2 { margin: 0 0 0.5rem; font-size: 1.4rem; font-weight: 800; }
.review { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.review p { margin: 0; }
.review .who { margin-top: 0.2rem; color: var(--muted); font-size: 0.9rem; }

.fine { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; }

.page-title { margin: 0 0 0.25rem; font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; }
.lead { margin: 0 0 1rem; color: var(--muted); }

.summary h2,
.pay h2 { margin: 0 0 0.5rem; font-size: 1.25rem; font-weight: 800; }

.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.sum-row:last-child { border-bottom: 0; font-weight: 800; font-size: 1.1rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.85rem; }
.field label { font-size: 0.9rem; font-weight: 600; }

.field input {
  padding: 0.65rem 0.75rem;
  border: 1px solid #c3c9d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.field input::placeholder { color: #8a909d; }

.field-row { display: flex; gap: 0.8rem; }
.field-row .field { flex: 1; min-width: 0; }

.pay .buy { width: 100%; margin-top: 1.25rem; }

#result { min-height: 1.5em; margin: 1rem 0 0; font-weight: 700; }

/* ---------- Saved payment methods (checkout) ---------- */
.saved { margin: 0; padding: 0; border: 0; min-width: 0; }
.saved legend { padding: 0; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; }

.saved-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #c3c9d4;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.saved-option + .saved-option { margin-top: 0.6rem; }
.saved-option:hover { border-color: var(--brand); }

.saved-option:has(input:checked) {
  border-color: var(--brand);
  background: #eef3ff;
  box-shadow: 0 0 0 1px var(--brand);
}

.saved-option:has(input:focus-visible) { outline: 3px solid #f5a623; outline-offset: 2px; }

.saved-option input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--brand);
}

.saved-text { display: flex; flex-direction: column; gap: 0.1rem; }
.saved-text span { color: var(--muted); font-size: 0.9rem; }

.field input[readonly] { cursor: default; }
