/* ============================================================
   WebAlcaire — Tema (rediseño moderno minimalista)
   Paleta "frío dominante" anclada al logo. Poppins en todo.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  /* Marca (del logo) */
  --brand: #1577C7;
  --brand-700: #0F5D9E;
  --sky: #38BDF8;
  --navy: #0F2E4D;
  --heat: #F97316;
  --heat-700: #E8650C;

  /* Neutros */
  --bg: #F5F8FC;
  --surface: #FFFFFF;
  --ink: #0F1B2D;
  --muted: #64748B;
  --border: #E2E8F0;

  /* Estados */
  --success: #16A34A;
  --danger: #E11D48;

  /* Forma y profundidad */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 3px rgba(15,46,77,.08);
  --shadow-2: 0 8px 24px rgba(15,46,77,.10);

  /* Alias para estilos inline heredados */
  --primary: var(--brand);
  --secondary: var(--navy);
  --accent: var(--heat);

  /* Overrides de Bootstrap 5.3 */
  --bs-primary: var(--brand);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-body-font-family: 'Poppins', system-ui, 'Segoe UI', sans-serif;
  --bs-border-color: var(--border);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-700);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', system-ui, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--navy); letter-spacing: -.01em; }
h1 { font-weight: 700; }
.lead { color: var(--muted); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
:focus-visible { outline: 3px solid rgba(56,189,248,.6); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; padding: .55rem 1.15rem; transition: background .2s, box-shadow .2s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-700); border-color: var(--brand-700); box-shadow: var(--shadow-1); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-secondary { color: var(--navy); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-warning { background: var(--heat); border-color: var(--heat); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background: var(--heat-700); border-color: var(--heat-700); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #128a3f; border-color: #128a3f; }

/* ---------- Tarjetas (Bootstrap) ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 600; color: var(--navy); }

/* ---------- Formularios ---------- */
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(21,119,199,.15); }
.form-label { font-weight: 500; color: var(--navy); }

/* ---------- Navbar ---------- */
.navbar { background: rgba(255,255,255,.88) !important; backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding-top: .6rem; padding-bottom: .6rem; }
.navbar .navbar-brand { color: var(--navy) !important; font-weight: 700; }
.navbar .nav-link { color: var(--navy) !important; font-weight: 500; position: relative; }
.navbar .nav-link::after { content: ''; position: absolute; left: .75rem; right: .75rem; bottom: .3rem; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }
.navbar .nav-link.active { color: var(--brand) !important; }

/* ---------- Hero ---------- */
.hero-section { background: linear-gradient(135deg, var(--navy), var(--brand)); color: #fff; padding: 52px 0; }
.hero-grid { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero-copy { max-width: 600px; }
.hero-section h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .5rem; }
.hero-accent { color: var(--sky); }
.hero-section .lead { color: rgba(255,255,255,.9); margin-bottom: 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-logo { height: 132px; width: auto; flex-shrink: 0; }
@media (max-width: 768px) {
  .hero-section { padding: 40px 0; text-align: center; }
  .hero-grid { flex-direction: column-reverse; gap: 22px; }
  .hero-copy { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-logo { height: 100px; }
}

/* ---------- Tarjetas de categoría ---------- */
.category-card { cursor: pointer; transition: transform .3s, box-shadow .3s; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }
.category-card img { height: 200px; object-fit: cover; width: 100%; }
.category-card .card-body { background: var(--navy); color: #fff; text-align: center; padding: 16px; }

/* ---------- Tarjetas de producto ---------- */
.product-card { border-radius: var(--radius); overflow: hidden; transition: box-shadow .3s, transform .3s; height: 100%; border: 1px solid var(--border); box-shadow: var(--shadow-1); background: var(--surface); }
.product-card:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); }
.product-card .product-img { height: 210px; object-fit: contain; width: 100%; padding: 16px; background: #fff; }
.product-card .card-title { font-weight: 600; color: var(--navy); }

.price-original { text-decoration: line-through; color: var(--muted); font-size: .9rem; }
.price-offer { color: var(--danger); font-weight: 700; font-size: 1.35rem; }
.price-normal { color: var(--ink); font-weight: 700; font-size: 1.35rem; }
.badge-oferta { position: absolute; top: 12px; right: 12px; background: var(--heat); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; box-shadow: var(--shadow-1); }

.product-details .accordion-button { font-weight: 500; }
.product-details .accordion-button:not(.collapsed) { background: var(--brand); color: #fff; }
.product-details .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(21,119,199,.2); }

/* ---------- Cotizador flotante ---------- */
.cotizador-badge { position: fixed; bottom: 22px; right: 22px; z-index: 1000; }
.cotizador-badge .btn { border-radius: 999px; padding: 14px 24px; font-size: 1.05rem; box-shadow: var(--shadow-2); }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: #cdd9e6; padding: 44px 0; margin-top: 64px; border-top: 3px solid var(--sky); }
footer a { color: #fff; }
footer a:hover { color: var(--sky); }

/* ---------- Slider de marcas ---------- */
.marcas-slider { overflow: hidden; width: 100%; position: relative; }
.marcas-track { display: flex; align-items: center; animation: scrollMarcas 24s linear infinite; width: max-content; }
.marca-logo { height: 46px; margin: 0 44px; filter: grayscale(100%); opacity: .65; transition: filter .3s, opacity .3s; }
.marca-logo:hover { filter: grayscale(0%); opacity: 1; }
.marca-texto { font-size: 1.7rem; font-weight: 700; margin: 0 50px; color: var(--muted); letter-spacing: 2px; white-space: nowrap; transition: color .3s; }
.marca-texto:hover { color: var(--brand); }
@keyframes scrollMarcas { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------- Paginación ---------- */
.pagination .page-link { color: var(--brand); border-color: var(--border); }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Promociones (página pública) ---------- */
.promos-hero { padding: 36px 0; }
.promos-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: .35rem; }
.promos-hero .lead { color: rgba(255,255,255,.9); margin-bottom: 0; }
.hero-accent-heat { color: var(--heat); }
.btu-filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.btu-filter .btn { border-radius: 999px; padding: .45rem 1.15rem; font-weight: 500; }
/* Ítem de menú "Promociones" destacado en el naranja de las ofertas */
.navbar .nav-link.nav-promos { color: var(--heat) !important; font-weight: 600; }
.navbar .nav-link.nav-promos::after { background: var(--heat); }

/* ============================================================
   Panel Admin
   ============================================================ */
.admin-sidebar { min-height: 100vh; background: var(--navy); width: 250px; }
.admin-sidebar > .fw-bold { color: #fff; }
.admin-sidebar a { color: rgba(255,255,255,.75); padding: 12px 20px; display: block; text-decoration: none; border-left: 3px solid transparent; transition: background .2s, border-color .2s, color .2s; }
.admin-sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar a.active { background: rgba(56,189,248,.12); color: #fff; border-left-color: var(--brand); }

.table { --bs-table-bg: var(--surface); }
.table thead th { background: var(--bg); color: var(--navy); font-weight: 600; border-bottom: 2px solid var(--border); }
.table-dark, .table-dark th { background: var(--navy) !important; color: #fff; }

.badge.bg-primary { background: var(--brand) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-secondary { background: var(--muted) !important; }

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }

/* ============================================================
   Snackbar + mini-modal de confirmación
   ============================================================ */
#snackbar-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-width: 380px;
  pointer-events: none;
}

.snackbar {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  border-left: 4px solid var(--brand);
  padding: .85rem 1rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .95rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.snackbar--visible { opacity: 1; transform: translateY(0); }

.snackbar__icon { font-size: 1.15rem; line-height: 1.3; }
.snackbar__text { flex: 1 1 auto; }
.snackbar__close {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.25rem; line-height: 1; color: var(--muted); padding: 0 .15rem;
}
.snackbar__close:hover { color: var(--ink); }

.snackbar--success { border-left-color: var(--success); }
.snackbar--success .snackbar__icon { color: var(--success); }
.snackbar--error { border-left-color: var(--danger); }
.snackbar--error .snackbar__icon { color: var(--danger); }
.snackbar--warning { border-left-color: var(--heat); }
.snackbar--warning .snackbar__icon { color: var(--heat); }
.snackbar--info { border-left-color: var(--brand); }
.snackbar--info .snackbar__icon { color: var(--brand); }

@media (max-width: 576px) {
  #snackbar-container { left: .75rem; right: .75rem; bottom: .75rem; max-width: none; }
}

.confirm-overlay {
  position: fixed; inset: 0; z-index: 1090;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 46, 77, .45);
  padding: 1rem;
  opacity: 0;
  transition: opacity .2s ease;
}
.confirm-overlay--visible { opacity: 1; }

.confirm-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  max-width: 420px; width: 100%;
  padding: 1.5rem;
  transform: translateY(8px);
  transition: transform .2s ease;
}
.confirm-overlay--visible .confirm-modal { transform: translateY(0); }

.confirm-modal__title { margin: 0 0 .5rem; font-size: 1.15rem; }
.confirm-modal__text { margin: 0 0 1.25rem; color: var(--ink); }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }

@media (prefers-reduced-motion: reduce) {
  .snackbar, .confirm-overlay, .confirm-modal { transition: none; }
}
