@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300;1,9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg:           #faf6f0;
  --surface:      #fffcf8;
  --surface-2:    #f0ebe2;
  --text:         #1c1714;
  --text-2:       #6b5e52;
  --text-3:       #a89080;
  --line:         #e5ddd4;
  --brand:        #1a3d2b;
  --brand-mid:    #2d6147;
  --brand-light:  #4a8c65;
  --brand-soft:   #e6f2eb;
  --accent:       #c87941;
  --accent-dark:  #a35f2e;
  --accent-soft:  #fdf0e4;
  --danger:       #b91c1c;
  --sh-xs:        0 1px 2px rgba(28,23,20,.06);
  --sh-sm:        0 2px 8px rgba(28,23,20,.08);
  --sh-md:        0 8px 28px rgba(28,23,20,.11);
  --sh-lg:        0 20px 56px rgba(28,23,20,.14);
  --r-xs:         6px;
  --r-sm:         10px;
  --r:            16px;
  --r-lg:         24px;
  --r-xl:         32px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }
a { transition: color .15s; }

/* ─── HEADER ────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,246,240,.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 28px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1;
  flex-shrink: 0;
}

.logo-paw {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: .9rem;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
  white-space: nowrap;
  min-height: 44px;
}

.nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-cart-link {
  color: var(--brand);
  font-weight: 700;
}

.cart-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  line-height: 1;
}

/* ─── MAIN ──────────────────────────────────────────────── */

.main {
  flex: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px 28px 72px;
}

/* ─── HERO ──────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--brand);
  padding: 64px 48px 56px;
  margin-bottom: 52px;
  color: #fff;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 90% at 90% 40%, rgba(200,121,65,.28) 0%, transparent 58%),
    radial-gradient(ellipse 45% 55% at -5% 90%, rgba(255,255,255,.07) 0%, transparent 50%),
    radial-gradient(ellipse 30% 40% at 50% -10%, rgba(255,255,255,.05) 0%, transparent 60%);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  right: -2%;
  top: 50%;
  translate: 0 -50%;
  width: min(38vw, 360px);
  height: min(38vw, 360px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='white' opacity='.07'%3E%3Cellipse cx='33' cy='28' rx='11' ry='14'/%3E%3Cellipse cx='67' cy='28' rx='11' ry='14'/%3E%3Cellipse cx='15' cy='50' rx='9' ry='11'/%3E%3Cellipse cx='85' cy='50' rx='9' ry='11'/%3E%3Cpath d='M50 42c-16 0-30 13-27 32 1.8 10 9 18 27 18s25.2-8 27-18c3-19-11-32-27-32z'/%3E%3C/svg%3E") center/contain no-repeat;
  z-index: -1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 640px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.88);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 0 0 18px;
  color: #fff;
}

.hero h1 em {
  font-style: italic;
  color: #f5c286;
}

.hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,.72);
  line-height: 1.7;
  margin: 0 0 30px;
  max-width: 52ch;
  font-weight: 400;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: .8rem;
  font-weight: 600;
}

/* ─── SECTION HEAD ──────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0;
  line-height: 1.1;
}

.section-subtitle {
  color: var(--text-3);
  font-size: .88rem;
  font-weight: 500;
}

/* ─── PRODUCT GRID ──────────────────────────────────────── */

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

/* ─── PRODUCT CARD ──────────────────────────────────────── */

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-3px);
}

.product-card > a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .38s cubic-bezier(.25,.46,.45,.94);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-img.placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-3);
  font-size: .85rem;
}

.product-card-body {
  padding: 14px 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-title {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

/* ─── BUTTONS ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  min-height: 44px;
  white-space: nowrap;
}

.btn:hover { background: var(--brand-mid); }
.btn:active { transform: scale(.98); }

.btn:disabled,
.btn.htmx-request {
  opacity: .65;
  cursor: wait;
  pointer-events: none;
}

.btn-sm {
  padding: 9px 16px;
  font-size: .84rem;
  min-height: 38px;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--line); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecaca;
  font-size: .82rem;
  min-height: 36px;
  padding: 7px 12px;
  font-weight: 600;
}
.btn-danger:hover { background: #fef2f2; }

.btn-add {
  margin: 8px 14px 14px;
  width: calc(100% - 28px);
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 700;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: background .15s;
  min-height: 44px;
}
.btn-add:hover { background: var(--brand-mid); }
.btn-add:disabled,
.btn-add.htmx-request { opacity: .65; cursor: wait; }

.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,.45);
  border-right-color: transparent;
  border-radius: 50%;
  display: none;
  flex-shrink: 0;
}
.btn.htmx-request .btn-spinner,
.btn-add.htmx-request .btn-spinner {
  display: inline-block;
  animation: spin .7s linear infinite;
}

/* ─── BREADCRUMB ────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .88rem;
  color: var(--text-3);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--brand-mid);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ─── PRODUCT DETAIL ────────────────────────────────────── */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr);
  gap: 28px;
  align-items: start;
}

/* Gallery: vertical thumbs left + main image right */
.product-gallery {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  position: sticky;
  top: 86px;
  display: flex;
  gap: 12px;
}

.detail-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 500px;
  width: 72px;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.detail-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
  opacity: .75;
}
.detail-thumb:hover { border-color: var(--brand-light); opacity: 1; }
.detail-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  opacity: 1;
}

.gallery-main { flex: 1; min-width: 0; }

.detail-img-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--surface-2);
}

.detail-img { border-radius: var(--r); }

.detail-placeholder {
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: .9rem;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--r);
}

/* Product info panel */
.product-info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.product-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem,2.5vw,1.9rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  color: var(--text);
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

.variants-section { margin-bottom: 0; }

.variants-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
  display: block;
}

.variants-scroll {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.variant-row:last-child { margin-bottom: 0; }
.variant-row:hover {
  border-color: var(--brand-light);
  background: var(--brand-soft);
}

.variant-info { flex: 1; min-width: 0; }
.variant-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  display: block;
}
.variant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-2);
  margin-top: 2px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--brand-mid);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
}


.body-html {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: .92rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
}
.body-html * { max-width: 100% !important; text-wrap-mode: wrap !important; white-space: normal !important; overflow-wrap: break-word !important; word-break: break-word !important; }

/* single contextual image (inside text) */
.body-html img {
  width: auto !important;
  max-width: 100% !important;
  max-height: 360px;
  height: auto !important;
  object-fit: contain;
  border-radius: var(--r-sm);
  margin: 8px 0;
  display: block;
}

/* paragraph that's purely an image dump — lay them out as a grid */
.body-html p:has(> img) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.body-html p:has(> img) img {
  width: 100% !important;
  height: 160px !important;
  max-height: none;
  object-fit: cover !important;
  margin: 0;
  border-radius: var(--r-sm);
}

.body-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin: 12px 0;
}
.body-html th,
.body-html td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}
.body-html th { background: var(--surface-2); font-weight: 600; }

.body-html iframe,
.body-html video {
  width: 100% !important;
  max-height: 360px;
  border: 0;
  border-radius: var(--r-sm);
  display: block;
}

/* ─── CART ──────────────────────────────────────────────── */

.cart-page { max-width: 800px; }

.cart-page-header { margin-bottom: 30px; }

.cart-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem,4vw,2.6rem);
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0 0 6px;
  line-height: 1.1;
}

.cart-subtitle {
  color: var(--text-3);
  font-size: .92rem;
  margin: 0;
}

.cart-empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 64px 24px;
  text-align: center;
}
.cart-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
}
.cart-empty p {
  color: var(--text-2);
  font-size: 1rem;
  margin: 0 0 24px;
}

.cart-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

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

.cart-item-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.cart-item-info { min-width: 0; }
.cart-item-info a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  display: block;
}
.cart-item-info a:hover { color: var(--brand); }
.cart-item-variant {
  font-size: .82rem;
  color: var(--text-3);
  margin-top: 3px;
}

.cart-item-qty-price { text-align: right; }
.cart-item-qty {
  font-size: .82rem;
  color: var(--text-3);
  white-space: nowrap;
}
.cart-item-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .95rem;
  color: var(--text-2);
}
.cart-summary-row + .cart-summary-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.cart-summary-row.subtotal strong,
.cart-summary-row.subtotal span:last-child {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.cart-note {
  background: var(--brand-soft);
  color: var(--brand-mid);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 22px;
  border: 1px solid #c8e6d3;
}

.cart-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── TOAST ─────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
  box-shadow: var(--sh-lg);
  animation: toastIn .2s ease;
}
.toast-error { background: #991b1b; }

@keyframes toastIn {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ─── STATES ────────────────────────────────────────────── */

.empty, .error {
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 30px 16px;
  font-size: .92rem;
}

/* ─── FOOTER ────────────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  background: var(--brand);
  color: rgba(255,255,255,.65);
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 44px 28px 36px;
}

.footer-brand {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.footer-logo {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -.015em;
}

.footer-tagline {
  margin: 0;
  font-size: .88rem;
  color: rgba(255,255,255,.55);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a { color: rgba(255,255,255,.75); font-size: .84rem; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .84rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer-bottom a:hover { color: #fff; text-decoration: underline; }

/* ─── POLICY PAGE ───────────────────────────────────────── */
.policy-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.policy-page h1 { font-size: 2rem; margin-bottom: .25rem; }
.policy-updated { color: var(--text-muted); font-size: .85rem; margin-bottom: 2rem; }
.policy-page h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.policy-page h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .4rem; }
.policy-page p, .policy-page li { font-size: .97rem; line-height: 1.7; color: var(--text); }
.policy-page ul, .policy-page ol { padding-left: 1.5rem; margin: .5rem 0 1rem; }
.policy-page li { margin-bottom: .35rem; }
.policy-page a { color: var(--accent); }

/* ─── ANIMATIONS ────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ────────────────────────────────────────── */

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 820px) {
  .header-inner { padding: 0 20px; height: 60px; }
  .logo { font-size: 1.18rem; }
  .main { padding: 24px 20px 56px; }

  .hero {
    padding: 40px 28px 36px;
    border-radius: var(--r-lg);
    margin-bottom: 36px;
  }
  .hero::after { display: none; }

  .product-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .product-gallery {
    position: static;
    border-radius: var(--r);
    padding: 12px;
    flex-direction: column-reverse;
  }
  .detail-thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    width: 100%;
  }
  .detail-thumb { width: 60px; height: 60px; }
  .product-info { border-radius: var(--r); padding: 20px; }

  .section-title { font-size: 1.4rem; }

  .cart-item {
    grid-template-columns: 76px 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px 14px;
  }
  .cart-item-img {
    width: 76px;
    height: 76px;
    grid-row: 1 / 4;
  }
  .cart-item-qty-price { text-align: left; }
  .cart-item-remove { justify-self: start; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 16px; }
  .main { padding: 18px 16px 48px; }
  .hero { padding: 32px 20px 28px; border-radius: var(--r); }
  .hero h1 { font-size: 1.9rem; }
  .footer-inner { padding: 36px 20px 28px; }
  .product-img-wrap { aspect-ratio: 1 / 1; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
}

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.checkout-page { max-width: 1000px; margin: 0 auto; }
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: start;
  margin-top: 28px;
}
.checkout-summary h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.checkout-item-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 14px; }
.checkout-item { display: flex; align-items: center; gap: 12px; }
.checkout-item-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.checkout-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.checkout-item-name { font-weight: 500; }
.checkout-item-variant, .checkout-item-qty { color: var(--text-3); font-size: .82rem; }
.checkout-item-total { font-weight: 600; font-size: .92rem; }

.checkout-form fieldset { border: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.checkout-form legend { font-weight: 600; font-size: 1rem; margin-bottom: 6px; padding: 0; }
.checkout-form label { font-size: .88rem; font-weight: 500; color: var(--text-2); margin-bottom: 2px; }
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--surface-1);
  color: var(--text-1);
  box-sizing: border-box;
  transition: border-color .15s;
}
.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus { outline: none; border-color: var(--accent); }
.checkout-form textarea { resize: vertical; min-height: 80px; }
.checkout-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.checkout-error {
  background: #fff0f0; border: 1px solid #fca5a5; color: #b91c1c;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: .92rem;
}

/* ── Order success ────────────────────────────────────────────────────────── */
.order-success-page {
  max-width: 520px; margin: 60px auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.order-success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #dcfce7; color: #16a34a;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
}
.order-invoice-number { font-size: 1.05rem; color: var(--text-2); }
.order-success-note { font-size: .9rem; color: var(--text-3); max-width: 380px; }
.order-success-sub { color: var(--text-2); }

@media (max-width: 700px) {
  .checkout-layout { grid-template-columns: 1fr; }
}
