/* =========================================================
   Synthesize Peptide — base stylesheet
   ========================================================= */

:root {
  /* Bright orange + black palette */
  --bg: #000000;
  --surface: #0e0e0e;
  --surface-2: #181818;
  --border: #2a2218;
  --text: #f4ebe1;
  --muted: #8a7e72;
  --primary: #ff7e21;          /* brand orange (#FF7E21) */
  --primary-hover: #ff9747;
  --primary-deep: #b85100;
  --accent: #ffae6a;
  --danger: #ff5454;
  --warn: #ffc36b;
  --info: #ff9747;
  --shadow: 0 8px 28px rgba(255, 126, 33, 0.18), 0 4px 14px rgba(0, 0, 0, 0.6);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------------- Header / nav ---------------- */
.site-header {
  border-bottom: 1px solid rgba(0,0,0,0.35);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  position: sticky; top: 0; z-index: 5;
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
}
.site-header .brand,
.site-header .nav-links a,
.site-header .link-button { color: #fff; }
.site-header .nav-links a:hover { color: #ffe6dc; text-decoration: none; }
.site-header .nav-links a.active { color: #fff; text-decoration: underline; text-underline-offset: 6px; }
.site-header .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.55); }
.site-header .btn-ghost:hover { background: rgba(0,0,0,0.18); }
.site-header .cart-link .badge { background: #fff; color: var(--primary-deep); }
.site-header .brand-dot {
  background: #000;
  box-shadow: 0 0 0 2px #fff inset, 0 0 8px rgba(0,0,0,0.45);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); text-decoration: none; font-size: 18px;
}
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px rgba(255, 126, 33, 0.7);
}
.brand-logo {
  height: 36px; width: auto; display: inline-block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.brand-text { font-weight: 700; }
.footer-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.footer-logo {
  height: 48px; width: auto; display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--text); }
.nav-links a.active { color: var(--primary); }
.cart-link { position: relative; }
.user-greeting {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff !important;
  text-decoration: none;
}
.user-greeting strong { font-weight: 700; }
.user-greeting:hover { background: rgba(0, 0, 0, 0.35); text-decoration: none; }
@media (max-width: 480px) {
  .user-greeting { padding: 3px 8px; font-size: 13px; }
}
.cart-link .badge {
  background: var(--primary); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; font-size: 12px; margin-left: 6px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid transparent;
  padding: 10px 18px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .15s ease;
  font-size: 14px;
}
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-primary { background: var(--primary); color: #1a0e00; box-shadow: 0 6px 18px rgba(255,126,33,0.35); }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; box-shadow: 0 8px 22px rgba(255,151,71,0.45); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-ghost.danger { color: var(--danger); border-color: rgba(249,115,115,0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-button {
  background: none; border: 0; color: var(--text); cursor: pointer; padding: 0; font: inherit;
}
.link-button.danger { color: var(--danger); }
.link-button:hover { text-decoration: underline; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }

/* ---------------- Hero ---------------- */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px;
  padding: 64px 0 32px;
  align-items: center;
}
.hero h1 { font-size: 44px; line-height: 1.1; margin: 0 0 16px; }
.lead { font-size: 18px; color: var(--muted); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.micro-disclaimer { color: var(--muted); font-size: 12px; margin-top: 24px; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.hero-card-row {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.hero-card-row:last-child { border-bottom: 0; }
.hero-card-row span { color: var(--muted); }

/* ---------------- Sections / cards ---------------- */
.section { padding: 32px 0 56px; }
.section.narrow { max-width: 540px; margin: 0 auto; }
.section-head {
  display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; gap: 16px;
}
.section-head h1, .section-head h2 { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card.pad { padding: 24px; }
.card.pad h2 { margin-top: 0; }

.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 800px) { .two-col, .hero { grid-template-columns: 1fr; } }

/* ---------------- Product cards ---------------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.thumb {
  aspect-ratio: 4/3; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 56px; font-weight: 700;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.thumb-placeholder.large { font-size: 96px; height: 380px; border-radius: var(--radius); }
.thumb-placeholder.small { font-size: 18px; }
.row-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.card-body { padding: 16px 18px; }
.card-body h3 { margin: 4px 0 6px; font-size: 16px; }
.tag {
  display: inline-block; background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.price-row {
  display: flex; justify-content: space-between; align-items: end; margin-top: 10px;
}
.price { font-weight: 700; font-size: 16px; color: var(--text); }
.price-lg { font-weight: 700; font-size: 28px; color: var(--text); }

/* ---------------- Product detail ---------------- */
.product-page {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start;
}
@media (max-width: 800px) { .product-page { grid-template-columns: 1fr; } }
.product-image img { width: 100%; border-radius: var(--radius); }
.add-to-cart {
  display: flex; align-items: end; gap: 12px; margin: 20px 0;
}
.add-to-cart input { width: 80px; }
.prose p { color: var(--muted); }
.prose h2 { margin-top: 32px; }

/* Product detail: blood-orange description card */
.product-description {
  display: block;
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  border: 1px solid rgba(0,0,0,0.35);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255,126,33,0.30);
  white-space: pre-wrap;
}
.product-description p,
.product-description li,
.product-description span { color: #fff; }
.product-description h2,
.product-description h3,
.product-description strong { color: #fff; }
.product-description a { color: #fff; text-decoration: underline; }

/* ---------------- Forms ---------------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted);
}
label.checkbox { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="file"], select, textarea, input:not([type]) {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }

/* radio cards in checkout */
.radio-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; color: var(--text);
}
.radio-card input { width: auto; }
.radio-card span { display: flex; flex-direction: column; }
.radio-card small { color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }

/* ---------------- Tables ---------------- */
.table {
  width: 100%; border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left;
  vertical-align: middle;
}
.table thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }
.table.compact th, .table.compact td { padding: 6px 8px; }
.table .right { text-align: right; }

.status {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
}
.status-pending { background: rgba(255,195,107,0.15); color: var(--warn); }
.status-awaiting_payment { background: rgba(255,174,106,0.15); color: var(--accent); }
.status-paid { background: rgba(255,126,33,0.20); color: var(--primary); }
.status-cancelled { background: rgba(255,84,84,0.15); color: var(--danger); }
.status-refunded { background: rgba(255,84,84,0.10); color: var(--danger); }

/* ---------------- Alerts ---------------- */
.alert {
  border-radius: 10px; padding: 12px 16px; margin: 16px 0;
  border: 1px solid var(--border); font-size: 14px;
}
.alert-success { background: rgba(255,126,33,0.12); border-color: rgba(255,126,33,0.45); color: var(--accent); }
.alert-error { background: rgba(255,84,84,0.10); border-color: rgba(255,84,84,0.4); color: var(--danger); }
.alert-info { background: rgba(255,174,106,0.10); border-color: rgba(255,174,106,0.4); color: var(--info); }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 4px solid #000;
  margin-top: 64px;
  padding: 40px 0 24px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffe6dc; }
.site-footer .muted { color: rgba(255,255,255,0.85); }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px;
  padding-bottom: 24px;
}
.footer-grid h4 { margin: 0 0 10px; color: #fff; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid ul li { margin: 6px 0; }
.copyright { padding-top: 16px; border-top: 1px solid rgba(0,0,0,0.25); color: rgba(255,255,255,0.85); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------- Filters ---------------- */
.filters {
  display: flex; gap: 8px; align-items: center;
}
.filters select, .filters input { width: auto; }

/* ---------------- Checkout ---------------- */
.checkout-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px;
}
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }
.btc-address {
  background: var(--surface-2); padding: 12px; border-radius: 8px;
  word-break: break-all; text-align: center;
}
.cart-promo { margin: 16px 0 0; }
.cart-promo input { background: var(--bg); }

/* ---------------- Admin ---------------- */
body.admin {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
body.admin.no-sidebar { grid-template-columns: 1fr; }
body.admin.no-sidebar > main.admin-main { grid-column: 1; }
.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh;
}
.admin-hello { margin: 0; }
.admin-nav {
  display: flex; flex-direction: column; gap: 4px; margin-top: 8px;
}
.admin-nav a {
  color: var(--text); padding: 8px 10px; border-radius: 8px;
}
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.active { background: var(--surface-2); color: var(--primary); }
.admin-logout { margin-top: auto; }
.admin-main {
  padding: 32px 40px;
  min-width: 0;
}
.admin-main.centered {
  display: flex; align-items: center; justify-content: center;
}
.admin-login {
  width: 380px;
}
body.admin > main.admin-main {
  grid-column: 2;
}
@media (max-width: 800px) {
  body.admin { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  body.admin > main.admin-main { grid-column: 1; }
}

.stat-grid {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.stat-card strong { font-size: 24px; }

/* ---------------- Image uploader (admin) ---------------- */
.image-uploader { width: 100%; }
.image-drop {
  display: block; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 16px; transition: border-color .15s, background .15s;
  background: var(--surface-2);
}
.image-drop:hover, .image-drop.drag {
  border-color: var(--primary);
  background: rgba(255,126,33,0.08);
}
.image-drop-inner {
  display: flex; gap: 16px; align-items: center;
}
.image-drop-preview {
  width: 120px; height: 120px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.image-drop-preview img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   Responsive: tablets and phones
   ========================================================= */

/* Tablet & small laptop (≤ 900px) */
@media (max-width: 900px) {
  .container { padding: 0 18px; }
  .hero { gap: 28px; padding: 40px 0 24px; }
  .hero h1 { font-size: 36px; }
  .lead { font-size: 16px; }
  .admin-main { padding: 24px 20px; }
  .checkout-grid { gap: 16px; }
  .grid { gap: 16px; }
}

/* Phones (≤ 720px) — main responsive breakpoint */
@media (max-width: 720px) {
  .container { padding: 0 14px; }

  /* Header: allow wrapping, shrink, drop the "Create account" pill on tiny screens */
  .nav { height: auto; padding: 10px 0; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-logo { height: 28px; }
  .nav-links { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-links a, .nav-links .link-button { font-size: 14px; }
  .site-header .btn { padding: 8px 14px; font-size: 13px; }

  /* Hero */
  .hero { grid-template-columns: 1fr; padding: 28px 0 16px; gap: 18px; }
  .hero h1 { font-size: 28px; line-height: 1.15; margin-bottom: 10px; }
  .lead { font-size: 15px; }
  .hero-card-row { padding: 10px 0; font-size: 14px; }
  .cta-row { gap: 8px; }
  .cta-row .btn { flex: 1 1 auto; min-width: 140px; justify-content: center; }

  /* Sections */
  .section { padding: 22px 0 36px; }
  .section-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .section-head h1 { font-size: 26px; }
  .section-head h2 { font-size: 20px; }

  /* Filters (shop) */
  .filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters select, .filters input { width: 100%; }
  .filters .btn { width: 100%; }

  /* Product grid: cards a touch tighter */
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body { padding: 12px 14px; }
  .card-body h3 { font-size: 15px; }
  .price, .price-row .muted { font-size: 14px; }

  /* Product detail */
  .product-page { grid-template-columns: 1fr; gap: 22px; }
  .price-lg { font-size: 24px; }
  .add-to-cart { flex-wrap: wrap; gap: 10px; }
  .add-to-cart label { width: 110px; }
  .add-to-cart .btn { flex: 1 1 100%; }
  .product-description { padding: 18px; font-size: 15px; }
  .thumb-placeholder.large { height: 240px; font-size: 64px; }

  /* Forms — collapse two-column rows to one */
  .row { grid-template-columns: 1fr; gap: 10px; }
  .form-card { padding: 18px; gap: 12px; }
  .card.pad { padding: 16px; }

  /* Two-col anywhere (account, checkout, order pages) */
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .checkout-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Tables become horizontally scrollable */
  .table {
    display: block; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .table thead, .table tbody, .table tfoot { display: table; width: 100%; table-layout: auto; }
  .table th, .table td { padding: 8px 10px; font-size: 13px; }
  .table.compact th, .table.compact td { padding: 5px 6px; font-size: 13px; }

  /* Buttons */
  .btn { padding: 9px 16px; }
  .btn.small { padding: 6px 10px; }

  /* Image uploader: stack preview above details */
  .image-drop-inner { flex-direction: column; align-items: stretch; text-align: center; }
  .image-drop-preview { width: 100%; height: 180px; }

  /* Footer */
  .site-footer { padding: 28px 0 18px; margin-top: 40px; }
  .footer-grid { gap: 20px; }

  /* Bitcoin pay page: keep address readable */
  .btc-address { font-size: 13px; padding: 10px; }

  /* Admin */
  .admin-sidebar { padding: 16px; }
  .admin-main { padding: 18px 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 20px; }
  .admin-login { width: 100%; }
}

/* Small phones (≤ 420px) — extra polish */
@media (max-width: 420px) {
  .container { padding: 0 12px; }
  .hero h1 { font-size: 24px; }
  .nav-links { gap: 8px; }
  .nav-links a:not(.btn), .nav-links .link-button { font-size: 13px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-body h3 { font-size: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .price-lg { font-size: 22px; }

  /* Hide the "Create account" pill on very small screens; users can still
     reach /register from the Sign-in page or the footer. */
  .site-header .btn-ghost { display: none; }
}
