/* ==========================================================
   BLUEMOTORS – Detalle de accesorio
   Reemplaza por completo a css/detalle_accesorios.css
   ========================================================== */

:root {
  --navy: #021d33;
  --navy-2: #0a2f4f;
  --blue: #1e3a8a;
  --blue-light: #2563eb;
  --accent: #38bdf8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(2, 29, 51, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(37, 99, 235, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===============================
   NAVBAR
================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: rgba(2, 29, 51, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
  background: rgba(2, 29, 51, 0.98);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* línea de acento inferior */
.navbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--blue-light), transparent);
  opacity: 0.7;
}

.nav-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

/* ---------- Logos ---------- */
.nav-brand,
.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand img,
.nav-left img {
  height: 38px;
  width: auto;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

.nav-brand:hover img {
  transform: scale(1.06);
}

/* ---------- Hamburguesa animada ---------- */
.hamburger {
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hamburger:focus-visible,
.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Links (mobile: panel desplegable) ---------- */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.nav-links.active {
  max-height: 320px;
  padding: 6px 16px 18px;
}

.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-links a:active {
  transform: scale(0.98);
}

/* botón destacado: carrito */
.nav-links a.nav-cart {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.nav-links a.nav-cart:hover {
  background: linear-gradient(135deg, #3b82f6, var(--blue-light));
}

/* ---------- Desktop ---------- */
@media (min-width: 769px) {
  .navbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    padding: 0 40px;
  }

  .nav-top {
    width: auto;
    padding: 0;
  }

  .hamburger {
    display: none;
  }

  .nav-links,
  .nav-links.active {
    flex-direction: row;
    align-items: center;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    gap: 6px;
  }

  .nav-links a {
    padding: 10px 18px;
    font-size: 14px;
    background: transparent;
    position: relative;
  }

  /* subrayado animado */
  .nav-links a:not(.nav-cart)::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 5px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }

  .nav-links a:not(.nav-cart):hover::after {
    transform: scaleX(1);
  }

  .nav-links a.nav-cart {
    margin-left: 12px;
    padding: 10px 22px;
    border-radius: 999px;
  }

  .nav-links a.nav-cart:hover {
    transform: translateY(-2px);
  }
}

/* ===============================
   TARJETA DE DETALLE
================================ */
.detalle {
  max-width: 1150px;
  margin: 40px auto;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  padding: 44px;
}

/* ===============================
   GALERÍA
================================ */
.galeria {
  width: 100%;
  max-width: 480px;
  justify-self: center;
  align-self: start;
  position: sticky;
  top: 100px;
}

.img-principal {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  transition: transform 0.35s ease;
}

.img-principal:hover {
  transform: scale(1.02);
}

.miniaturas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.miniaturas img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid var(--border);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.miniaturas img:hover {
  border-color: var(--blue-light);
  opacity: 1;
  transform: translateY(-2px);
}

/* ===============================
   INFO
================================ */
.info h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.info > p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
  margin: 0 0 6px;
}

.precio {
  display: inline-block;
  font-size: 36px;
  font-weight: 800;
  color: var(--blue);
  margin: 18px 0 8px;
  letter-spacing: -0.5px;
}

/* ---------- Cantidad + stock ---------- */
.compra-cantidad {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 8px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.compra-cantidad button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.compra-cantidad button:hover:not(:disabled) {
  background: var(--blue-light);
  color: #fff;
}

.compra-cantidad button:active:not(:disabled) {
  transform: scale(0.94);
}

.compra-cantidad button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.compra-cantidad span,
.compra-cantidad .cantidad {
  min-width: 44px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.info .compra-stock {
  display: inline-block;
  margin: 0 0 6px 12px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
  background: rgba(22, 163, 74, 0.1);
  border-radius: 999px;
}

/* ---------- Cuotas ---------- */
.cuotas {
  margin: 22px 0;
  padding: 20px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tarjetas {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.tarjetas img {
  height: 30px;
  object-fit: contain;
  filter: saturate(0.9);
}

.cuotas label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.resultado-cuotas {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
}

.resultado-cuotas:empty {
  display: none;
}

/* ---------- Descripción ---------- */
.descripcion {
  margin-top: 26px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.descripcion h3 {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
}

.descripcion p {
  margin: 0;
  color: #334155;
  line-height: 1.9;
  font-size: 15px;
}

/* ---------- Botones ---------- */
.botones,
.acciones {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  flex: 1 1 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-cart,
.carrito {
  background: #fff;
  color: var(--blue);
  border-color: var(--blue);
}

.btn-cart:hover,
.carrito:hover {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
  transform: translateY(-2px);
}

.btn-buy,
.comprar {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-buy:hover,
.comprar:hover {
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
  .detalle {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 24px;
    margin: 20px 14px;
  }

  .galeria {
    position: static;
    max-width: 100%;
  }

  .info h1 {
    font-size: 23px;
  }

  .precio {
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .detalle {
    padding: 18px;
    border-radius: 16px;
  }

  .miniaturas img {
    width: 64px;
    height: 64px;
  }

  .btn {
    flex-basis: 100%;
  }

  .info .compra-stock {
    margin: 8px 0 0;
  }
}