/* ==========================================================
   AK Factory 3D — estilos
   Para cambiar colores, toca solo las variables de :root
   ========================================================== */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --ink: #161616;
  --ink-2: #55534e;
  --ink-3: #8b8984;
  --line: #e4e2dc;
  --accent: #0069fe;        /* azul de marca (logo) */
  --accent-ink: #ffffff;
  --ok: #2f7d5b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --max: 1180px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; display: block;
}
.muted { color: var(--ink-2); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 550;
  transition: transform .15s ease, background .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-block { width: 100%; }
.link-arrow { text-decoration: none; font-weight: 550; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,247,.88); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--ink); }
.cart-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; flex-shrink: 0;
}
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.cart-count.show { display: inline-flex; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; margin-left: auto; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; }

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); margin: 0; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .header-inner { gap: 12px; }
}

/* ---------- Aviso modo demo ---------- */
.demo-bar { background: var(--ink); color: #fff; font-size: .8rem; text-align: center; padding: 8px 16px; }
.demo-bar code { font-family: var(--mono); color: #7fb0ff; }

/* ---------- Secciones ---------- */
section { padding: 88px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 34ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; background: var(--surface-2); position: relative; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-tag {
  position: absolute; left: 18px; bottom: 18px; background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-size: .85rem; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.hero-stats { display: flex; gap: 36px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.5rem; letter-spacing: -0.02em; }
.hero-stats span { font-size: .85rem; color: var(--ink-3); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .hero { padding-top: 40px; } }

/* Categorías */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cat-card {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 130px;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; transition: border-color .15s, transform .15s;
}
.cat-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.cat-card .num { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); }
.cat-card strong { font-size: 1.05rem; }

/* Productos */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; }
.product-card { text-decoration: none; display: flex; flex-direction: column; }
.product-media { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); position: relative; margin-bottom: 14px; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-media img { transform: scale(1.04); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--surface); color: var(--ink); font-size: .72rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.badge.sale { background: var(--accent); color: #fff; }
.badge.out { background: var(--ink); color: #fff; }
.product-cat { font-size: .8rem; color: var(--ink-3); }
.product-name { font-weight: 600; margin: 2px 0 4px; line-height: 1.3; }
.price { font-weight: 600; }
.price del { color: var(--ink-3); font-weight: 400; margin-left: 6px; font-size: .9em; }

/* Proceso */
.process { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.step { padding: 28px 24px 8px 0; border-top: 2px solid var(--ink); margin-right: 20px; }
.step::before { counter-increment: s; content: "0" counter(s); font-family: var(--mono); font-size: .8rem; color: var(--accent); display: block; margin-bottom: 12px; }
.step p { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 20px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { margin-right: 0; } }

/* Bloque personalizado */
.custom-box { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; background: #000; color: #fff; border-radius: 28px; padding: 56px; }
.custom-box .eyebrow { color: #a8a6a0; }
.custom-box p { color: #cfcdc7; }
.custom-form { display: grid; gap: 10px; }
.custom-form input, .custom-form textarea, .custom-form select { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid #3a3936; background: #232321; color: #fff; }
.custom-form textarea { min-height: 96px; resize: vertical; }
.custom-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.custom-form .hint { font-size: .8rem; color: #8f8d87; }
@media (max-width: 860px) { .custom-box { grid-template-columns: 1fr; padding: 32px 22px; } }
@media (max-width: 480px) { .custom-form .row { grid-template-columns: 1fr; } }

/* Sobre nosotros */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.feature-list li:first-child { border-top: 1px solid var(--line); }
.feature-list b { display: block; }
.feature-list span { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Tienda ---------- */
.page-head { padding: 52px 0 26px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 30px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 8px 15px; border-radius: 999px; font-size: .9rem; color: var(--ink-2); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search, .select { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.search { min-width: 200px; }
.empty { text-align: center; color: var(--ink-2); padding: 60px 0; }

/* ---------- Ficha de producto ---------- */
.breadcrumb { font-size: .85rem; color: var(--ink-3); padding: 26px 0 0; }
.breadcrumb a { text-decoration: none; color: var(--ink-2); }
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; padding: 26px 0 80px; }
.gallery-main { aspect-ratio: 1/1; border-radius: 22px; overflow: hidden; background: var(--surface-2); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { width: 74px; height: 74px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); }
.thumbs button.active { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.pdp-price { font-size: 1.5rem; font-weight: 600; margin: 8px 0 22px; }
.pdp-short { color: var(--ink-2); }
.buy-row { display: flex; gap: 12px; margin: 26px 0 18px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { background: none; border: 0; width: 40px; height: 46px; font-size: 1.1rem; }
.qty input { width: 38px; text-align: center; border: 0; background: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row .btn { flex: 1; }
.perks { list-style: none; padding: 0; margin: 22px 0 0; font-size: .9rem; color: var(--ink-2); display: grid; gap: 8px; }
.perks li::before { content: "—"; color: var(--accent); margin-right: 10px; }
.pdp-desc { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 22px; color: var(--ink-2); }
.stock { font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--accent); }
@media (max-width: 860px) { .pdp { grid-template-columns: 1fr; gap: 30px; } }

/* ---------- Carrito ---------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding-bottom: 90px; align-items: start; }
.cart-items { border-top: 1px solid var(--line); }
.cart-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.cart-item .name { font-weight: 600; text-decoration: none; display: block; margin-bottom: 8px; }
.cart-item .remove { background: none; border: 0; color: var(--ink-3); font-size: .85rem; padding: 0; text-decoration: underline; margin-left: 12px; }
.cart-item .qty button { height: 36px; width: 34px; }
.line-total { font-weight: 600; text-align: right; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; position: sticky; top: 90px; }
.summary h3 { margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--ink-2); }
.summary-row.total { color: var(--ink); font-weight: 650; font-size: 1.2rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; margin-bottom: 18px; }
.summary small { display: block; color: var(--ink-3); margin-top: 14px; text-align: center; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 480px) { .cart-item { grid-template-columns: 72px 1fr; } .cart-item img { width: 72px; height: 72px; } .line-total { grid-column: 2; text-align: left; } }

/* ---------- Legal ---------- */
.legal { max-width: 760px; padding-bottom: 90px; }
.legal h2 { font-size: 1.5rem; margin-top: 2em; scroll-margin-top: 90px; }
.legal .todo { background: #fff1c2; padding: 0 4px; border-radius: 4px; }

/* ---------- Pie ---------- */
.site-footer { padding: 64px 0 30px; font-size: .92rem; background: #000; color: #cfcdc7; }
.site-footer .muted { color: #a8a6a0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .75rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 500; margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; color: #cfcdc7; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid #2a2a2a; color: #8b8984; font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px; z-index: 100;
  display: flex; gap: 14px; align-items: center; font-size: .92rem; transition: transform .3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast a { color: #7fb0ff; font-weight: 600; white-space: nowrap; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), #e9e7e1, var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 600px) { section { padding: 60px 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Móvil: dos productos por fila */
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .product-name { font-size: .95rem; }
  .toolbar .search { flex: 1; min-width: 0; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-card { min-height: 96px; padding: 16px; }
}

/* Cabecera: menú a la izquierda, logo a la derecha */
.header-inner .nav { order: 1; margin-left: 0; }
.header-inner .cart-link { order: 2; margin-left: auto; }
.header-inner .brand { order: 3; }
@media (max-width: 760px) {
  .header-inner .menu-toggle { order: 0; margin-left: -8px; }
}