/* ============ STOREFRONT — BLANCO · NEGRO · ROJO ============ */

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: .85rem 2.2rem; background: rgba(246,246,244,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-img { height: 44px; width: 44px; object-fit: cover; display: block; border-radius: 2px; }
.brand-name {
  font-family: var(--font-d); font-size: 1.05rem; letter-spacing: .04em; color: var(--ink);
  text-transform: uppercase; line-height: 1;
}
.brand-name .underscore { color: var(--red); animation: blink 1.6s steps(2) infinite; }
.header-nav { display: flex; align-items: center; gap: .2rem; overflow-x: auto; }
.header-nav button, .header-nav a {
  font-family: var(--font-m); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: transparent; border: 1px solid transparent; color: var(--dim); cursor: pointer;
  padding: .5rem .75rem; white-space: nowrap; transition: color .15s, border-color .15s;
}
.header-nav button:hover, .header-nav a:hover { color: var(--ink); border-color: var(--line2); }
.admin-link { color: var(--red) !important; }
.cart-btn {
  font-family: var(--font-m); font-weight: 700; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--ink); color: var(--ink); cursor: pointer;
  padding: .62rem 1.05rem; display: flex; align-items: center; gap: .65rem; transition: all .18s;
  clip-path: var(--clip);
}
.cart-btn:hover { border-color: var(--red); color: var(--red); box-shadow: 0 8px 20px rgba(225,6,0,.1); }
.cart-count {
  background: var(--red); color: #fff; font-family: var(--font-m); font-size: .76rem;
  min-width: 22px; height: 22px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center;
  clip-path: var(--clip);
}
.cart-count.pop { animation: pulse .6s ease; }

/* --- Marquee --- */
.marquee { overflow: hidden; background: var(--ink); padding: .55rem 0; }
.marquee-track {
  display: flex; gap: 3rem; white-space: nowrap; width: max-content;
  animation: scroll 30s linear infinite; font-family: var(--font-m); font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: #d8d8dc;
}
.marquee-track b { color: var(--red); font-weight: 400; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* --- Hero (negro, serio) --- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
  padding: 5.5rem 2.2rem 5rem; max-width: 1240px; margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-family: var(--font-d); font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: .98;
  text-transform: uppercase; margin: 1.1rem 0 1.4rem; color: var(--ink); letter-spacing: -.01em;
}
.hero p { color: var(--dim); max-width: 46ch; line-height: 1.75; font-size: 1.02rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; }
.hero-status { display: flex; gap: 2.2rem; margin-top: 2.4rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.6rem; }
.hero-status div { font-family: var(--font-m); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.hero-status b { color: var(--ink); display: block; font-size: 1.25rem; font-family: var(--font-d); letter-spacing: 0; }

/* --- Pasos --- */
.steps-section { padding: 2rem 2.2rem 4.5rem; max-width: 1240px; margin: 0 auto; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; margin-top: 1.8rem; }
.step {
  border: 1px solid var(--line); background: var(--bg2); padding: 1.8rem; position: relative;
  transition: all .2s; box-shadow: var(--shadow);
}
.step:hover { border-color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-num {
  font-family: var(--font-d); font-size: 2.6rem; color: transparent; -webkit-text-stroke: 1.5px var(--red);
  position: absolute; top: .7rem; right: 1.2rem;
}
.step h3 { font-family: var(--font-d); font-size: .95rem; letter-spacing: .04em; margin-bottom: .65rem; text-transform: uppercase; }
.step p { color: var(--dim); font-size: .86rem; line-height: 1.7; }

/* --- Catálogo --- */
.catalog { padding: 2rem 2.2rem 5rem; max-width: 1240px; margin: 0 auto; }
.section-title {
  font-family: var(--font-d); font-size: 1.6rem; text-transform: uppercase; letter-spacing: .02em; color: var(--ink);
  margin-bottom: .5rem;
}
.section-title .slash { color: var(--red); }
.section-sub { color: var(--dim); font-family: var(--font-m); font-size: .78rem; letter-spacing: .04em; margin-bottom: 1.8rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.4rem; }
.card {
  background: var(--bg2); border: 1px solid var(--line); position: relative; overflow: hidden;
  transition: all .22s ease; display: flex; flex-direction: column; clip-path: var(--clip);
  cursor: pointer; box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-6px); border-color: var(--ink); box-shadow: var(--shadow-lg); }
.card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #0b0b0d; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; filter: saturate(1.02); }
.card:hover .card-media img { transform: scale(1.045); }
.card-cat {
  position: absolute; top: .7rem; left: .7rem; z-index: 2; background: rgba(11,11,13,.78);
  backdrop-filter: blur(4px); border-color: transparent; color: #e9e9ec;
}
.card-cat::before { color: var(--red); }
.card-stock {
  position: absolute; bottom: .7rem; right: .7rem; z-index: 2;
  font-family: var(--font-m); font-size: .66rem; font-weight: 700; letter-spacing: .08em; padding: .26rem .55rem;
}
.card-stock.ok { background: var(--ink); color: #fff; }
.card-stock.low { background: var(--warn); color: #fff; }
.card-stock.out { background: var(--red); color: #fff; }
.card-barcode {
  position: absolute; top: .85rem; right: .85rem; z-index: 2; height: 20px; width: 40px;
  background: repeating-linear-gradient(90deg, #cfd6e0 0 2px, transparent 2px 4px, #cfd6e0 4px 5px, transparent 5px 8px, #cfd6e0 8px 9px, transparent 9px 12px);
  opacity: .9; mix-blend-mode: screen;
}
.card-body { padding: 1.05rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.card-body h3 { font-family: var(--font-d); font-size: .9rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.card-desc { color: var(--dim); font-size: .8rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: auto; }
.price { font-family: var(--font-d); font-size: 1.25rem; color: var(--ink); }
.price small { font-size: .66rem; color: var(--dim); font-family: var(--font-m); font-weight: 400; display: block; }
.add-btn {
  font-family: var(--font-m); font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--ink); color: var(--ink); cursor: pointer;
  padding: .72rem 1rem; transition: all .18s; clip-path: var(--clip);
}
.add-btn:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 8px 20px rgba(225,6,0,.22); }
.add-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--dim); font-family: var(--font-m); }

/* --- Product modal --- */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; }
.product-media { background: #0b0b0d; min-height: 260px; max-height: 520px; display: flex; align-items: center; justify-content: center; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 1.05rem; }
.product-info h2 { font-family: var(--font-d); font-size: 1.3rem; text-transform: uppercase; line-height: 1.15; color: var(--ink); }
.product-info .price { font-size: 1.9rem; }
.product-info .price small { font-size: .7rem; }
.product-info .desc { color: var(--dim); font-size: .9rem; line-height: 1.7; }
.specs-list { list-style: none; }
.specs-list li {
  font-family: var(--font-m); font-size: .76rem; color: var(--dim); padding: .38rem 0;
  border-bottom: 1px dashed var(--line2); display: flex; align-items: center; gap: .6rem;
}
.specs-list li:before { content: "▸"; color: var(--red); }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--ink); width: fit-content; }
.stepper button {
  width: 40px; height: 40px; background: transparent; border: none; color: var(--ink); cursor: pointer;
  font-family: var(--font-m); font-size: 1.05rem; transition: all .15s;
}
.stepper button:hover { background: var(--ink); color: #fff; }
.stepper input { width: 56px; height: 40px; text-align: center; background: transparent; border: none; color: var(--ink); font-family: var(--font-m); outline: none; }

/* --- Footer (negro) --- */
.site-footer { background: var(--ink); padding: 3.5rem 2.2rem 2rem; margin-top: 1rem; }
.footer-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: start; }
.footer-brand { display: flex; align-items: flex-start; gap: 1rem; }
.footer-brand .brand-img { height: 64px; width: 64px; }
.footer-brand h3 { font-family: var(--font-d); font-size: 1.15rem; color: #fff; margin-bottom: .8rem; text-transform: uppercase; }
.footer-brand p { color: #9d9da2; font-size: .86rem; line-height: 1.7; max-width: 44ch; }
.footer-brand .mono { font-size: .78rem; }
.footer-brand .t-green { color: #4fd17b; } .footer-brand .t-cyan { color: #e9e9ec; }
.footer-term .terminal { border-color: rgba(255,255,255,.14); }
.footer-term .terminal-body { min-height: 110px; font-size: .72rem; }
.footer-copy { text-align: center; margin-top: 2.8rem; color: #77777d; font-family: var(--font-m); font-size: .7rem; letter-spacing: .14em; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.6rem; text-transform: uppercase; }
.footer-copy .red { color: var(--red); }

/* ==== Carrito drawer ==== */
.cart-items { flex: 1; overflow: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.cart-item { display: grid; grid-template-columns: 74px 1fr auto; gap: .9rem; border: 1px solid var(--line); padding: .7rem; background: #fff; }
.cart-item img { width: 74px; height: 66px; object-fit: cover; }
.cart-item .ci-name { font-size: .86rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.cart-item .ci-price { font-family: var(--font-m); font-size: .76rem; color: var(--dim); margin-top: .2rem; }
.cart-item .ci-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ci-qty { display: flex; align-items: center; gap: .1rem; border: 1px solid var(--line2); }
.ci-qty button { width: 26px; height: 26px; background: transparent; border: none; color: var(--ink); cursor: pointer; font-family: var(--font-m); }
.ci-qty button:hover { background: var(--ink); color: #fff; }
.ci-qty span { font-family: var(--font-m); font-size: .8rem; min-width: 24px; text-align: center; }
.ci-del { background: transparent; border: none; color: var(--dim); cursor: pointer; font-family: var(--font-m); font-size: .9rem; }
.ci-del:hover { color: var(--red); }
.cart-empty { text-align: center; color: var(--dim); font-family: var(--font-m); padding: 3rem 1rem; }
.cart-footer { border-top: 1px solid var(--line); padding: 1.1rem 1.2rem 1.3rem; background: var(--panel2); }
.cart-line { display: flex; justify-content: space-between; font-size: .86rem; color: var(--dim); margin-bottom: .4rem; font-family: var(--font-m); }
.cart-total { display: flex; justify-content: space-between; font-family: var(--font-d); font-size: 1.2rem; margin: .7rem 0 1rem; }
.cart-total .price { font-size: 1.3rem; }
.mp-badge-row { display: flex; align-items: center; gap: .5rem; font-family: var(--font-m); font-size: .7rem; color: var(--dim); margin-top: .8rem; }
.mp-badge { background: #009ee3; color: #fff; font-weight: 700; border-radius: 3px; padding: .16rem .45rem; font-size: .68rem; }

/* ==== Checkout ==== */
.checkout-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.5rem; padding: 1.4rem 1.6rem; }
.check-summary { background: var(--panel2); border: 1px solid var(--line2); padding: 1.15rem; height: fit-content; }
.check-summary h4 { font-family: var(--font-d); font-size: .8rem; margin-bottom: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.check-summary .cs-row { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .55rem; }
.check-summary .cs-row.total { border-top: 1px solid var(--line2); padding-top: .8rem; margin-top: .8rem; font-family: var(--font-d); font-size: 1.05rem; }
.loading-overlay { position: absolute; inset: 0; background: rgba(11,11,13,.9); display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; z-index: 5; text-align: center; color: #fff; }
.loading-overlay .mono { color: #fff !important; }
.spinner { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==== Media queries ==== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .product-grid, .checkout-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header { padding: .7rem 1rem; flex-wrap: wrap; }
  .brand-img { height: 36px; width: 36px; }
  .header-nav { order: 3; width: 100%; }
  .catalog, .hero, .steps-section { padding-left: 1rem; padding-right: 1rem; }
}