/* Hearthstone storefront — mirrors mgretaildemo.com (Shopify "Dawn"-style).
   Palette/fonts derived from brands/hearthstone/theme.json + the live site:
   foreground #252525, white bg, brown accent #716A56, red sale #DD1D1D. */

:root {
  --color-primary: #1f1f1f;
  --color-accent: #716a56;
  --color-text: #252525;
  --color-background: #ffffff;
  --color-muted: #f5f2ed;
  --color-sale: #dd1d1d;
  --color-border: #e6e2db;
  --color-subtle: #6b6b6b;

  --font-heading: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --page-max: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

main { min-height: 60vh; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.btn--dark { background: var(--color-text); color: #fff; }
.btn--dark:hover { opacity: 0.85; }
.btn--light { background: #fff; color: var(--color-text); }
.btn--light:hover { background: var(--color-muted); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Promo bar (thin, top) ---------- */
.promo-bar {
  background: var(--color-text);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.promo-bar p { margin: 0; padding: 9px 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-logo img { height: 26px; width: auto; }
.site-logo span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
}

.site-nav { flex: 1; }
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 26px;
  justify-content: center;
}
.site-nav__item { position: relative; }
.site-nav__item > a {
  display: inline-block;
  padding: 8px 0;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
}
.site-nav__item > a:hover { border-bottom-color: var(--color-accent); }

/* Dropdown */
.site-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.has-dropdown:hover .site-nav__dropdown,
.has-dropdown:focus-within .site-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.site-nav__dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 0.88rem;
  white-space: nowrap;
}
.site-nav__dropdown li a:hover { background: var(--color-muted); }

.site-header__icons { display: flex; gap: 14px; }
.icon-btn {
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
}

/* ---------- Hero ---------- */
.hero {
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(420px, 60vh, 640px);
  padding: var(--gutter);
}
.hero__content { max-width: 640px; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 0.3em;
}
.hero p {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  margin: 0 0 1.6em;
}

/* ---------- Promo banner (mid-page) ---------- */
.promo-banner {
  background: var(--color-muted);
  text-align: center;
  padding: clamp(28px, 5vw, 56px) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.promo-banner p {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter);
}
.section__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- Collection tiles ---------- */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 24px);
}
.collection-tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
}
.collection-tile__media {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.collection-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.collection-tile:hover .collection-tile__media img { transform: scale(1.05); }
.collection-tile__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

/* ---------- Collection page hero ---------- */
.collection-hero {
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: var(--gutter);
}
.collection-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0;
}

/* ---------- Product grid + cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
}
.product-card { display: block; }
.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--color-muted);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.04); }
.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-sale);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
}
.product-card__title {
  display: block;
  margin: 14px 0 4px;
  font-size: 0.95rem;
  font-weight: 500;
}
.product-card__price {
  display: block;
  font-size: 0.95rem;
  color: var(--color-subtle);
}
.product-card__price s { margin-right: 6px; }
.product-card__price--sale { color: var(--color-sale); font-weight: 600; }

/* ---------- Product detail ---------- */
.product-detail {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) var(--gutter);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.product-detail__media img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--color-muted);
}
.product-detail__info h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.product-detail .price {
  font-size: 1.4rem;
  margin: 0 0 1.2em;
}
.product-detail .price s { color: var(--color-subtle); margin-right: 10px; font-size: 1.1rem; }
.price__current--sale { color: var(--color-sale); }
.product-detail__desc { color: var(--color-subtle); margin-bottom: 2em; max-width: 48ch; }

.empty-state { text-align: center; color: var(--color-subtle); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-muted);
  margin-top: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--color-border);
}
.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 64px);
}
.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-signup p { color: var(--color-subtle); margin: 0 0 16px; max-width: 40ch; }
.footer-signup__form {
  display: flex;
  max-width: 360px;
  border: 1px solid var(--color-text);
  border-radius: var(--radius);
  overflow: hidden;
}
.footer-signup__form input {
  flex: 1;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  background: transparent;
  outline: none;
}
.footer-signup__form button {
  border: 0;
  background: transparent;
  padding: 0 16px;
  font-size: 1.2rem;
  cursor: pointer;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--color-subtle); }
.footer-links a:hover { color: var(--color-text); text-decoration: underline; }

.site-footer__bottom {
  border-top: 1px solid var(--color-border);
  padding: 20px var(--gutter);
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.payment-methods {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.payment-methods li {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-subtle);
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 3px;
  padding: 5px 9px;
}
.copyright { margin: 0; font-size: 0.8rem; color: var(--color-subtle); }

/* ---------- Admin form ---------- */
.admin {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) var(--gutter);
}
.admin h1 { font-size: 1.8rem; }
.admin h2 { font-size: 1.1rem; margin-top: 2em; }
.admin form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.admin label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.admin label input[type="checkbox"] { width: auto; }
.admin label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }
.admin input[type="text"],
.admin input[type="number"],
.admin select {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
}
.admin button {
  align-self: flex-start;
  background: var(--color-text);
  color: #fff;
  border: 0;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.admin pre {
  background: var(--color-text);
  color: #f5f5f5;
  padding: 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
}
.admin .ok { color: #1a7f37; font-weight: 600; }
.admin .err { color: var(--color-sale); font-weight: 600; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px var(--gutter); }
.notfound a { color: var(--color-accent); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .site-header__inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav__list { flex-wrap: wrap; justify-content: flex-start; gap: 14px 18px; }
  .site-nav__dropdown { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: 0; padding: 4px 0 4px 16px; min-width: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
}
