/* Tech Apostle Shop — lightweight build for shared hosting */
:root {
  --cream: #F7F3ED;
  --paper: #EFE9E3;
  --ink: #442312;
  --inkdeep: #2A160D;
  --flame: #F27901;
  --line: rgba(68, 35, 18, 0.12);
  --ink-soft: rgba(68, 35, 18, 0.55);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.container { max-width: 80rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--inkdeep); color: var(--cream);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px; letter-spacing: 0.18em;
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 1rem; max-width: 80rem; margin: 0 auto; }
.topbar a:hover { color: var(--flame); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 243, 237, 0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; max-width: 80rem; margin: 0 auto; }
.header-inner > a img { height: 2.4rem; width: auto; }
.search-wrap { position: relative; flex: 1; display: none; }
@media (min-width: 768px) { .search-wrap { display: block; } }
.search-wrap input {
  width: 100%; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; padding: 0.65rem 3rem 0.65rem 1.25rem; font-size: 0.875rem;
  outline: none; font-family: inherit;
}
.search-wrap input:focus { border-color: var(--flame); }
.search-wrap svg { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.admin-link {
  display: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1rem; font-family: "IBM Plex Mono", monospace;
  font-size: 10px; letter-spacing: 0.2em; color: var(--ink-soft);
}
.admin-link:hover { border-color: var(--flame); color: var(--flame); }
@media (min-width: 640px) { .admin-link { display: block; } }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
  border: none; border-radius: 999px; background: var(--ink); color: var(--cream);
  padding: 0.65rem 1.25rem; font-family: "IBM Plex Mono", monospace;
  font-size: 11px; letter-spacing: 0.15em; transition: background 0.2s;
}
.cart-btn:hover { background: var(--flame); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  height: 20px; width: 20px; border-radius: 999px; background: var(--flame);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mobile-search { border-top: 1px solid var(--line); padding: 0.5rem 1rem; }
.mobile-search input {
  width: 100%; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; padding: 0.5rem 1rem; font-size: 0.875rem; outline: none; font-family: inherit;
}
@media (min-width: 768px) { .mobile-search { display: none; } }

/* ---------- Category nav ---------- */
.catnav { border-bottom: 1px solid var(--line); background: var(--cream); }
.catnav-inner { display: flex; gap: 2rem; overflow-x: auto; padding: 0.8rem 1rem; max-width: 80rem; margin: 0 auto; }
.catnav a {
  white-space: nowrap; font-family: "IBM Plex Mono", monospace;
  font-size: 11px; letter-spacing: 0.2em; color: var(--ink);
}
.catnav a:hover, .catnav a.star { color: var(--flame); }

/* ---------- Hero ---------- */
.hero { padding-top: 2rem; }
@media (min-width: 768px) { .hero { padding-top: 3rem; } }
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.hero h1 {
  font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 700; text-transform: uppercase;
  line-height: 0.95; letter-spacing: -0.02em;
}
.hero h1 .flame { color: var(--flame); }
.hero-copy { display: none; max-width: 20rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }
@media (min-width: 768px) { .hero-copy { display: block; } }
.hero-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.hero-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 1rem; background: #fff;
}
@media (min-width: 768px) { .hero-card { flex-direction: row; } }
.hero-card-img { width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--paper); }
@media (min-width: 768px) { .hero-card-img { width: 46%; aspect-ratio: auto; } }
.hero-card-img img { height: 100%; width: 100%; object-fit: cover; transition: transform 0.5s; }
.hero-card:hover .hero-card-img img { transform: scale(1.05); }
.hero-card-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 1.25rem; }
@media (min-width: 768px) { .hero-card-body { padding: 1.75rem; } }
.badge {
  display: inline-block; border-radius: 999px; background: var(--flame); color: #fff;
  font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: 0.2em;
  padding: 0.3rem 0.75rem; margin-bottom: 0.75rem; width: fit-content;
}
.hero-card h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
@media (min-width: 768px) { .hero-card h2 { font-size: 1.5rem; } }
.hero-card .blurb { display: none; margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.55; color: var(--ink-soft); }
@media (min-width: 768px) { .hero-card .blurb { display: block; } }
.hero-card-foot { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.price { font-size: 1.25rem; font-weight: 700; color: var(--flame); }
@media (min-width: 768px) { .price { font-size: 1.5rem; } }
.compare { margin-left: 0.5rem; font-size: 0.875rem; color: rgba(68,35,18,0.35); text-decoration: line-through; }
.btn-ink {
  border: none; border-radius: 999px; background: var(--ink); color: var(--cream);
  padding: 0.65rem 1.25rem; font-family: "IBM Plex Mono", monospace;
  font-size: 10px; letter-spacing: 0.15em; transition: background 0.2s; white-space: nowrap;
}
.btn-ink:hover { background: var(--flame); }

/* ---------- Trust strip ---------- */
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding-top: 1.5rem; padding-bottom: 0.5rem; }
@media (min-width: 768px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; gap: 0.75rem; align-items: flex-start; background: #fff; border-radius: 1rem; padding: 1rem; }
.trust-item strong { display: block; font-size: 0.85rem; }
.trust-item span { display: block; margin-top: 0.2rem; font-size: 0.75rem; line-height: 1.45; color: var(--ink-soft); }
.trust-item svg { flex-shrink: 0; margin-top: 0.1rem; }

/* ---------- Product rails ---------- */
.rail-section { padding-top: 3rem; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.rail-head h2 { font-size: 1.35rem; font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; }
.rail-nav { display: flex; gap: 0.5rem; }
.rail-nav button {
  height: 36px; width: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); font-size: 1rem; transition: all 0.2s;
}
.rail-nav button:hover { border-color: var(--flame); color: var(--flame); }
.rail { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.card {
  flex-shrink: 0; width: 240px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1rem; border: 1px solid rgba(68,35,18,0.08); background: #fff;
  transition: box-shadow 0.3s;
}
@media (min-width: 768px) { .card { width: 260px; } }
.card:hover { box-shadow: 0 12px 40px -12px rgba(68,35,18,0.25); }
.card-img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--paper); }
.card-img img { height: 100%; width: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-img .badge { position: absolute; top: 0.75rem; left: 0.75rem; margin: 0; }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1rem; }
.card-cat { font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(68,35,18,0.4); }
.card-name { margin-top: 0.25rem; font-size: 0.95rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.card-blurb {
  margin-top: 0.3rem; font-size: 0.75rem; line-height: 1.5; color: rgba(68,35,18,0.55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stars { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; color: var(--ink-soft); }
.low-stock { margin-top: 0.4rem; font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: 0.15em; color: var(--flame); }
.card-foot { margin-top: auto; padding-top: 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-foot .price { font-size: 1.05rem; }

/* qty stepper */
.stepper { display: flex; align-items: center; gap: 0.15rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem; }
.stepper button { border: none; background: transparent; width: 26px; height: 26px; border-radius: 999px; font-size: 0.9rem; color: var(--ink); }
.stepper button:hover { background: var(--paper); }
.stepper span { min-width: 20px; text-align: center; font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; }

/* ---------- Search results ---------- */
.search-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; }
.search-head h2 { font-size: 1.5rem; font-weight: 700; text-transform: uppercase; }
.search-head button { border: none; background: none; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.2em; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; }
.search-head button:hover { color: var(--flame); }
.empty-note { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; }

/* ---------- Promo banner ---------- */
.promo { padding-top: 3rem; }
.promo-card {
  position: relative; overflow: hidden; border-radius: 1rem; min-height: 240px;
  display: flex; align-items: center; background: var(--inkdeep); color: var(--cream);
}
.promo-card img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; opacity: 0.55; }
.promo-body { position: relative; padding: 2.5rem 2rem; max-width: 30rem; }
.promo-body h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; text-transform: uppercase; line-height: 1; }
.promo-body p { margin-top: 0.75rem; font-size: 0.9rem; line-height: 1.55; color: rgba(247,243,237,0.75); }
.btn-flame {
  display: inline-block; margin-top: 1.5rem; border-radius: 999px; background: var(--flame); color: var(--inkdeep);
  padding: 0.8rem 1.75rem; font-family: "IBM Plex Mono", monospace; font-size: 11px;
  letter-spacing: 0.2em; font-weight: 700; transition: background 0.2s;
}
.btn-flame:hover { background: var(--cream); }

/* ---------- Info section ---------- */
.how { margin-top: 4rem; background: var(--inkdeep); color: var(--cream); }
.how-inner { padding-top: 4rem; padding-bottom: 4rem; }
.how-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }
.how-head h2 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 700; text-transform: uppercase; line-height: 1; }
.how-head p { max-width: 22rem; font-size: 0.875rem; line-height: 1.6; color: rgba(247,243,237,0.6); }
.how-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .how-grid { grid-template-columns: repeat(4, 1fr); } }
.how-step { border-top: 1px solid rgba(247,243,237,0.12); padding-top: 1.25rem; }
.how-step .num { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.2em; color: var(--flame); }
.how-step h3 { margin-top: 0.75rem; font-size: 1.05rem; font-weight: 700; }
.how-step p { margin-top: 0.5rem; font-size: 0.82rem; line-height: 1.6; color: rgba(247,243,237,0.6); }

/* ---------- Footer ---------- */
.site-footer { background: var(--cream); }
.footer-grid { display: grid; gap: 2.5rem; padding-top: 4rem; padding-bottom: 3rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid img { height: 3rem; width: auto; }
.footer-tag { margin-top: 1.25rem; max-width: 18rem; font-size: 0.85rem; line-height: 1.6; color: var(--ink-soft); }
.footer-col h4 { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.25em; color: rgba(68,35,18,0.4); }
.footer-col ul { margin-top: 1rem; list-style: none; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.875rem; }
.footer-col a:hover { color: var(--flame); }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 1.5rem 1rem; max-width: 80rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between;
  font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: 0.2em; color: rgba(68,35,18,0.45);
}

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(42,22,13,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 51; height: 100%; width: 100%; max-width: 28rem;
  background: var(--cream); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.drawer-head button { border: none; background: none; font-size: 1.25rem; color: var(--ink-soft); }
.ship-progress { padding: 1rem 1.25rem; font-size: 0.8rem; background: #fff; border-bottom: 1px solid var(--line); }
.ship-progress .bar { margin-top: 0.5rem; height: 6px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.ship-progress .bar i { display: block; height: 100%; background: var(--flame); border-radius: 999px; transition: width 0.3s; }
.drawer-items { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-line { display: flex; gap: 0.9rem; align-items: center; }
.cart-line img { height: 64px; width: 64px; border-radius: 0.6rem; object-fit: cover; background: var(--paper); }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .name { font-size: 0.85rem; font-weight: 700; line-height: 1.25; }
.cart-line .unit { margin-top: 0.15rem; font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--ink-soft); }
.cart-line .qty { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.cart-line .remove { border: none; background: none; font-size: 0.75rem; color: rgba(68,35,18,0.4); text-decoration: underline; }
.cart-line .remove:hover { color: var(--flame); }
.cart-line .line-total { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.drawer-empty { margin: auto; text-align: center; color: var(--ink-soft); font-size: 0.875rem; }
.drawer-foot { border-top: 1px solid var(--line); padding: 1.25rem; background: #fff; }
.totals { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
.totals .row { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.05rem; font-weight: 700; padding-top: 0.4rem; border-top: 1px dashed var(--line); margin-top: 0.4rem; }
.drawer-foot .actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  border: none; border-radius: 999px; background: #1FA855; color: #fff;
  padding: 0.85rem; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.15em; transition: filter 0.2s;
}
.btn-wa:hover { filter: brightness(1.08); }
.btn-outline {
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  padding: 0.8rem; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.15em; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--flame); color: var(--flame); }
.btn-full { width: 100%; }

/* ---------- Checkout modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(42,22,13,0.6); display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal { background: var(--cream); border-radius: 1rem; padding: 1.5rem; width: 100%; max-width: 32rem; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; }
.modal .sub { margin-top: 0.25rem; font-size: 0.78rem; color: var(--ink-soft); }
.modal .grid2 { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .modal .grid2 { grid-template-columns: 1fr 1fr; } }
.modal input, .modal textarea {
  width: 100%; border-radius: 0.75rem; border: 1px solid var(--line); background: #fff;
  padding: 0.65rem 1rem; font-size: 0.875rem; outline: none; font-family: inherit;
}
.modal input:focus, .modal textarea:focus { border-color: var(--flame); }
.modal textarea { resize: vertical; min-height: 70px; }
.modal .field-note { font-size: 0.72rem; color: var(--ink-soft); margin-top: 0.75rem; }
.modal .error { margin-top: 0.75rem; font-size: 0.8rem; color: #b91c1c; }
.modal .actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.modal .back { border: none; background: none; margin-top: 0.9rem; width: 100%; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.2em; color: var(--ink-soft); }
.success-box { text-align: center; padding: 1.5rem 0; }
.success-box img { height: 4rem; width: 4rem; margin: 0 auto 1.25rem; }
.success-box h3 { font-size: 1.4rem; }
.success-box p { margin: 0.75rem auto 0; max-width: 24rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }
.success-box .order-num { font-family: "IBM Plex Mono", monospace; color: var(--flame); }

/* loading / error */
.status-note { padding: 5rem 1rem; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink-soft); }
.status-note.error { color: #b91c1c; }
