/* ============================================================
   DALITPOWER Store — Phase 1
   Brand: dark navy #0a0f1a · red #e60000 · blue #0099ff
   ============================================================ */
:root {
  --bg: #0a0f1a;
  --bg-2: #0e1626;
  --panel: #121c30;
  --panel-2: #16223a;
  --line: #243350;
  --text: #eef3fb;
  --muted: #8a9ab5;
  --red: #e60000;
  --red-2: #ff3333;
  --blue: #0099ff;
  --green: #00cc66;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: min(1200px, 92%); margin: 0 auto; }
.view { flex: 1; }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--red), #a30000);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  padding: 6px 12px;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}
.header__logo {
  display: inline-flex;
  align-items: center;
}
.header__logo img { height: 84px; width: auto; display: block; }
.header__nav { display: flex; align-items: center; gap: 22px; }
.header__nav a {
  font-weight: 600;
  font-size: .95rem;
  color: #45536e;
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.header__nav a:hover, .header__nav a.active { color: var(--red); }
.header__cart { position: relative; }
.cart-badge {
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.lang-toggle {
  background: #eef2f8;
  border: 1px solid #d4dce8;
  color: #0a0f1a;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: .85rem;
  transition: border-color .2s;
  cursor: pointer;
  font-family: inherit;
  height: 33px;
}
.lang-toggle:focus { outline: none; border-color: var(--blue); }
.lang-toggle:hover { border-color: var(--blue); }
.header__burger {
  display: none;
  background: none;
  border: none;
  color: #0a0f1a;
  font-size: 1.6rem;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(0, 153, 255, .18), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(230, 0, 0, .16), transparent 60%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 60px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  max-width: 820px;
}
.hero h1 .accent { color: var(--red-2); }
.hero p.sub {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 18px 0 30px;
  max-width: 640px;
}
.hero__search {
  display: flex;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero__search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 16px 18px;
}
.hero__search input::placeholder { color: var(--muted); }
.hero__search button {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0 26px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s;
}
.hero__search button:hover { background: var(--red-2); }
.hero__hint { color: var(--muted); font-size: .85rem; margin-top: 12px; }
.hero__hint code {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--blue);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 34px 0 0;
}
.trust-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.trust-card .ico {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 153, 255, .12);
  color: var(--blue);
}
.trust-card h3 { font-size: .98rem; margin-bottom: 3px; }
.trust-card p { color: var(--muted); font-size: .85rem; }

/* ---------- Sections ---------- */
.section { padding: 58px 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section__head h2 { font-size: 1.6rem; letter-spacing: -.01em; }
.section__head a { color: var(--blue); font-weight: 600; font-size: .92rem; white-space: nowrap; }

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.cat-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--blue); }
.cat-card h3 { font-size: 1.15rem; margin: 14px 0 6px; }
.cat-card p { color: var(--muted); font-size: .9rem; }
.cat-card .count {
  position: absolute; top: 18px; right: 18px;
  background: rgba(230, 0, 0, .15);
  color: var(--red-2);
  font-size: .78rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.cat-card .art { height: 120px; }

/* ---------- Product grid & card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--blue); }
.card__img { aspect-ratio: 4/3; background: var(--bg); }
.card__img img, .card__img svg { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__sku {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--blue); text-transform: uppercase;
}
.card__name { font-size: .98rem; font-weight: 600; line-height: 1.35; }
.card__oe {
  font-size: .74rem; color: var(--muted); font-weight: 600;
  letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__price { font-size: 1.2rem; font-weight: 800; color: #fff; }
.card__price small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.btn {
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  padding: 11px 16px;
  transition: background .2s, border-color .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn--primary { background: var(--red); color: #fff; flex: 1; }
.btn--primary:hover { background: var(--red-2); }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
}
.btn--ghost:hover { border-color: var(--blue); }
.btn--block { width: 100%; }
.btn--wa { background: var(--green); color: #04220f; }
.btn--wa:hover { background: #00e673; }

/* ---------- Catalog page ---------- */
.catalog-head { padding: 40px 0 20px; }
.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 18px 0 26px;
}
.catalog-tools input[type="search"] {
  flex: 1;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 13px 16px;
  font-size: .95rem;
  outline: none;
}
.catalog-tools input[type="search"]:focus { border-color: var(--blue); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
}
.chip.active, .chip:hover { color: #fff; border-color: var(--red); }
.chip.active { background: rgba(230, 0, 0, .14); }
.results-meta { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong { color: var(--text); display: block; margin-bottom: 6px; font-size: 1.1rem; }

/* ---------- Product detail ---------- */
.pd { padding: 40px 0 70px; }
.pd__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.pd__media {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 96px;
}
.pd__media #pd-main-img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fff; display: block; cursor: zoom-in; }
#lightbox { position: fixed; inset: 0; background: rgba(8, 12, 22, .94); display: none; align-items: center; justify-content: center; z-index: 999; padding: 24px; }
#lightbox.is-open { display: flex; }
#lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; background: #fff; border-radius: 8px; cursor: zoom-in; transition: transform .18s ease; }
#lightbox img.zoomed { transform: scale(2.2); cursor: zoom-out; max-width: none; max-height: none; }
.pd-thumbs { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid var(--line); }
.pd-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 2px solid var(--line); cursor: pointer; transition: border-color .15s ease; }
.pd-thumb:hover { border-color: var(--blue); }
.pd-thumb.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(30, 90, 200, .25); }
.pd__sku { color: var(--blue); font-weight: 700; letter-spacing: .06em; font-size: .82rem; text-transform: uppercase; }
.pd h1 { font-size: 1.7rem; line-height: 1.2; margin: 8px 0 12px; }
.pd__price { font-size: 2rem; font-weight: 800; margin-bottom: 4px; }
.pd__price small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.pd__stock { color: var(--green); font-weight: 600; font-size: .9rem; margin-bottom: 18px; }
.pd__desc { color: var(--muted); margin-bottom: 22px; }
.pd__buy { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.qty button {
  background: none; border: none; color: #fff;
  width: 38px; height: 100%; font-size: 1.1rem;
}
.qty input {
  width: 52px; text-align: center;
  background: transparent; border: none; color: #fff;
  font-size: 1rem; font-weight: 700;
}
.pd__buy .btn--primary { flex: 1; font-size: 1rem; }
.pd__ship-note {
  background: rgba(0, 153, 255, .08);
  border: 1px solid rgba(0, 153, 255, .3);
  color: #bfe0ff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .88rem;
  margin-bottom: 26px;
}

.spec-table, .xref-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 26px;
  font-size: .92rem;
}
.spec-table caption, .xref-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 12px;
  color: #fff;
}
.spec-table th, .spec-table td,
.xref-table th, .xref-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.spec-table th { color: var(--muted); font-weight: 600; width: 42%; }
.xref-table th { color: var(--muted); font-weight: 600; }
.xref-table td.oe { font-family: Consolas, monospace; color: var(--blue); font-weight: 600; }
.xref-table tr:hover td { background: rgba(255, 255, 255, .02); }
.copy-oe {
  background: none; border: none; color: var(--muted);
  margin-left: 8px; font-size: .85rem;
}
.copy-oe:hover { color: var(--blue); }

/* ---------- Cart ---------- */
.cart-page { padding: 40px 0 70px; }
.cart-page h1 { font-size: 1.8rem; margin-bottom: 26px; }
.cart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 30px; align-items: start; }
.cart-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.cart-item__img { width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.cart-item__img img, .cart-item__img svg { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3 { font-size: .95rem; margin-bottom: 3px; }
.cart-item .sku { color: var(--blue); font-size: .78rem; font-weight: 700; }
.cart-item .price { font-weight: 700; margin-top: 4px; }
.cart-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.remove {
  background: none; border: none; color: var(--muted); font-size: .85rem;
}
.remove:hover { color: var(--red-2); }
.cart-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 96px;
}
.cart-summary h2 { font-size: 1.15rem; margin-bottom: 18px; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); font-size: .93rem; }
.sum-row.total { color: #fff; font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: .92rem;
  outline: none;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.cart-note { font-size: .83rem; color: var(--muted); margin: 12px 0; }

/* ---------- Misc ---------- */
.breadcrumb { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.breadcrumb a { color: var(--blue); }
.banner-strip {
  background: linear-gradient(90deg, #a30000, var(--red));
  border-radius: var(--radius);
  padding: 28px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.banner-strip h2 { font-size: 1.35rem; }
.banner-strip p { opacity: .9; font-size: .92rem; }
.banner-strip .btn { background: #fff; color: var(--red); }

.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--panel-2);
  border: 1px solid var(--green);
  color: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 600;
  opacity: 0;
  transition: all .3s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 40px; }
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
  padding: 44px 0;
}
.footer p { color: var(--muted); font-size: .88rem; }
.footer h4 { margin-bottom: 10px; font-size: .95rem; }
.footer__bar {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .pd__grid { grid-template-columns: 1fr; }
  .pd__media { position: static; }
  .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 700px) {
  .header__logo img { height: 52px; }
  .header__nav {
    position: absolute;
    top: 100%; right: 0; left: 0;
    flex-direction: column;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f2;
    padding: 18px;
    gap: 16px;
    display: none;
  }
  .header__nav.open { display: flex; }
  .header__burger { display: block; }
  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item__side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .section { padding: 40px 0; }
}

/* ---------- Preloader (pantalla de entrada) ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner { text-align: center; }
.preloader-img {
  width: min(560px, 84vw);
  animation: prePulse 1.6s ease-in-out infinite;
}
.preloader-bar {
  width: 230px;
  height: 4px;
  background: #e8edf4;
  border-radius: 4px;
  margin: 30px auto 16px;
  overflow: hidden;
}
.preloader-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--red), var(--blue));
  border-radius: 4px;
  animation: preBar 1.2s ease-in-out infinite;
}
@keyframes preBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes prePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.preloader-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .34em;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .preloader-img, .preloader-fill { animation: none; }
}

/* ---------- Hero con foto de fondo (camión DALITPOWER) ---------- */
.hero {
  background:
    linear-gradient(100deg, rgba(10, 15, 26, .93) 30%, rgba(10, 15, 26, .55) 75%, rgba(10, 15, 26, .75)),
    url('../images/hero.jpg') center 38% / cover no-repeat,
    var(--bg-2);
}

/* ---------- Acceso B2B ---------- */
body.auth-mode .header__nav { display: none; }
.auth { padding: 40px 0 80px; min-height: 70vh; }
.auth__wrap { max-width: 620px; }
.auth__card {
  background: var(--panel, #101828);
  border: 1px solid var(--line, #243044);
  border-radius: 14px;
  padding: 32px 36px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.auth__brand { text-align: center; margin-bottom: 14px; }
.auth__langs { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.auth__lang {
  background: transparent; border: 1px solid var(--line, #243044); color: var(--muted, #8fa0b8);
  border-radius: 6px; padding: 3px 10px; font-size: .78rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .2s;
}
.auth__lang:hover { border-color: var(--blue, #0099ff); color: #fff; }
.auth__lang.is-active { background: var(--blue, #0099ff); border-color: var(--blue, #0099ff); color: #fff; }
.auth__brand img { height: 64px; width: auto; background: #fff; border-radius: 10px; padding: 6px 10px; }
.auth__card h1 { font-size: 1.45rem; text-align: center; margin: 6px 0 8px; }
.auth__sub { text-align: center; color: var(--muted, #8fa0b8); font-size: .92rem; margin-bottom: 20px; line-height: 1.5; }
.auth__msg {
  background: #3a1d1d; border: 1px solid #7a2e2e; color: #ffb4b4;
  padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin-bottom: 16px;
}
.auth__dev {
  display: inline-block; margin-top: 8px; background: #123a24; border: 1px solid #1f6b41;
  color: #7ee2a8; padding: 4px 10px; border-radius: 6px; font-size: .85rem;
}
.auth__card form { display: flex; flex-direction: column; gap: 12px; }
.auth__card label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted, #8fa0b8); font-weight: 600; }
.auth__card input, .auth__card select {
  background: #0b1220; border: 1px solid var(--line, #243044); color: #e8eef8;
  border-radius: 8px; padding: 10px 12px; font-size: .95rem; width: 100%;
}
.auth__card input:focus, .auth__card select:focus { outline: 2px solid var(--blue, #1e5ac8); border-color: transparent; }
.auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .auth__row { grid-template-columns: 1fr; } .auth__card { padding: 22px 18px; } }
.auth__brands { border: 1px solid var(--line, #243044); border-radius: 10px; padding: 12px 14px; }
.auth__brands legend { font-size: .85rem; color: var(--muted, #8fa0b8); font-weight: 600; padding: 0 6px; }
.auth__checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px !important; font-size: .85rem !important; font-weight: 500 !important; color: #c8d4e6 !important; }
.check input { width: auto !important; }
.check--terms { font-size: .82rem !important; color: var(--muted, #8fa0b8) !important; }
.auth__card .btn--block { margin-top: 6px; }
.auth__switch { text-align: center; font-size: .88rem; margin-top: 16px; color: var(--muted, #8fa0b8); }
.auth__switch a { color: var(--blue, #4d8dff); font-weight: 600; }
.auth__legal { text-align: center; font-size: .75rem; color: #5c6b82; margin-top: 14px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(30, 90, 200, .15); border: 1px solid rgba(77, 141, 255, .4);
  color: #cfe0ff; border-radius: 999px; padding: 6px 14px; font-size: .82rem; cursor: pointer;
}
.user-chip__out { font-weight: 700; color: #8fb4ff; }
.user-chip:hover { border-color: #4d8dff; }
