/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: #0f0f0f; }

html { scrollbar-gutter: stable; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0c0c0c;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom)) 16px;
}

.container {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1; /* footer (margin-top: auto) always lands at the bottom */
}

/* ─── Shared components ──────────────────────────────────── */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
  border: 2px solid #333;
}

.name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.bio {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 16px;
}

.footer {
  margin-top: auto;
  padding-top: 40px;
  align-self: center;
  text-align: center;
  font-size: 0.72rem;
  color: #555;
}

.visit-count { opacity: 0.7; }

.back-link {
  font-size: 0.82rem;
  color: #555;
  text-decoration: none;
  transition: color .18s;
}
.back-link:hover { color: #aaa; }

/* Shop footer: divider on top, Instagram, policies and copyright stacked
   (looks good on mobile and desktop). */
.shop-footer {
  margin-top: auto;
  width: 100%;
  border-top: 1px solid #242424;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* IG left · year centered · policies right */
  align-items: center;
  gap: 8px;
}
.shop-footer .ig-link {
  justify-self: start;
  display: inline-flex;
  padding: 4px;
  margin-left: -4px;            /* align the icon's visual edge with content */
  color: #888;
  transition: color .18s, transform .1s;
}
.shop-footer .ig-link:hover { color: #fff; transform: translateY(-1px); }
.shop-footer .shop-copy { justify-self: center; font-size: 0.72rem; color: #555; white-space: nowrap; }
.shop-footer .back-link { justify-self: end; font-size: 0.78rem; }

.loading {
  color: #555;
  font-size: 0.9rem;
  padding: 48px 0;
}

.error-msg {
  color: #f87171;
  font-size: 0.85rem;
  padding: 48px 0;
}

/* ─── Home ───────────────────────────────────────────────── */
body.page-home .container,
body.page-contact .container {
  max-width: 480px;
  align-items: center;
  gap: 8px;
}

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background .18s, border-color .18s, transform .1s;
}
.link-item:hover { background: #242424; border-color: #444; transform: translateY(-1px); }
.link-item:active { transform: translateY(0); }

.icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.icon svg { width: 22px; height: 22px; }

.icon-instagram {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.icon-tiktok,
.icon-x { background: #000; }
.icon-globe { background: #1a1a2e; }

.label {
  flex: 1;
  text-align: center;
  padding-right: 40px;
}

/* ─── Contact ────────────────────────────────────────────── */
.form-card {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input, select, textarea {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  width: 100%;
  transition: border-color .18s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder { color: #555; }
input:focus, select:focus, textarea:focus { border-color: #555; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select option { background: #1a1a1a; }

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.btn-submit {
  background: #fff;
  color: #0c0c0c;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
  transition: background .18s, transform .1s;
  width: 100%;
}
.btn-submit:hover { background: #ddd; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

.success-msg {
  display: none;
  text-align: center;
  padding: 20px;
  font-size: 0.95rem;
  color: #aaa;
}
.success-msg strong { display: block; font-size: 1.1rem; color: #fff; margin-bottom: 6px; }

body.page-contact .error-msg {
  display: none;
  padding: 10px 0 0;
  text-align: center;
}

/* ─── Shop ───────────────────────────────────────────────── */
body.page-shop .container {
  max-width: 960px;
  align-items: center;
  gap: 24px;
}

/* Only the top "back" link, not the policies link inside the footer. */
body.page-shop .container > .back-link { align-self: flex-start; }

/* Shared shop header (self-contained so it looks identical on the shop,
   product and checkout pages). */
.shop-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.shop-header .avatar { width: 64px; height: 64px; }
.shop-header .name   { font-size: 1.1rem; }
.shop-header .bio    { font-size: 0.82rem; color: #888; margin-bottom: 0; }

.shop-note { font-size: 0.8rem; color: #888; text-align: center; }

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  transition: border-color .18s, transform .1s;
  display: flex;
  flex-direction: column;
  animation: card-in .45s ease both; /* staggered reveal; delay set per-card in shop.js */
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:hover { border-color: #444; transform: translateY(-2px); }
.card:active { transform: translateY(0); }

.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #111;
  display: block;
}

.card-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 2rem;
}

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

.card-title { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.card-price { font-size: 0.85rem; color: #aaa; margin-top: 4px; }

body.page-shop .error-msg { padding: 48px 0; }

.grid > .loading,
.grid > .error-msg {
  grid-column: 1 / -1;
  text-align: center;
}

/* ─── Loading skeletons ──────────────────────────────────── */
.sk-card {
  background: #1a1a1a;
  border: 1px solid #242424;
  border-radius: 14px;
  overflow: hidden;
}

.sk-img {
  width: 100%;
  aspect-ratio: 1;
  background: #141414;
}

.sk-rounded { border-radius: 14px; }

.sk-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  background: #1f1f1f;
  width: 75%;
}

.sk-line.short { width: 45%; }

.sk-title {
  height: 20px;
  width: 55%;
  margin-bottom: 16px;
}

.sk-btn {
  height: 46px;
  border-radius: 10px;
  background: #1f1f1f;
  margin-top: 6px;
}

.sk-img, .sk-line, .sk-btn {
  animation: sk-pulse 1.4s ease-in-out infinite;
}

@keyframes sk-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .sk-img, .sk-line, .sk-btn { animation: none; }
  .card { animation: none; }
}

/* ─── Product ────────────────────────────────────────────── */
body.page-product .container { max-width: 760px; gap: 20px; }

body.page-product .loading,
body.page-product .error-msg { text-align: center; }

.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) {
  .product { grid-template-columns: 1fr 1fr; align-items: start; }
}

.images { display: flex; flex-direction: column; gap: 10px; }

/* Swipeable image carousel */
.car-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 14px;
  background: #111;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.car-track::-webkit-scrollbar { display: none; }

.car-track img {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 1;
  object-fit: cover;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  cursor: zoom-in;
  display: block;
}

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

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
  background: #111;
}
.thumb.active, .thumb:hover { border-color: #fff; }

.info { display: flex; flex-direction: column; gap: 16px; }

.product-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}
.product-price { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.product-desc  { font-size: 0.83rem; color: #888; line-height: 1.6; white-space: pre-line; }

.option-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
}
.swatch.active { outline-color: #fff; }

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

.size-btn {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.size-btn:hover { border-color: #555; }
.size-btn.active { border-color: #fff; background: #222; }
.size-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-cart {
  background: #fff;
  color: #0c0c0c;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  width: 100%;
  transition: background .18s, transform .1s;
}
.btn-cart:hover { background: #ddd; transform: translateY(-1px); }
.btn-cart:active { transform: translateY(0); }
.btn-cart:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Quantity stepper */
.qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s;
}
.qty button:hover { border-color: #555; }

.qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}

.ship-note {
  font-size: 0.76rem;
  color: #666;
  text-align: center;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
}

.lb-btn {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .15s;
  padding: 14px;
  line-height: 1;
}
.lb-btn:hover { opacity: 1; }

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
}
.lb-prev { left: 6px; }
.lb-next { right: 6px; }

.lb-close {
  top: 10px;
  right: 12px;
  font-size: 1.9rem;
}

.lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #aaa;
  font-size: 0.85rem;
}

/* Order summary (checkout) */
.order-summary {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #aaa;
}

.sum-row.sum-total {
  color: #fff;
  font-weight: 700;
  border-top: 1px solid #2a2a2a;
  padding-top: 10px;
  margin-top: 2px;
}

.field input:disabled {
  opacity: 0.45;
}

/* ─── Checkout page ──────────────────────────────────────── */
body.page-checkout .container {
  max-width: 560px;
  gap: 18px;
}

.co-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.co-product {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.co-product img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}

.co-product > div { min-width: 0; flex: 1; }

.co-name    { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.co-variant { font-size: 0.8rem; color: #888; margin-top: 2px; }
.co-price   { margin-left: auto; font-weight: 700; flex-shrink: 0; }

.co-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.co-step    { font-size: 1rem; font-weight: 700; }
.co-form    { display: flex; flex-direction: column; gap: 14px; }
.co-actions { display: flex; flex-direction: column; gap: 8px; }
.co-error   { color: #f87171; font-size: 0.82rem; text-align: center; display: none; }
.co-policies { color: #777; font-size: 0.74rem; text-align: center; margin-top: 12px; }
.co-policies a { color: #aaa; text-decoration: underline; }

/* Confirmation view */
.co-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.co-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-success h2 { font-size: 1.3rem; }

.co-sub {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 400px;
}

.co-success .order-summary {
  display: flex;
  width: 100%;
  text-align: left;
}

.sum-addr {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.6;
  border-top: 1px solid #2a2a2a;
  padding-top: 10px;
}
.sum-addr strong { color: #fff; }

a.co-back {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  margin-top: 4px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field       { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input, .field select {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: #555; }
.field input.invalid, .field select.invalid { border-color: #f87171; }

.btn-confirm {
  background: #fff;
  color: #0c0c0c;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
  transition: background .18s;
}
.btn-confirm:hover { background: #ddd; }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cancel {
  background: none;
  border: none;
  color: #555;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px;
  transition: color .15s;
}
.btn-cancel:hover { color: #aaa; }

/* ─── 404 ────────────────────────────────────────────────── */
body.page-404 {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 24px;
}
.err-code { font-size: 4rem; font-weight: 700; opacity: 0.15; line-height: 1; }
.err-msg  { font-size: 1rem; color: #aaa; }
.err-back {
  margin-top: 8px;
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 20px;
  transition: border-color .2s;
}
.err-back:hover { border-color: #666; }
