/* ============================================================
   AVERN — Big Cartel Advanced Theme CSS
   Single-product cap drop. Dark, stealth-label aesthetic.
   Pair with: Layout.html, Home.html, Product.html, Cart.html
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --bg:        #0a0a0a;
  --surface:   #161616;
  --surface-2: #1e1e1e;
  --line:      #3a3a3a;
  --text:      #e8e6e0;
  --text-dim:  #8a8a85;
  --accent:    #c8ff3d;
  --accent-dim:#9bc92f;
  --danger:    #ff3b3b;

  --font-display: 'Archivo Black', 'Arial Narrow', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --bar-height-mobile: 72px;
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding-bottom: var(--bar-height-mobile);
  position: relative;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- NOISE TEXTURE ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   HEADER / WORDMARK
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0) 100%);
  pointer-events: none;
}

.site-header a,
.site-header * { pointer-events: auto; }

.site-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.site-title span { color: var(--accent); }

.header-meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-meta .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.site-main { position: relative; z-index: 2; padding-top: 0; }

/* ============================================================
   PRODUCT LAYOUT — mobile first
   ============================================================ */
.product {
  display: flex;
  flex-direction: column;
}

/* --- Image --- */
.product-image {
  width: 100%;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-image::after {
  content: "01 / 01";
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text);
  background: rgba(10,10,10,0.7);
  padding: 4px 8px;
  border: 1px solid var(--line);
}

.product-thumbnails {
  display: flex;
  gap: 1px;
  background: var(--line);
}

.product-thumbnails img {
  width: 25%;
  aspect-ratio: 1/1;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  background: var(--surface);
  cursor: pointer;
}

.product-thumbnails img:hover,
.product-thumbnails img.active {
  opacity: 1;
}

/* --- Details block --- */
.product-details {
  padding: 28px 20px 32px;
}

.product-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.product-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
}

.product-description {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 24px;
}

.product-description p + p { margin-top: 12px; }

/* --- Stock / status line --- */
.product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.product-stock.low { color: var(--danger); }
.product-stock .stock-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.product-stock.low .stock-dot { background: var(--danger); }

/* --- Quantity selector ---
   Big Cartel's product_quantity_input filter renders a plain
   <input type="text">. We wrap it with our own stepper buttons
   in the template; a tiny inline script (see bottom of this file's
   notes) increments/decrements the value. */
.quantity-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.quantity-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.quantity-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
}

.quantity-stepper button {
  width: 36px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  transition: background 0.15s ease, color 0.15s ease;
}

.quantity-stepper button:hover {
  background: var(--accent);
  color: var(--bg);
}

.quantity-stepper input[type="text"] {
  width: 44px;
  text-align: center;
  background: var(--bg);
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Hide Big Cartel's default option select when we only show a hidden input,
   but if a product DOES have real size/color options, style the select: */
.product-details select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 24px;
  appearance: none;
  border-radius: 0;
}

/* ============================================================
   STICKY DROP BAR — signature element
   ============================================================ */
.drop-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--bar-height-mobile);
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
}

.drop-bar::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0px,
    var(--accent) 8px,
    transparent 8px,
    transparent 16px
  );
}

.drop-bar-price {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  min-width: 96px;
}

.drop-bar-price .label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.drop-bar-price .value {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  margin-top: 2px;
}

.drop-bar button[type="submit"],
.drop-bar button[type="button"]:disabled {
  flex: 1;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  transition: background 0.15s ease;
}

.drop-bar button[type="submit"]:hover {
  background: var(--accent-dim);
}

.drop-bar button:disabled,
.drop-bar.sold-out button {
  background: var(--surface-2) !important;
  color: var(--text-dim) !important;
  cursor: not-allowed;
}

.drop-bar.sold-out .drop-bar-price .value {
  color: var(--text-dim);
  text-decoration: line-through;
}

/* ============================================================
   CART PAGE
   ============================================================ */
.cart-page {
  padding: 100px 20px 40px;
  min-height: 60vh;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.cart-table th,
.cart-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

.cart-table th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cart-table input[type="text"] {
  width: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  padding: 6px;
  text-align: center;
}

.cart-summary {
  margin: 24px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 0;
}

.cart-summary-row.total {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.update-cart {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.update-cart:hover { border-color: var(--accent); color: var(--accent); }

a.checkout {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 32px 20px 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer a:hover { color: var(--accent); }

.footer-socials {
  display: flex;
  gap: 16px;
}

/* ============================================================
   DESKTOP (≥ 800px)
   ============================================================ */
@media (min-width: 800px) {
  body { padding-bottom: 0; }

  .site-header { padding: 28px 40px; }
  .site-title { font-size: 22px; }

  .product {
    flex-direction: row;
    min-height: 100vh;
  }

  .product-image {
    width: 55%;
    height: 100vh;
    position: sticky;
    top: 0;
  }

  .product-image img {
    height: 100vh;
    aspect-ratio: auto;
  }

  .product-details {
    width: 45%;
    padding: 120px 56px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .product-title { font-size: clamp(36px, 3.2vw, 56px); }

  .drop-bar {
    position: static;
    height: auto;
    border-top: none;
    border: 1px solid var(--line);
    max-width: 380px;
  }

  .drop-bar::before { display: none; }

  .drop-bar-price {
    min-width: 120px;
    padding: 16px 20px;
  }

  .drop-bar-price .value { font-size: 22px; }

  .site-footer {
    padding: 40px;
    flex-direction: row;
    justify-content: space-between;
  }

  .cart-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 140px 40px 60px;
  }
}

@media (min-width: 1280px) {
  .product-details { padding: 140px 80px 80px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
