/* ============================================================
   Security Center - Estilos propios
   Paleta: Azul marino #002060 + Blanco + Gris plateado
   ============================================================ */

:root {
  --sc-navy:     #002060;
  --sc-navy-dk:  #001240;
  --sc-blue:     #0040c0;
  --sc-accent:   #1a73e8;
  --sc-silver:   #c0c0c0;
  --sc-light:    #f4f6fb;
  --sc-border:   #e0e4ef;
  --sc-text:     #1a1f36;
  --sc-muted:    #6b7280;
  --sc-success:  #16a34a;
  --sc-warn:     #f59e0b;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,32,96,.08);
  --shadow-md:   0 4px 24px rgba(0,32,96,.13);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--sc-text); background: #fff; }

/* ---- NAVBAR ---- */
.sc-navbar { background: var(--sc-navy); box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 1030; }
.sc-navbar .nav-link { color: rgba(255,255,255,.85) !important; font-size: .9rem; }
.sc-navbar .nav-link:hover { color: #fff !important; }
.sc-navbar .navbar-brand { color: #fff !important; font-size: 1.1rem; }
.sc-navbar .navbar-brand img { filter: brightness(1.1); }

/* ---- USUARIO ACTIVO ---- */
.sc-navbar .sc-user-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9) !important;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- USUARIOS ONLINE ---- */
.sc-online-btn { color: rgba(255,255,255,.85) !important; }
.sc-online-dot { color: #4ade80; font-size: .55rem; vertical-align: middle; }
.sc-online-dropdown { min-width: 220px; }

/* ---- BOTONES ---- */
.sc-btn-primary {
  background: var(--sc-accent);
  border-color: var(--sc-accent);
  color: #fff;
  border-radius: var(--radius);
  transition: background .2s, transform .1s;
}
.sc-btn-primary:hover { background: #1558c0; border-color: #1558c0; color: #fff; transform: translateY(-1px); }
.sc-btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; border-radius: var(--radius); }
.sc-btn-whatsapp:hover { background: #1db954; border-color: #1db954; color: #fff; }

/* ---- LINKS ---- */
a { color: var(--sc-accent); }
.sc-link { color: var(--sc-accent); }
.sc-accent { color: var(--sc-accent) !important; }

/* ---- HERO ---- */
.sc-hero { background: linear-gradient(135deg, #f4f6fb 0%, #e8eef8 100%); min-height: 480px; }
.sc-hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--sc-navy); line-height: 1.2; }
.sc-text-accent { color: var(--sc-accent); }
.sc-hero-sub { color: var(--sc-muted); font-size: 1.05rem; line-height: 1.6; }
.sc-hero-logo { max-height: 280px; max-width: 100%; filter: drop-shadow(0 8px 24px rgba(0,32,96,.15)); }
.sc-hero-img-wrap { padding: 2rem; }
.sc-badge-light { background: rgba(0,64,192,.1); color: var(--sc-navy); font-weight: 600; border-radius: 20px; }

/* ---- BRANDS ---- */
.sc-brand-chip {
  background: var(--sc-navy);
  color: #fff;
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ---- STATS ---- */
.sc-stats { background: var(--sc-navy); }
.sc-stat-card { padding: 1rem; }
.sc-stat-num { font-size: 2rem; font-weight: 700; color: #fff; line-height: 1; }
.sc-stat-label { color: rgba(255,255,255,.7); font-size: .82rem; margin-top: .25rem; }

/* ---- CATEGORÍAS HOME ---- */
.sc-cat-card {
  border: 1.5px solid var(--sc-border);
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.sc-cat-card:hover { box-shadow: var(--shadow-md); border-color: var(--sc-accent); transform: translateY(-2px); }
.sc-cat-icon { font-size: 1.5rem; color: var(--sc-accent); }
.sc-cat-name { color: var(--sc-text); }

/* ---- PRODUCTOS DESTACADOS ---- */
.sc-featured-bg { background: var(--sc-light); }
.sc-featured-card {
  background: #fff;
  border: 1.5px solid var(--sc-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
}
.sc-featured-card:hover { box-shadow: var(--shadow-md); border-color: var(--sc-accent); transform: translateY(-3px); }
.sc-featured-img-wrap {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  width: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--sc-border);
  flex-shrink: 0;
}
.sc-featured-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .2s;
}
.sc-featured-card:hover .sc-featured-img { transform: scale(1.05); }
.sc-featured-body { padding: .75rem; flex: 1; display: flex; flex-direction: column; }
.sc-featured-cta { margin-top: auto; }

/* ---- WHY ---- */
.sc-why-bg { background: var(--sc-light); }
.sc-feature-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.sc-feature-icon { color: var(--sc-accent); }

/* ---- BADGES ---- */
.sc-badge { background: var(--sc-accent); color: #fff; font-size: .72rem; border-radius: 12px; }

/* ---- CONTACTO ---- */
.sc-contact-list { list-style: none; padding: 0; }
.sc-contact-list li {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .6rem 0;
  border-bottom: 1px solid var(--sc-border);
}
.sc-contact-list li i { margin-top: .15rem; font-size: 1rem; }
.sc-contact-list a { color: var(--sc-text); text-decoration: none; }
.sc-contact-list a:hover { color: var(--sc-accent); }
.sc-contact-form .form-control:focus { border-color: var(--sc-accent); box-shadow: 0 0 0 .2rem rgba(26,115,232,.15); }

/* ---- VENDEDORES ---- */
.sc-seller-card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--radius);
  transition: box-shadow .2s;
}
.sc-seller-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sc-seller-avatar {
  width: 56px; height: 56px;
  background: var(--sc-accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sc-seller-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ---- AUTH PAGES ---- */
.sc-auth-page { min-height: calc(100vh - 60px); background: var(--sc-light); }
.sc-auth-card { background: #fff; border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow-md); }
.sc-auth-card .form-control:focus { border-color: var(--sc-accent); box-shadow: 0 0 0 .2rem rgba(26,115,232,.15); }
.sc-success-icon { color: var(--sc-accent); }

/* ---- SIDEBAR CATÁLOGO ---- */
.sc-sidebar { font-size: .875rem; z-index: 1; max-height: calc(100vh - 90px); overflow-y: auto; overflow-x: hidden; }
.sc-sidebar-title { font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sc-muted); padding: .25rem 0 .5rem; }
.sc-sidebar-list { list-style: none; padding: 0; margin: 0; }
.sc-sidebar-list li { margin-bottom: 1px; }
.sc-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .6rem;
  border-radius: 6px;
  color: var(--sc-text);
  text-decoration: none;
  transition: background .15s;
}
.sc-sidebar-link:hover, .sc-sidebar-link.active { background: var(--sc-light); color: var(--sc-accent); font-weight: 600; }
.sc-sidebar-count { font-size: .72rem; color: var(--sc-muted); background: var(--sc-light); padding: .1rem .4rem; border-radius: 10px; }

/* ---- BUSCADOR ---- */
.sc-search-bar .form-control:focus { border-color: var(--sc-accent); box-shadow: 0 0 0 .15rem rgba(26,115,232,.15); }
.sc-suggestions {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1.5px solid var(--sc-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 360px;
  max-width: 560px;
  max-height: 400px;
  overflow-y: auto;
}
.sc-suggestion-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--sc-text);
  border-bottom: 1px solid var(--sc-border);
  font-size: .85rem;
}
.sc-suggestion-item:last-child { border-bottom: none; }
.sc-suggestion-item:hover { background: var(--sc-light); }
.sc-suggestion-img { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; background: var(--sc-light); flex-shrink: 0; }
.sc-suggestion-sku { font-weight: 600; color: var(--sc-navy); font-size: .78rem; }
.sc-suggestion-price { font-weight: 700; color: var(--sc-accent); font-size: .85rem; margin-left: auto; flex-shrink: 0; }

/* ---- PRODUCTOS ---- */
.sc-product-card {
  border: 1.5px solid var(--sc-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: box-shadow .2s, border-color .15s;
}
.sc-product-card:hover { box-shadow: var(--shadow-md); border-color: var(--sc-accent); }
.sc-product-img-wrap { height: 140px; background: var(--sc-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sc-product-img { max-height: 130px; max-width: 100%; object-fit: contain; transition: transform .2s; }
.sc-product-card:hover .sc-product-img { transform: scale(1.04); }
.sc-no-img { color: var(--sc-border); font-size: 2rem; }
.sc-brand-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sc-accent); }
.sc-sku { font-size: .78rem; font-weight: 600; color: var(--sc-navy); margin: 2px 0; }
.sc-desc { font-size: .75rem; line-height: 1.4; color: var(--sc-muted); min-height: 2.8em; }
.sc-price { font-size: .95rem; font-weight: 700; color: var(--sc-navy); }
.sc-price-nc { font-size: .8rem; }

/* ---- TABLA ---- */
.sc-table thead th { background: var(--sc-light); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--sc-muted); border-bottom: 2px solid var(--sc-border); }
.sc-desc-table { max-width: 320px; font-size: .82rem; color: var(--sc-muted); }
.sc-price-table { color: var(--sc-navy); white-space: nowrap; }

/* ---- VISTA BUTTONS ---- */
.sc-view-btn.active { background: var(--sc-accent); border-color: var(--sc-accent); color: #fff; }

/* ---- PAGINACIÓN ---- */
.sc-pagination { flex-wrap: wrap; gap: 2px; }
.sc-pagination .page-link { color: var(--sc-accent); border-color: var(--sc-border); min-width: 38px; text-align: center; }
.sc-pagination .page-item.active .page-link { background: var(--sc-accent); border-color: var(--sc-accent); color: #fff; }

/* ---- ADMIN ---- */
.sc-stat-admin {
  background: var(--sc-light);
  border: 1.5px solid var(--sc-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  text-align: center;
}
.sc-stat-admin.sc-stat-warn { border-color: var(--sc-warn); background: #fffbeb; }
.sc-stat-admin.sc-stat-info { border-color: var(--sc-accent); background: #eff6ff; }
.sc-stat-admin-num { font-size: 1.6rem; font-weight: 700; color: var(--sc-navy); }
.sc-stat-admin-label { font-size: .75rem; color: var(--sc-muted); }
.sc-reimport-card { background: var(--sc-light); border: 1.5px solid var(--sc-border); border-radius: var(--radius); }

/* ---- FOOTER ---- */
.sc-footer { background: #f8f9fc; border-top: 1.5px solid var(--sc-border); }
.tracking-wider { letter-spacing: .08em; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sc-hero { min-height: auto; }
  .sc-hero-img-wrap { display: none; }
  .sc-sidebar { display: none; }
  .sc-product-img-wrap { height: 110px; }
  .sc-mobile-cats { display: block !important; }
}

@media (max-width: 576px) {
  .sc-stat-num { font-size: 1.5rem; }
  .sc-suggestions { min-width: auto; width: 100%; }
}

/* ---- PRESUPUESTO ---- */

/* Badge en navbar */
.sc-budget-nav-badge {
  position: absolute;
  top: 2px; right: -4px;
  background: #e53e3e;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Botón + en tarjeta grid */
.sc-budget-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,32,96,.72);
  color: #fff;
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .12s;
  z-index: 2;
  padding: 0;
}
.sc-budget-btn:hover        { background: var(--sc-accent); transform: scale(1.1); }
.sc-budget-btn.sc-budget-btn-active             { background: var(--sc-success); }
.sc-budget-btn.sc-budget-btn-active:hover       { background: #b91c1c; }

/* Botón + en vista lista */
.sc-budget-btn-list {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--sc-border);
  background: #fff;
  color: var(--sc-navy);
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  padding: 0;
}
.sc-budget-btn-list:hover                       { background: var(--sc-accent); color: #fff; border-color: var(--sc-accent); }
.sc-budget-btn-list.sc-budget-btn-active        { background: var(--sc-success); color: #fff; border-color: var(--sc-success); }
.sc-budget-btn-list.sc-budget-btn-active:hover  { background: #b91c1c; border-color: #b91c1c; }

/* Botón "Comparar" en tarjeta grid (al lado del + de presupuesto) */
.sc-compare-btn {
  position: absolute;
  top: 6px; left: 6px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,32,96,.72);
  color: #fff;
  font-size: .72rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .12s;
  z-index: 2;
  padding: 0;
}
.sc-compare-btn:hover                    { background: var(--sc-accent); transform: scale(1.1); }
.sc-compare-btn.sc-compare-btn-active    { background: var(--sc-warn); color: #1a1f36; }

/* Botón "Comparar" en vista lista */
.sc-compare-btn-list {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--sc-border);
  background: #fff;
  color: var(--sc-navy);
  font-size: .75rem;
  cursor: pointer;
  margin-left: 4px;
  transition: background .15s, border-color .15s, color .15s;
  padding: 0;
}
.sc-compare-btn-list:hover                    { background: var(--sc-accent); color: #fff; border-color: var(--sc-accent); }
.sc-compare-btn-list.sc-compare-btn-active    { background: var(--sc-warn); color: #1a1f36; border-color: var(--sc-warn); }

/* Barra flotante de comparación */
.sc-compare-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 2px solid var(--sc-navy);
  box-shadow: 0 -4px 18px rgba(0,32,96,.18);
  z-index: 1030;
}
.sc-compare-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sc-light);
  border: 1px solid var(--sc-border);
  border-radius: 20px;
  padding: 3px 8px 3px 12px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--sc-navy);
}
.sc-compare-chip button {
  border: none;
  background: transparent;
  color: var(--sc-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.sc-compare-chip button:hover { color: #b91c1c; }
#compareGoBtn.disabled { pointer-events: none; opacity: .5; }

/* Tabla comparativa (comparar.php) */
.sc-compare-table-wrap { overflow-x: auto; }
.sc-compare-table { min-width: 720px; border-collapse: separate; border-spacing: 0; }
.sc-compare-table th, .sc-compare-table td {
  border-bottom: 1px solid var(--sc-border);
  padding: 10px 14px;
  vertical-align: top;
}
.sc-compare-table thead th {
  background: var(--sc-light);
  position: sticky; top: 0; z-index: 2;
}
.sc-compare-table .sc-compare-label-col {
  position: sticky; left: 0; z-index: 1;
  background: #fff;
  font-weight: 600;
  color: var(--sc-navy);
  min-width: 190px;
  white-space: nowrap;
}
.sc-compare-table thead .sc-compare-label-col { z-index: 3; }
.sc-compare-table tbody tr:nth-child(odd) td:not(.sc-compare-label-col) { background: rgba(0,64,192,.03); }
.sc-compare-table .sc-compare-diff { background: rgba(245,158,11,.12) !important; }
.sc-compare-col-img { width: 160px; text-align: center; }
.sc-compare-col-img img { max-width: 130px; max-height: 100px; object-fit: contain; }
.sc-compare-remove-x {
  border: none; background: transparent; color: var(--sc-muted);
  font-size: .9rem; float: right; cursor: pointer;
}
.sc-compare-remove-x:hover { color: #b91c1c; }

/* Input qty en presupuesto */
.sc-qty-input { max-width: 70px; display: inline-block; }
.print-only-qty { display: none; }

/* Fila total */
.sc-total-row td { background: var(--sc-light); color: var(--sc-navy); }

/* ---- IMPRESIÓN ---- */
.print-letterhead { display: none; }

@media print {
  .sc-navbar, footer, .no-print, .sc-whatsapp-float { display: none !important; }
  .print-letterhead  { display: block !important; text-align: center; margin-bottom: 1rem; }
  .print-lh-logo     { margin-bottom: .5rem; }
  .print-lh-logo img { height: 80px; object-fit: contain; }
  .print-lh-title    { font-size: 1.5rem; font-weight: 700; }
  .print-lh-sub      { font-size: .85rem; color: #555; }
  .print-lh-doc      { font-size: 1.2rem; font-weight: 600; margin: .4rem 0; }
  #printClientData   { text-align: left; font-size: .85rem; margin-top: .5rem; }
  #printClientData p { margin: 2px 0; }
  .sc-qty-input      { display: none !important; }
  .print-only-qty    { display: inline !important; }
  body               { font-size: 11pt; }
  .table             { font-size: 9pt; }
}

/* ---- WhatsApp flotante ---- */
.sc-whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px; height: 52px;
  background: #25d366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 999;
  text-decoration: none;
  transition: transform .2s;
}
.sc-whatsapp-float:hover { transform: scale(1.08); color: #fff; }
