@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@700;900&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #1F1B16;
  --paper: #EFE7D8;
  --paper-dark: #E3D8C2;
  --stamp-red: #B23A2E;
  --caution: #E3A83B;
  --line: #C9BCA0;
  --white: #FBF9F4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .mark {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header .mark span { color: var(--stamp-red); }

.site-header nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  text-decoration: none;
  margin-left: 20px;
  color: var(--ink);
  opacity: 0.75;
}

.site-header nav a:hover { opacity: 1; }

.hero {
  padding: 64px 32px 48px;
  border-bottom: 3px solid var(--ink);
  text-align: center;
}

.hero h1 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: clamp(40px, 8vw, 84px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.hero h1 .stamp {
  display: inline-block;
  color: var(--stamp-red);
  transform: rotate(-2deg);
}

.hero p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0;
}

.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.catalog-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 32px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
}

.crate {
  background: var(--white);
  border: 2px solid var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
}

.crate-id {
  position: absolute;
  top: -2px;
  left: -2px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 6px;
  letter-spacing: 0.05em;
}

.crate img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-dark);
}

.crate-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.crate h3 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.crate .desc {
  font-size: 11px;
  opacity: 0.7;
  margin: 0;
  min-height: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crate .price {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 14px;
}

.gauge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gauge {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 40px;
}

.gauge .tick {
  height: 6px;
  flex: 1;
  background: var(--line);
  border: 1px solid var(--ink);
}

.gauge .tick.filled { background: var(--caution); }
.gauge .tick.low { background: var(--stamp-red); }

.gauge-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0.75;
}

.crate form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.crate input {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.crate input:focus {
  outline: 3px solid var(--caution);
  outline-offset: -1px;
}

.crate button {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--stamp-red);
  color: var(--white);
  border: 2px solid var(--ink);
  padding: 8px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.crate button:hover { transform: translateY(-2px); }
.crate button:active { transform: translateY(0); }

/* Reclaim width on small phones so 2+ columns fit comfortably */
@media (max-width: 480px) {
  .catalog { padding: 32px 14px 60px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

.admin-wrap {
  max-width: 480px;
  margin: 80px auto;
  padding: 32px;
  background: var(--white);
  border: 2px solid var(--ink);
}

.admin-wrap.wide { max-width: 1000px; }

.admin-wrap h1 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 24px;
  margin-top: 0;
}

.admin-wrap form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-wrap input,
.admin-wrap textarea,
.admin-wrap select {
  font-family: 'Inter', sans-serif;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.admin-wrap button {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px;
  cursor: pointer;
}

.admin-wrap .links {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  margin-bottom: 20px;
}

.admin-wrap .links a { margin-right: 16px; }

table.orders {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

table.orders th {
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--ink);
  padding: 8px;
}

table.orders td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

table.orders select {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.msg { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.msg.ok { color: #3F7D58; }
.msg.err { color: var(--stamp-red); }

/* Category chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 6px 12px;
  display: inline-block;
}

.chip.active {
  background: var(--stamp-red);
  color: var(--white);
}

/* Product detail page */
.product-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.pd-image {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--white);
}

.pd-image img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.pd-info h1 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 32px;
  margin: 12px 0 8px;
  letter-spacing: -0.02em;
}

.pd-description {
  font-size: 14px;
  opacity: 0.85;
  margin: 20px 0;
  line-height: 1.7;
}

.pd-order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.pd-order-form input {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.pd-order-form button {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  background: var(--stamp-red);
  color: var(--white);
  border: 2px solid var(--ink);
  padding: 12px;
  cursor: pointer;
}

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

/* Reviews */
.rating-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}

.stars {
  color: var(--caution);
  font-size: 16px;
  letter-spacing: 1px;
}

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

.review-card {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 14px 16px;
}

.review-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  opacity: 0.7;
  margin: 4px 0 8px;
}

.review-comment {
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* Star picker on leave-review.php */
.star-picker {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  font-size: 28px;
}

.star-picker input { display: none; }

.star-picker label {
  color: var(--line);
  cursor: pointer;
}

.star-picker input:checked ~ label,
.star-picker label:hover,
.star-picker label:hover ~ label {
  color: var(--caution);
}

/* Site footer */
.site-footer {
  border-top: 3px solid var(--ink);
  padding: 24px 32px;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-footer nav a {
  margin-left: 16px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.75;
}

.site-footer nav a:hover { opacity: 1; }

/* Let admin nav wrap gracefully now that it has more links */
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 0;
}

/* Toast auto-fade */
.msg.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Quantity stepper */
.qty-stepper {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
  width: fit-content;
}

.qty-stepper input {
  border: none !important;
  width: 48px;
  text-align: center;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-btn {
  background: var(--paper-dark);
  border: none;
  width: 30px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink);
}

.qty-btn:hover { background: var(--caution); }
.qty-btn:first-child { border-right: 2px solid var(--ink); }
.qty-btn:last-child { border-left: 2px solid var(--ink); }

/* "Last one!" flair on the stock gauge */
.last-one-flag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--stamp-red);
  padding: 2px 6px;
  animation: pulse-flag 1.4s ease-in-out infinite;
}

@keyframes pulse-flag {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Konami code easter egg */
.stamp-egg-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31,27,22,0.55);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.stamp-egg-overlay.show { opacity: 1; }

.stamp-egg {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 42px;
  text-transform: uppercase;
  color: var(--stamp-red);
  background: var(--paper);
  border: 6px solid var(--stamp-red);
  padding: 20px 40px;
  text-align: center;
  transform: rotate(-6deg) scale(0.7);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}

.stamp-egg-overlay.show .stamp-egg {
  transform: rotate(-6deg) scale(1);
}

.stamp-egg span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-transform: none;
  margin-top: 6px;
}

/* ── Discounts ── */
.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price-strike {
  text-decoration: line-through;
  opacity: 0.5;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.sale-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  background: var(--stamp-red);
  color: var(--white);
  padding: 2px 6px;
  transform: rotate(-3deg);
  display: inline-block;
}

.sale-badge-corner {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 13px;
  padding: 4px 10px;
  transform: rotate(3deg);
  z-index: 2;
}

.announce-bar {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.announce-item { white-space: nowrap; }

/* ── WhatsApp ── */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 100;
  border: 2px solid var(--ink);
}

.whatsapp-float:hover { transform: scale(1.08); }

.whatsapp-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.whatsapp-actions a {
  color: var(--ink);
  text-decoration: underline;
}

/* ── Admin dashboard ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card.stat-alert {
  border-color: var(--stamp-red);
  background: #FBEAE8;
}

.stat-value {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
}

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-top: 6px;
}
