/* ============================================================
   TACTILE3D — style.css
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --cream:   #F8F5EF;
  --white:   #FFFFFF;
  --coral:   #FF7A59;
  --coral-light: #FFF0EB;
  --teal:    #6FB6B6;
  --teal-light: #EEF7F7;
  --charcoal:#333333;
  --gray:    #CFCFCF;
  --gray-mid:#888888;
  --wa-green:#25D366;
  --shadow:  0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius:  12px;
  --radius-lg: 20px;
  --radius-pill: 100px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  font-size: 15px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── Utility ────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  border: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--coral); color: var(--white); }
.btn-primary:hover { opacity: 0.9; }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { opacity: 0.9; }
.btn-outline { background: transparent; color: var(--coral); border: 2px solid var(--coral); }
.btn-outline:hover { background: var(--coral-light); }
.btn-wa { background: var(--wa-green); color: var(--white); font-size: 15px; }
.btn-wa:hover { opacity: 0.9; }
.btn-full { width: 100%; text-align: center; display: block; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 36px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { font-weight: 600; font-size: 14px; color: var(--charcoal); }
.nav-links a:hover { color: var(--coral); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 60px 20px 40px;
  display: flex;
  justify-content: center;
}
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--charcoal);
}
.hero-sub {
  color: var(--gray-mid);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.7;
}
.hero-slider {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%; /* 1:1 square — padding-based ratio works even where the
                         aspect-ratio CSS property doesn't (e.g. older Opera
                         Mobile), avoiding a collapsed-height overflow bug */
  margin-top: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: pan-y;
}
.hero-slider .product-card__dots { bottom: 14px; }
.hero-slider .product-card__dot { width: 8px; height: 8px; }

/* ── Catalog section ─────────────────────────────────────────── */
.catalog {
  padding: 60px 0 80px;
}
.catalog h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--charcoal);
}

/* ── Filter tabs ─────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.tab {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--gray);
  color: var(--charcoal);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
}
.tab:hover { border-color: var(--coral); color: var(--coral); }
.tab.active { background: var(--coral); border-color: var(--coral); color: var(--white); }

/* ── Product grid ────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card__media {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%; /* square ratio via padding — see .hero-slider comment */
  background: var(--cream);
  overflow: hidden;
}
.product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.product-card__img.active { opacity: 1; }
.product-card__media { cursor: pointer; }
.product-card__dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  z-index: 2;
}
.product-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  border: none;
  cursor: pointer;
  padding: 0;
}
.product-card__dot.active { background: var(--white); }
.product-card__body { padding: 14px; }
.product-card__name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--charcoal);
}
.product-card__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--coral);
  margin-bottom: 12px;
}
.product-card__btn {
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity .2s;
}
.product-card__btn--regular {
  background: var(--coral);
  color: var(--white);
}
.product-card__btn--custom {
  background: var(--teal);
  color: var(--white);
}
.product-card__btn:hover { opacity: 0.88; }

/* ── Product modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 18px;
  color: var(--gray-mid);
  cursor: pointer;
  background: var(--white);
  border: none;
  line-height: 1;
  z-index: 1;
}
.modal-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.modal-body { padding: 20px; }
.modal-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.modal-body p { color: var(--gray-mid); font-size: 13px; margin-bottom: 12px; }
.modal-price { font-size: 1.1rem; font-weight: 700; color: var(--coral) !important; margin-bottom: 16px !important; }

/* ── Product detail popup ─────────────────────────────────────── */
.detail-card { max-width: 520px; }
.detail-media {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%; /* square ratio via padding — see .hero-slider comment */
  background: var(--cream);
  overflow: hidden;
}
.detail-media .product-card__dots { bottom: 12px; }
.detail-media .product-card__dot { width: 8px; height: 8px; }
.detail-media__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow);
  z-index: 2;
}
.detail-media__nav:hover { background: var(--white); }
.detail-media__nav--prev { left: 10px; }
.detail-media__nav--next { right: 10px; }

/* ── Checkout form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--charcoal); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--gray);
  font-family: inherit;
  font-size: 14px;
  color: var(--charcoal);
  outline: none;
  transition: border-color .2s;
}
.form-input:focus { border-color: var(--coral); }
.form-error {
  color: #e0453c;
  font-size: 12px;
  font-weight: 600;
  margin: -6px 0 12px;
  display: none;
}
.form-error.show { display: block; }

/* ── Qty stepper ─────────────────────────────────────────────── */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.qty-stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--gray);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.qty-stepper button:hover { border-color: var(--coral); color: var(--coral); }
.qty-stepper span { font-size: 18px; font-weight: 700; min-width: 28px; text-align: center; }

/* ── Cart drawer ─────────────────────────────────────────────── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
}
.drawer-overlay.open { display: block; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--white);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: var(--shadow-lg);
}
.cart-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--gray);
}
.drawer-header h3 { font-size: 1rem; font-weight: 700; }
.drawer-header button { font-size: 18px; color: var(--gray-mid); }
.drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-empty {
  text-align: center;
  color: var(--gray-mid);
  padding: 40px 0;
}
.drawer-empty p { margin-bottom: 12px; font-size: 14px; }
.cart-item {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.cart-item__name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.cart-item__config { font-size: 11px; color: var(--gray-mid); line-height: 1.5; margin-bottom: 6px; }
.cart-item__controls { display: flex; align-items: center; gap: 8px; }
.cart-item__controls .qty-stepper { margin: 0; }
.cart-item__controls .qty-stepper button { width: 28px; height: 28px; font-size: 14px; }
.cart-item__controls .qty-stepper span { font-size: 14px; }
.cart-item__remove { font-size: 16px; color: var(--gray-mid); cursor: pointer; align-self: start; padding: 2px; }
.cart-item__remove:hover { color: var(--coral); }
.drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--gray);
}

/* ── Floating cart button ─────────────────────────────────────── */
.float-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--coral);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 14px 20px;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: transform .2s;
}
.float-cart:hover { transform: scale(1.05); }
.cart-badge {
  background: var(--white);
  color: var(--coral);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-badge.hidden { display: none; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--charcoal);
  color: var(--white);
  padding: 48px 20px 32px;
  text-align: center;
}
.footer-logo {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.footer-logo span { color: var(--coral); }
.footer-tagline {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 28px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}
.footer-links a {
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .2s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy { color: var(--gray-mid); font-size: 12px; }

/* ── Configurator pages ──────────────────────────────────────── */
.configurator-page { background: var(--cream); }
.configurator-main { padding: 32px 0 80px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-mid);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: color .2s;
}
.back-link:hover { color: var(--coral); }
.config-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.config-subtitle {
  color: var(--gray-mid);
  font-size: 14px;
  margin-bottom: 6px;
}
.config-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 32px;
}

/* ── Steps ───────────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 12px; }
.step {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color .2s;
}
.step.active { border-color: var(--coral); }
.step.completed { border-color: var(--gray); }
.step.locked { opacity: 0.45; pointer-events: none; }
.options-grid--disabled { opacity: 0.45; pointer-events: none; }
.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step.completed .step-num { background: var(--teal); }
.step.completed .step-num::after { content: '✓'; }
.step-title { font-weight: 700; font-size: 14px; flex: 1; }
.step-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-light);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-body {
  padding: 0 20px 20px;
  display: block;
}
.step.completed .step-body { display: none; }
.step-hint { font-size: 13px; color: var(--gray-mid); margin-bottom: 16px; }
.step-next-btn { margin-top: 20px; }
.step-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.char-input:focus { border-color: var(--coral) !important; box-shadow: 0 0 0 3px rgba(255,122,89,0.15); }
.char-inputs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.sub-label { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--charcoal); }

/* ── Option grids (shapes, keyrings, accessories) ─────────────── */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.option-item {
  border: 2px solid var(--gray);
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--white);
}
.option-item img { width: 52px; height: 52px; object-fit: contain; margin: 0 auto 6px; border-radius: 8px; }
.option-item span { font-size: 11px; font-weight: 600; color: var(--charcoal); display: block; }
.option-item:hover { border-color: var(--coral); }
.option-item.selected { border-color: var(--coral); background: var(--coral-light); }
.option-item.selected span { color: var(--coral); }
.option-item.multi-selected { border-color: var(--teal); background: var(--teal-light); }

/* ── Color grids ─────────────────────────────────────────────── */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  position: relative;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: var(--coral); transform: scale(1.15); }
.color-swatch::after {
  content: attr(data-name);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  color: var(--gray-mid);
  pointer-events: none;
  display: none;
}
.color-swatch:hover::after, .color-swatch.selected::after { display: block; }

.color-swatch-wrap { position: relative; }
.color-swatch__preview {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray);
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 1;
}
.color-swatch__preview:hover { border-color: var(--coral); }

/* ── Color preview modal (real filament photo) ────────────────── */
.color-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.color-preview-overlay.open { display: flex; }
.color-preview-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 320px;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.color-preview-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 16px;
  color: var(--white);
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  z-index: 1;
}
.color-preview-img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.color-preview-name {
  padding: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--charcoal);
}

/* ── Length grid ─────────────────────────────────────────────── */
.length-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.length-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 2px solid var(--gray);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.length-btn:hover { border-color: var(--coral); color: var(--coral); }
.length-btn.selected { border-color: var(--coral); background: var(--coral-light); color: var(--coral); }

/* ── Config summary box (Step 7) ─────────────────────────────── */
.config-summary-box {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 12px;
  line-height: 2;
  color: var(--charcoal);
}
.config-summary-box strong { color: var(--coral); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet (480px – 768px) ─────────────────────────────────── */
@media (min-width: 480px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .options-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ── Desktop (769px+) ───────────────────────────────────────── */
@media (min-width: 769px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 80px 20px 60px; }
  .hero-card { padding: 60px 56px; }
  .hero h1 { font-size: 1.9rem; }
  .catalog { padding: 80px 0 100px; }
  .catalog h2 { font-size: 2rem; }
  .config-title { font-size: 2rem; }
  .options-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ── Mobile cart drawer (slides from bottom) ────────────────── */
@media (max-width: 479px) {
  .cart-drawer {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 80vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .cart-drawer.open { transform: translateY(0); }
  .float-cart { bottom: 16px; right: 16px; padding: 12px 16px; font-size: 18px; }
  .hero-card { padding: 32px 24px; }
  .hero h1 { font-size: 1.3rem; }
  .nav { padding: 12px 16px; }
}

/* ── Modal full-screen on mobile ────────────────────────────── */
@media (max-width: 479px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { border-radius: 20px 20px 0 0; max-height: 90vh; }
}
