/*
  ============================================================
  THIS FILE IS CSS (Cascading Style Sheets).

  HTML decides WHAT is on the page.
  CSS decides HOW it looks.

  A CSS rule looks like this:

      selector {
        property: value;
      }

  The selector points at HTML (a tag, a class, or an id).
  Classes start with a dot:   .card
  Ids start with a hash:      #product-grid
  Tags have no prefix:        header

  "Cascading" means more than one rule can apply. When they
  fight, the more specific one wins. That is why a class
  like .btn-primary can override the generic .btn.

  Colors, fonts, and spacing for the whole shop live in
  :root below. Change those variables to restyle the site
  without hunting through the rest of the file.
  ============================================================
*/

:root {
  --bg: #0b0f14;
  --bg-2: #121820;
  --bg-card: #171f28;
  --bg-elev: #1d2732;
  --line: rgba(94, 234, 212, 0.16);
  --text: #eef4f8;
  --muted: #9aa8b5;
  --cyan: #5eead4;
  --cyan-dim: #2dd4bf;
  --amber: #fb923c;
  --pink: #fb7185;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Syne", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 50%),
    radial-gradient(700px 380px at 100% 0%, rgba(251, 146, 60, 0.10), transparent 45%),
    var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--cyan);
  color: #042f2e;
  padding: 8px 12px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* ----- header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 20, 0.78);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

.logo:hover {
  text-decoration: none;
}

.logo-cube {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}

.cart-btn:hover {
  border-color: var(--cyan);
}

.cart-count {
  background: var(--amber);
  color: #1a0b00;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ----- hero ----- */

.hero {
  position: relative;
  min-height: 420px;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 15, 20, 0.15), rgba(11, 15, 20, 0.88)),
    repeating-linear-gradient(
      to bottom,
      transparent 0 3px,
      rgba(0, 0, 0, 0.10) 3px 4px
    );
}

.hero-copy {
  position: relative;
  padding: 72px 0 48px;
}

.eyebrow {
  color: var(--cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0 0 10px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 0.95;
  margin: 0 0 14px;
  max-width: 14ch;
}

.hero p {
  max-width: 42ch;
  color: #d5dee6;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ----- buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
  color: #042f2e;
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--cyan);
}

.text-btn {
  background: none;
  border: 0;
  color: var(--pink);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* ----- shared sections ----- */

section {
  padding: 72px 0;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0 0 8px;
}

.lede {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 60ch;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.step-num {
  color: var(--amber);
  font-family: var(--display);
  font-size: 1.4rem;
}

.step h3 {
  margin: 8px 0 6px;
}

.step p {
  margin: 0;
  color: var(--muted);
}

/* ----- shop toolbar ----- */

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

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

.filter-btn,
.search {
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
}

.filter-btn {
  cursor: pointer;
}

.filter-btn-active {
  background: rgba(94, 234, 212, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
}

.search {
  min-width: 220px;
}

.search:focus,
.filter-btn:focus,
.btn:focus,
.cart-btn:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ----- product grid ----- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 234, 212, 0.4);
}

.card-image-btn {
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #0a0d11;
}

.card-image-btn img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  background: var(--amber);
  color: #1a0b00;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

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

.card-category {
  margin: 0;
  color: var(--cyan);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-meta,
.card-price {
  margin: 0;
}

.card-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-price {
  font-weight: 700;
  margin-top: 6px !important;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.qty-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.qty-input {
  width: 56px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font: inherit;
}

.empty-note {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

/* ----- FAQ / extra ----- */

.faq {
  display: grid;
  gap: 10px;
}

details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details p {
  color: var(--muted);
  margin: 10px 0 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ----- overlays ----- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.overlay[hidden],
#toast[hidden],
#cart-empty[hidden],
#product-empty[hidden],
#cart-footer[hidden],
#address-wrap[hidden],
#email-warning[hidden],
#cart-tax-row[hidden],
#checkout-tax-row[hidden] {
  display: none !important;
}

.overlay-panel,
.cart-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  padding: 22px;
}

#cart-overlay {
  place-items: stretch;
  justify-items: end;
  padding: 0;
}

.cart-panel {
  width: min(460px, 100%);
  height: 100%;
  max-height: none;
  border-radius: 22px 0 0 22px;
}

.overlay-head,
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.overlay-head h2,
.cart-head h2 {
  margin: 0;
  font-family: var(--display);
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-facts strong {
  color: var(--text);
  display: block;
}

/* ----- cart lines ----- */

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}

.cart-line img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-line-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.cart-line-info span {
  color: var(--muted);
}

.cart-line-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-line-qty button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.cart-line-side {
  text-align: right;
  display: grid;
  gap: 6px;
}

.totals {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  color: var(--muted);
}

.totals div {
  display: flex;
  justify-content: space-between;
}

.totals .grand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 14px;
}

/* ----- form ----- */

.form-grid {
  display: grid;
  gap: 12px;
}

label.field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

label.field span {
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.choice-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.choice {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.checkout-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 6px;
}

.checkout-items li {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.warning {
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: #ffd7b0;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#order-preview {
  width: 100%;
  min-height: 90px;
  margin-top: 12px;
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 0.8rem;
}

/* ----- toast ----- */

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--cyan);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 50;
  box-shadow: var(--shadow);
}

/* ----- extras strip ----- */

.extras {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.panel h3 {
  margin-top: 0;
}

code, .mono {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 0.86em;
  background: rgba(94, 234, 212, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps,
  .extras,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .nav .hide-sm {
    display: none;
  }
}

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

  .hero {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }
}
