/* ============================================================
   Sistema base (ecommerce) — variables de UI + componentes
   Los colores del cliente viven en tema.css (--theme-*)
   ============================================================ */

:root {
  /* Fuentes */
  --font-ui: 'Nunito', sans-serif;

  /* Colores neutros / semánticos */
  --ui-white: #ffffff;
  --ui-text: #212529;
  --ui-text-secundario: #5b6473;
  --ui-border: #e3e8ef;
  --ui-exito: #16a34a;
  --ui-peligro: #dc2626;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(15, 35, 70, .08);
  --shadow-md: 0 4px 12px rgba(15, 35, 70, .12);
  --shadow-lg: 0 8px 24px rgba(15, 35, 70, .16);

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Tema del sitio (el cliente los sobreescribe en css/tema.css) */
  --theme-primario: var(--ui-text);
  --theme-acento: #2563eb;
  --theme-acento-suave: #e8f0fb;
  --theme-acento-claro: #7ba3f0;
  --theme-acento-fuerte: #1d4ed8;
  --theme-fondo: #f6f8fb;
  --theme-item: #1e3a5f;
}

/* ============================================================
   Base / reset
   ============================================================ */
* {
  font-family: var(--font-ui);
}

body {
  background: var(--ui-white);
  color: var(--ui-text);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--theme-acento-fuerte); }
a:hover { color: var(--theme-acento-fuerte); filter: brightness(1.15); }

.text-grey { color: var(--ui-text-secundario) !important; }
.text-dark-red { color: var(--ui-text) !important; }
.text-green { color: var(--ui-exito) !important; }
.bg-grey { background: var(--theme-fondo); }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: var(--theme-primario) !important;
  box-shadow: var(--shadow-md);
  padding: .6rem 0;
}

.navbar-brand img.logo,
.navbar-brand.logo,
.navbar-logo {
  height: 64px;
  width: auto;
}

/* Hamburger manual con CSS puro (siempre visible, sin depender del icono) */
.navbar-toggler::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 20px;
  height: 2px;
  background: #fff;
  box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
  transform: translateY(-50%);
}

/* Ocultar el icono por defecto (que a veces sale como cuadrado) */
.navbar-toggler-icon {
  display: none;
}

.navbar .nav-link {
  color: #e7ecf3 !important;
  font-weight: 600;
  padding: .35rem .9rem;
  border-radius: var(--radius-sm);
  transition: background-color .2s ease, color .2s ease;
}

.navbar .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .12);
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, .4) !important;
}

/* Hamburger manual con CSS puro (siempre visible, sin depender del icono) */
.navbar-toggler::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 20px;
  height: 2px;
  background: #fff;
  box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
  transform: translateY(-50%);
}

/* Ocultar el icono por defecto (que a veces sale como cuadrado) */
.navbar-toggler-icon {
  display: none;
}

/* Badge de precio del carrito */
.nav-carrito-badge {
  background: var(--theme-acento);
  color: #fff;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .75rem;
  font-weight: 700;
  margin-left: .35rem;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  background: var(--theme-primario);
  color: #cfd9e6;
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}

footer h3 { color: #fff; font-weight: 700; }
footer a { color: #cfd9e6; text-decoration: none; }
footer a:hover { color: #fff; }
footer .logo,
footer .footer-brand,
footer .footer-brand img.logo,
.footer-logo {
  height: 56px;
  width: auto;
}
footer .footer-heading {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8fa3bd;
  margin-bottom: .75rem;
}
footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .15);
  margin-top: 1.5rem;
  padding-top: 1rem;
  font-size: .85rem;
}

/* ============================================================
   Home — hero
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--theme-primario) 0%, #143050 60%, #102340 100%);
  color: #fff;
  padding: 4.5rem 0;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: .5rem;
}

.hero p.lead {
  color: #c9d6e6;
  max-width: 540px;
  font-size: 1.1rem;
}

.hero .btn-cta {
  background: var(--theme-acento);
  color: #fff;
  border: none;
  padding: .8rem 1.6rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, background-color .2s ease;
}

.hero .btn-cta:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   Home — servicios (cards)
   ============================================================ */
.servicio-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}

.servicio-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.servicio-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--theme-acento-suave);
  color: var(--theme-acento-fuerte);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: .9rem;
}

.servicio-card h4 {
  font-weight: 700;
  color: var(--theme-primario);
  margin-bottom: .35rem;
}

.servicio-card p {
  color: var(--ui-text-secundario);
  font-size: .95rem;
  margin: 0;
}

.seccion-titulo {
  font-weight: 800;
  color: var(--theme-primario);
  border-bottom: 2px solid var(--theme-acento-suave);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
}

/* ============================================================
   Listado — sidebar (filtros) y grid de productos
   ============================================================ */
.filtro-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.filtro-card .filtro-titulo {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ui-text-secundario);
  padding: .9rem 1.1rem .5rem;
}

.filtro-card .list-group-item {
  border: none !important;
  background: transparent;
  color: var(--ui-text);
  font-weight: 500;
  padding: .55rem 1.1rem;
  transition: background-color .2s ease, color .2s ease;
}

.filtro-card .list-group-item a {
  color: inherit;
  text-decoration: none;
}

.filtro-card .list-group-item:hover {
  background: var(--theme-acento-suave);
  color: var(--theme-primario);
}

.filtro-card .list-group-item.selected a {
  color: var(--theme-acento-fuerte);
  font-weight: 700;
}

.busqueda-box {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: .9rem;
  margin-bottom: 1.25rem;
}

.busqueda-box .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-border);
  padding: .55rem .8rem;
}

.busqueda-box .btn-buscar {
  background: var(--theme-acento);
  color: #fff;
  border: none;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.busqueda-box .btn-buscar:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
}

/* Cabecera de la sección de productos */
.listado-encabezado {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.listado-encabezado h2 {
  color: var(--theme-primario);
  font-weight: 800;
  margin: 0;
}

.listado-encabezado .bottom_line {
  width: 64px;
  height: 3px;
  background: var(--theme-acento);
  margin: .5rem auto 0;
}

/* ============================================================
   Tarjeta de producto (grid)
   ============================================================ */
.product {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product .item {
  position: relative;
  background: var(--theme-fondo);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product .item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s ease;
}

.product:hover .item-image img {
  transform: scale(1.05);
}

.product .item-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 58, 95, .7);
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
}

.product:hover .item-text {
  opacity: 1;
}

.product .card-body {
  padding: .9rem 1rem;
  text-align: center;
  background: var(--ui-white);
}

.product .producto-nombre {
  font-weight: 700;
  color: var(--ui-text);
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.product .producto-codigo {
  font-size: .8rem;
  color: var(--ui-text-secundario);
}

.product .producto-precio {
  font-weight: 800;
  color: var(--theme-acento-fuerte);
  font-size: 1.15rem;
}

.product .badge-disponibilidad {
  position: absolute;
  top: .6rem;
  left: .6rem;
  z-index: 2;
  background: var(--ui-exito);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
}

.product .badge-disponibilidad.no-disponible {
  background: var(--ui-peligro);
}

/* ============================================================
   Ficha de producto
   ============================================================ */
.ficha-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.ficha-imagen {
  background: var(--theme-fondo);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.ficha-imagen img {
  max-height: 380px;
  object-fit: contain;
}

.ficha-datos {
  padding: 1.5rem;
}

.ficha-datos h2 {
  color: var(--theme-primario);
  font-weight: 800;
  margin-bottom: .25rem;
}

.ficha-codigo {
  color: var(--ui-text-secundario);
  font-size: .9rem;
}

.ficha-descripcion {
  color: var(--ui-text-secundario);
  font-size: .95rem;
  line-height: 1.5;
}

.ficha-precio {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--theme-acento-fuerte);
}

.badge-disponibilidad {
  font-size: .85rem;
  font-weight: 700;
  padding: .4rem .9rem;
  border-radius: 999px;
}

.badge-disponibilidad.disponible {
  background: rgba(22, 163, 74, .12);
  color: var(--ui-exito);
}

.badge-disponibilidad.no-disponible {
  background: rgba(220, 38, 38, .12);
  color: var(--ui-peligro);
}

/* Selector de cantidad (ficha + carrito) */
.selector-cantidad {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.selector-cantidad .btn-step {
  background: var(--theme-acento-suave);
  color: var(--theme-primario);
  border: none;
  padding: .5rem 1rem;
  font-weight: 700;
  transition: background-color .2s ease;
}

.selector-cantidad .btn-step:hover {
  background: var(--theme-acento-claro);
  color: #fff;
}

.selector-cantidad input {
  border: none;
  width: 4rem;
  text-align: center;
  font-weight: 700;
}

.selector-cantidad .btn-agregar {
  background: var(--theme-acento);
  color: #fff;
  border: none;
  padding: .5rem 1.2rem;
  font-weight: 700;
}

.selector-cantidad .btn-agregar:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
}

/* ============================================================
   Carrito
   ============================================================ */
.carrito-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.carrito-card .carrito-encabezado {
  padding: 1.25rem;
  border-bottom: 1px solid var(--ui-border);
  background: var(--theme-fondo);
}

.carrito-card .carrito-encabezado h3 {
  margin: 0;
  color: var(--theme-primario);
  font-weight: 800;
}

.carrito-tabla {
  width: 100%;
  border-collapse: collapse;
}

.carrito-tabla th {
  background: var(--theme-fondo);
  color: var(--ui-text-secundario);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem 1rem;
  text-align: left;
}

.carrito-tabla td {
  border-top: 1px solid var(--ui-border);
  padding: .9rem 1rem;
  vertical-align: middle;
}

.carrito-tabla .producto-celda {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.carrito-tabla .producto-celda img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-sm);
  background: var(--theme-fondo);
}

.carrito-tabla .producto-celda .nombre {
  font-weight: 600;
}

.carrito-tabla .producto-celda .codigo {
  font-size: .8rem;
  color: var(--ui-text-secundario);
}

.carrito-tabla .btn-quitar {
  background: transparent;
  color: var(--ui-peligro);
  border: none;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
}

.carrito-tabla .btn-quitar:hover {
  background: rgba(220, 38, 38, .1);
}

.carrito-tabla .btn-actualizar {
  background: var(--theme-acento-suave);
  color: var(--theme-primario);
  border: none;
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.carrito-tabla .btn-actualizar:hover {
  background: var(--theme-acento-claro);
  color: #fff;
}

.carrito-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem;
  border-top: 1px solid var(--ui-border);
}

.carrito-total .label {
  font-weight: 700;
  color: var(--theme-primario);
}

.carrito-total .monto {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--theme-acento-fuerte);
}

.carrito-vacio {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ui-text-secundario);
}

.carrito-acciones {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.carrito-acciones .btn {
  padding: .7rem 1.4rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.carrito-acciones .btn-volver {
  background: var(--theme-fondo);
  color: var(--theme-primario);
  border: 1px solid var(--ui-border);
}

.carrito-acciones .btn-volver:hover {
  background: var(--theme-acento-suave);
  color: var(--theme-primario);
}

.carrito-acciones .btn-confirmar {
  background: var(--theme-acento);
  color: #fff;
  border: none;
}

.carrito-acciones .btn-confirmar:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
}

/* ============================================================
   Pedidos
   ============================================================ */
.pedido-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.pedido-encabezado {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.pedido-encabezado .logo-marca {
  font-weight: 800;
  color: var(--theme-primario);
}

.pedido-encabezado .numero-pedido {
  color: var(--ui-text-secundario);
  font-size: .9rem;
}

.pedido-estado {
  display: inline-block;
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--theme-acento-suave);
  color: var(--theme-primario);
}

.pedido-confirmacion {
  text-align: center;
  padding: 2.5rem 1rem;
}

.pedido-confirmacion .icono-exito {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(22, 163, 74, .15);
  color: var(--ui-exito);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}

/* ============================================================
   Login
   ============================================================ */
.login-card {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.login-card .login-encabezado {
  background: var(--theme-primario);
  color: #fff;
  padding: 1.25rem;
  text-align: center;
}

.login-card .login-encabezado h3 {
  margin: 0;
  font-weight: 800;
}

.login-card form {
  padding: 1.5rem;
}

.login-card .input-field input {
  border: none;
  border-bottom: 2px solid var(--ui-border);
  border-radius: 0;
  background: transparent;
  padding: .6rem .25rem;
  width: 100%;
  transition: border-color .2s ease;
}

.login-card .input-field input:focus {
  outline: none;
  border-bottom-color: var(--theme-acento);
}

.login-card .btn-ingresar {
  background: var(--theme-acento);
  color: #fff;
  border: none;
  padding: .7rem 1.2rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.login-card .btn-ingresar:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
}

/* ============================================================
   404 (inline, sin dependencias externas)
   ============================================================ */
.page_404 {
  padding: 60px 0;
  text-align: center;
}

.page_404 .code-404 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--theme-acento);
}

.page_404 .msg-404 {
  color: var(--ui-text-secundario);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.page_404 .btn-volver {
  background: var(--theme-acento);
  color: #fff;
  padding: .7rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.page_404 .btn-volver:hover {
  background: var(--theme-acento-fuerte);
  color: #fff;
}

/* ============================================================
   Botones genéricos (sobrescribe Bootstrap)
   ============================================================ */
.btn:focus, .btn:active {
  outline: none !important;
  box-shadow: none;
}

.shadow-custom {
  box-shadow: var(--shadow-md);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 575px) {
  .carrito-tabla th,
  .carrito-tabla td {
    padding: .6rem .75rem;
  }

  .ficha-datos {
    padding: 1.25rem;
  }

  .hero {
    padding: 3rem 0;
  }
}
