/* ═══════════════════════════════════════════════════════════
   Qbits UI v3.0 — tokens + componentes base (TelVet Store)
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --navy:#050f1c; --navy1:#08101a; --navy2:#0a1628; --navy3:#0e2040; --navy4:#122650;
  --blue:#3b82f6; --blue1:#5a8fcc; --blue2:#60a5fa; --blue3:#8bbfee;
  --cyan:#38bdf8;
  --green:#22c55e; --amber:#f59e0b; --red:#ef4444;
  --white:#fff; --off:#f0f6ff;
  --text:#e2eaf4; --muted:#6b87a8;
  --border:rgba(59,130,246,.14); --border2:rgba(59,130,246,.28);
  --glass:rgba(8,15,26,.82);
  --r:16px; --r-sm:10px; --r-xs:7px;
  --shadow-lg: 0 20px 48px rgba(0,0,0,.4);
  --shadow-md: 0 10px 24px rgba(0,0,0,.28);
  --shadow-sm: 0 4px 10px rgba(0,0,0,.18);
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Menlo', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--sans);
  background: var(--navy);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue2); text-decoration: none; }
a:hover { color: var(--blue3); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--blue); color: var(--white); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--navy1); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* Tipografía */
h1,h2,h3,h4,h5 { font-weight: 700; letter-spacing: -0.01em; color: var(--white); }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
h3 { font-size: 1.2rem; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .04em; }
.muted { color: var(--muted); }

/* Layout utilidades */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.grid { display: grid; gap: 16px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }

/* ───── Botones ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 50px;
  font-weight: 600; font-size: .88rem; letter-spacing: .01em;
  transition: all .18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue1));
  color: var(--white);
  box-shadow: 0 6px 16px rgba(59,130,246,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(59,130,246,.5); color: var(--white); }
.btn-ghost {
  background: transparent;
  color: var(--blue2);
  border-color: var(--border2);
}
.btn-ghost:hover { background: rgba(59,130,246,.1); color: var(--blue3); }
.btn-wa { background: linear-gradient(135deg, #22c55e, #16a34a); color: var(--white); }
.btn-wa:hover { color: var(--white); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .78rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ───── Cards ───── */
.card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  position: relative;
}
.card-glass { background: var(--glass); backdrop-filter: blur(12px); }
.card-title {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin-bottom: 16px; font-size: .95rem; font-weight: 700; color: var(--white);
}
.card-title .hint {
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ───── Tablas ───── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.tbl td {
  font-size: .88rem; padding: 12px; border-bottom: 1px solid rgba(59,130,246,.06);
}
.tbl tbody tr:hover { background: rgba(59,130,246,.04); }

/* ───── Badges ───── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 50px;
  font-family: var(--mono); font-size: .65rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  background: rgba(59,130,246,.15); color: var(--blue2); border: 1px solid rgba(59,130,246,.3);
}
.badge-green { background: rgba(34,197,94,.12); color: #86efac; border-color: rgba(34,197,94,.3); }
.badge-amber { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.badge-red   { background: rgba(239,68,68,.12);  color: #fca5a5; border-color: rgba(239,68,68,.3); }
.badge-ghost { background: transparent; }

/* ───── Inputs ───── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  background: var(--navy1);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text); font-size: .92rem;
  transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue); background: var(--navy2);
}
.input::placeholder { color: var(--muted); }
.field-err { color: var(--red); font-size: .76rem; margin-top: 4px; font-family: var(--mono); }
.field-ok  { color: #86efac; font-size: .76rem; margin-top: 4px; font-family: var(--mono); }

/* ───── Skeleton loader ───── */
.skel {
  background: linear-gradient(90deg, var(--navy2) 0%, var(--navy3) 50%, var(--navy2) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 6px 0; }
.skel-box  { height: 120px; }

/* ───── Toast ───── */
#toastStack {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--navy3); color: var(--text);
  border: 1px solid var(--border2); border-left: 3px solid var(--blue);
  border-radius: var(--r-sm);
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
  min-width: 260px; max-width: 420px;
  font-size: .88rem;
  animation: toastIn .28s cubic-bezier(.2,.8,.3,1.1);
}
.toast-ok  { border-left-color: var(--green); }
.toast-err { border-left-color: var(--red); }
.toast-warn{ border-left-color: var(--amber); }
@keyframes toastIn { from { opacity:0; transform: translateX(80px); } to { opacity:1; transform: translateX(0); } }

/* ───── Utilidades ───── */
.hidden { display: none !important; }
.mt-0  { margin-top: 0 !important; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.pt-20 { padding-top: 20px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ───── Loader spinner simple ───── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(59,130,246,.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   Header público compartido (home + catalogo + producto)
   Movido desde home.css 2026-04-22 para que .topbar-public esté
   disponible en cualquier página que incluya solo qbits.css.
   ═══════════════════════════════════════════════════════════ */
/* ───── Header público ───── */
.topbar-public {
  position: sticky; top: 0; z-index: 100;
  height: 66px;
  background: var(--glass); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar-public .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--white);
}
.topbar-public .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
}
.topbar-public .brand .tag {
  font-family: var(--mono); font-size: .6rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(59,130,246,.15); color: var(--blue2);
  border: 1px solid var(--border2);
  padding: 3px 8px; border-radius: 50px;
  margin-left: 6px;
}
.hdr-search {
  flex: 1; max-width: 520px; margin: 0 auto;
  position: relative;
}
.hdr-search .icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.hdr-search input {
  width: 100%; padding: 10px 16px 10px 44px;
  background: var(--navy1); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text); font-size: .9rem;
}
.hdr-search input:focus { outline: none; border-color: var(--blue); }
.hdr-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hdr-actions .cart-badge {
  position: relative;
}
.hdr-actions .cart-badge .count {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: var(--white);
  font-family: var(--mono); font-size: .6rem; font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 50px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Account pill en topbar público (hdr_account.js) ───────── */
.hdr-account-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hdr-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 50px;
  text-decoration: none;
  transition: all .2s;
}
.hdr-account:hover {
  background: rgba(59,130,246,.18);
  border-color: var(--blue);
  transform: translateY(-1px);
}
.hdr-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  font-family: var(--display, 'DM Sans'), sans-serif;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hdr-avatar-img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(59,130,246,.3);
  display: block;
}
.hdr-account-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.hdr-account-name {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-account-sub {
  font-family: var(--mono, 'JetBrains Mono'), monospace;
  font-size: .65rem;
  color: var(--blue2);
  letter-spacing: .05em;
}
@media (max-width: 640px) {
  .hdr-account-info { display: none; }
  .hdr-account { padding: 4px; }
}

/* ─── Botones toggle / close del search mobile (BUG 2+3 v0.0.7.7) ─── */
.hdr-search-toggle {
  display: none;          /* solo visible en mobile */
  width: 40px; height: 40px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: all .2s;
}
.hdr-search-toggle:hover {
  background: rgba(59,130,246,.18);
  border-color: var(--blue);
}
.hdr-search-close {
  display: none;          /* solo visible cuando search está .expanded en mobile */
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.hdr-search-close:hover {
  background: rgba(59,130,246,.18);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE ≤640px — header compacto con search colapsable
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .topbar-public {
    padding: 0 14px;
    gap: 8px;
    height: 60px;
  }
  .topbar-public .brand img { height: 28px !important; }
  .topbar-public .brand .tag {
    font-size: .55rem;
    padding: 2px 7px;
    margin-left: 4px;
  }

  /* Search: oculto por default, se expande a overlay full-width */
  .hdr-search {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    margin: 0;
    max-width: none;
    padding: 10px 14px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 110;
    align-items: center;
  }
  .hdr-search.expanded {
    display: flex;
  }
  .hdr-search.expanded .icon {
    left: 30px;
  }
  .hdr-search.expanded input {
    padding-right: 52px;  /* espacio para el close btn */
  }
  .hdr-search.expanded .hdr-search-close {
    display: inline-flex;
    right: 24px;
  }

  /* Toggle visible en mobile */
  .hdr-search-toggle { display: inline-flex; }

  /* Cart + login compactos 40×40 */
  .hdr-actions { gap: 6px; }
  .hdr-actions .cart-badge {
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hdr-actions .cart-badge i { margin: 0; }

  /* Botón "Ingresar" también redondo */
  #hdrLoginBtn {
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  #hdrLoginBtn .btn-label { display: none; }
  #hdrLoginBtn i { margin: 0; }
}


/* ═══════════════════════════════════════════════════════════
   Site footer — compartido (home, catalogo, producto, checkout, confirm)
   Movido desde home.css 2026-04-23; re-escrito con clases footer-*.
   Grid 1 → 2 (640) → 4 (1024) cols.
   ═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--navy1);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 60px;
  color: var(--text);
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
}

.footer-brand-col { max-width: 400px; }
.footer-tagline {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue2);
  margin: 0 0 8px;
}
.footer-desc {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  transition: all .2s;
  text-decoration: none;
}
.footer-social a:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-2px);
}

.footer-col-title {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 14px;
}
.footer-links,
.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a,
.footer-contact a {
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.footer-links a:hover,
.footer-contact a:hover {
  color: var(--blue2);
}
.footer-contact li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--muted);
}
.footer-contact i {
  width: 16px;
  color: var(--blue2);
  opacity: .8;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: .75rem;
  color: var(--muted);
}
.footer-bottom .sep { opacity: .4; }
.footer-bottom a { color: var(--blue2); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }
