/* ============================================================
   style.css — CentroMaker3D
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a14;
  --bg-alt: #12121f;
  --bg-card: #15152a;
  --line: #26263f;
  --blue: #00c8ff;
  --purple: #9333ea;
  --purple-deep: #6d28d9;
  --white: #f5f5fa;
  --muted: #a1a1b8;
  --success: #22c55e;
  --error: #f87171;
  --grad: linear-gradient(135deg, var(--blue), var(--purple));
  --radius: 14px;
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Official logo ---------- */
.cm-logo-image { object-fit: contain; flex-shrink: 0; }
.cm-logo-image-nav { width: 38px; height: 44px; }
.cm-logo-image-footer { width: 54px; height: 68px; margin-bottom: 8px; }

/* ---------- Navbar ---------- */
#cm-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.cm-nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.cm-brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.cm-brand-text { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.cm-menu-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; width: 40px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center;
}
.cm-burger, .cm-burger::before, .cm-burger::after {
  width: 18px; height: 2px; background: var(--white); display: block; position: relative;
}
.cm-burger::before, .cm-burger::after { content: ''; position: absolute; left: 0; }
.cm-burger::before { top: -6px; }
.cm-burger::after { top: 6px; }
.cm-menu { display: flex; align-items: center; gap: 24px; }
.cm-links { display: flex; gap: 20px; }
.cm-nav-link { color: var(--muted); font-weight: 500; font-size: 0.95rem; padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.cm-nav-link:hover, .cm-nav-link.is-active { color: var(--white); border-color: var(--blue); }
.cm-nav-actions { display: flex; align-items: center; gap: 10px; }
.cm-icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--line); color: var(--white);
  padding: 7px 12px; border-radius: 999px; font-size: 0.88rem; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.cm-icon-btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.cm-badge {
  background: var(--grad); color: #fff; font-size: 0.7rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 4px;
}

@media (max-width: 780px) {
  .cm-menu-toggle { display: inline-flex; }
  .cm-menu {
    position: fixed; inset: 62px 0 auto 0; background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 16px 20px 24px;
    gap: 16px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  .cm-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .cm-links { flex-direction: column; gap: 12px; }
  .cm-nav-actions { flex-direction: column; align-items: stretch; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 70px 0 60px;
  background:
    radial-gradient(circle at 85% 20%, rgba(147, 51, 234, 0.25), transparent 55%),
    radial-gradient(circle at 10% 80%, rgba(0, 200, 255, 0.18), transparent 50%);
}
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-eyebrow { color: var(--blue); font-weight: 600; font-size: 0.95rem; }
.hero h1 { margin-top: 6px; }
.hero-tagline { font-size: 1.1rem; color: var(--white); opacity: 0.85; max-width: 46ch; }
.hero-desc { max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-visual {
  aspect-ratio: 1 / 1; border-radius: 24px; position: relative;
  background: linear-gradient(160deg, #0d0d1c, #17172d);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 60px rgba(147, 51, 234, 0.25), 0 0 30px rgba(0, 200, 255, 0.12) inset;
}
.cm-logo-image-hero { width: min(72%, 270px); height: min(82%, 330px); filter: drop-shadow(0 0 18px rgba(0, 200, 255, 0.22)); }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 280px; margin: 0 auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35); }
.btn-secondary { background: transparent; border-color: var(--line); color: var(--white); }
.btn-secondary:hover { border-color: var(--blue); }
.btn-whatsapp { background: #16171f; border-color: var(--blue); color: var(--white); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: rgba(0, 200, 255, 0.4); }

.product-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.product-thumb {
  aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(145deg, #14142a, #1c1c36);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem;
  border: 1px dashed var(--line); overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-name { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.product-price { color: var(--blue); font-weight: 600; }
.product-cat { font-size: 0.78rem; color: var(--muted); }

.badge-soft {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem;
  background: rgba(147, 51, 234, 0.15); color: #d8b4fe; border: 1px solid rgba(147, 51, 234, 0.35);
}

/* ---------- Steps (Cómo comprar) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step-num {
  width: 34px; height: 34px; border-radius: 999px; background: var(--grad);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; font-family: var(--font-head);
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
input, textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--white); font-family: var(--font-body); font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; }
.field-error { color: var(--error); font-size: 0.82rem; margin-top: 6px; display: none; }
.field-error.is-visible { display: block; }
.form-msg { padding: 12px 14px; border-radius: 10px; margin-top: 12px; font-size: 0.9rem; display: none; }
.form-msg.is-visible { display: block; }
.form-msg.success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.form-msg.error { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: #fca5a5; }
.form-card { max-width: 480px; margin: 0 auto; }

/* ---------- Filters (catálogo) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter-chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--muted); cursor: pointer; font-size: 0.88rem;
}
.filter-chip.is-active { border-color: var(--blue); color: var(--white); background: rgba(0, 200, 255, 0.08); }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; } }
.product-gallery-main {
  aspect-ratio: 1/1; border-radius: var(--radius); background: linear-gradient(145deg, #14142a, #1c1c36);
  border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: var(--muted);
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.thumb-btn { width: 60px; height: 60px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-card); cursor: pointer; overflow: hidden; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.product-meta-list { list-style: none; padding: 0; margin: 18px 0; }
.product-meta-list li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.product-meta-list strong { color: var(--white); }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.qty-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-card); color: var(--white); cursor: pointer; font-size: 1.1rem; }
.qty-input { width: 60px; text-align: center; }

/* ---------- Cart table ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.cart-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: none; }
.cart-summary { max-width: 380px; margin-left: auto; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); }
.cart-summary-row.total { color: var(--white); font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-question { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-family: var(--font-head); font-weight: 600; color: var(--white); background: none; border: none; width: 100%; text-align: left; font-size: 1rem; padding: 0; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .2s ease; color: var(--muted); }
.faq-item.is-open .faq-answer { max-height: 300px; margin-top: 10px; }
.faq-icon { transition: transform .2s ease; }
.faq-item.is-open .faq-icon { transform: rotate(45deg); }

/* ---------- Footer ---------- */
#cm-footer { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 60px; }
.cm-footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 48px 20px 24px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px;
}
@media (max-width: 780px) { .cm-footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .cm-footer-inner { grid-template-columns: 1fr; } }
.cm-footer-brand { margin-top: 14px; max-width: 30ch; }
.cm-footer-col h3 { font-size: 0.85rem; color: var(--muted); text-transform: none; margin-bottom: 12px; }
.cm-footer-col a, .cm-footer-col p { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--muted); }
.cm-footer-bottom { text-align: center; padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }

/* ---------- WhatsApp float ---------- */
.cm-whatsapp-float {
  position: fixed; bottom: 22px; right: 22px; width: 56px; height: 56px; border-radius: 999px;
  background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.45); z-index: 60; transition: transform .15s;
}
.cm-whatsapp-float:hover { transform: scale(1.06); }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 30px; }
@media (max-width: 780px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-tabs { display: flex; flex-direction: column; gap: 6px; }
.admin-tab-btn {
  text-align: left; padding: 10px 14px; border-radius: 10px; background: var(--bg-card);
  border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 0.92rem;
}
.admin-tab-btn.is-active { color: var(--white); border-color: var(--blue); background: rgba(0,200,255,0.08); }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.table-simple { width: 100%; border-collapse: collapse; }
.table-simple th, .table-simple td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 0.88rem; text-align: left; }
.table-simple th { color: var(--muted); font-weight: 600; }
.table-actions { display: flex; gap: 8px; }
.mini-btn { padding: 5px 10px; font-size: 0.8rem; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-card); color: var(--white); cursor: pointer; }
.mini-btn.danger { border-color: var(--error); color: var(--error); }
.gate-screen { min-height: 60vh; display: flex; align-items: center; justify-content: center; }

.pending-note {
  border: 1px dashed rgba(0,200,255,0.4); background: rgba(0,200,255,0.06);
  border-radius: 10px; padding: 14px 16px; font-size: 0.85rem; color: var(--muted); margin: 20px 0;
}
