html { font-size: 16px; position: relative; min-height: 100%; }

/* Modo día: variables explícitas para texto oscuro legible (tarjetas, títulos, muted) */
html:not([data-bs-theme="dark"]) {
  --bs-body-color: #151922;
  --bs-body-color-rgb: 21, 25, 34;
  --bs-heading-color: #0f1318;
  --bs-emphasis-color: #0a0c0f;
  --bs-secondary-color: rgba(21, 25, 34, 0.78);
  --bs-card-color: #151922;
}

/*
  Bootstrap fuerza .text-muted con !important y var(--bs-secondary-color).
  Refuerzo explícito en modo claro para que vistas/tienda/evaluaciones en tarjetas se lean bien.
*/
html:not([data-bs-theme="dark"]) .text-muted {
  color: #3d4556 !important;
}

body {
  margin-bottom: 5.5rem;
  background: #f4f8ff;
  color: var(--bs-body-color);
  transition: background-color .25s ease, color .25s ease;
}

/* Pie: redes + copyright (complementa _Layout.cshtml.css .footer position) */
.app-footer .footer-social-btn {
  width: 2.35rem;
  height: 2.35rem;
}
.app-footer .footer-social-btn:hover {
  background: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.45);
  color: #0d6efd;
}
html[data-bs-theme="dark"] .app-footer .footer-social-btn:hover {
  background: rgba(148, 197, 255, 0.12);
  border-color: rgba(148, 197, 255, 0.35);
  color: #9ec5fe;
}

.app-header {
  background: linear-gradient(90deg, #e9f2ff 0%, #f6faff 100%);
}

/* Barra superior solo administradores */
.app-header-admin {
  background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 100%);
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.app-header-admin .navbar-brand,
.app-header-admin .nav-link:not(.active) {
  color: rgba(255, 255, 255, 0.92) !important;
}
.app-header-admin .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.app-header-admin .nav-link.active {
  color: #fff !important;
}
.app-header-admin .form-control {
  background: rgba(255, 255, 255, 0.95);
}
.app-header-admin .brand-scale-svg {
  color: #fff;
}
html[data-bs-theme="dark"] .app-header-admin {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
}
.app-body-admin {
  background: #f0f4fa;
}
html[data-bs-theme="dark"] .app-body-admin {
  background: #0d1118;
}
.admin-stat-card {
  transition: transform 0.15s ease;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
}

.navbar-brand { letter-spacing: .4px; }
.navbar .nav-link {
  border-radius: 999px;
  padding: .4rem .8rem !important;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.navbar .nav-link:hover {
  transform: translateY(-1px);
  background: rgba(13, 110, 253, .12);
}
/* Enlaces de icono (Catalogo, Carrito, etc.): solo icono; titulo/aria en el <a> */
.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: .35rem;
}
.nav-icon-link i {
  font-size: 1.1rem;
  line-height: 1;
}

/* Movil/tablet: iconos Catalogo/Carrito/etc. en fila para no apilar y tapar la busqueda */
@media (max-width: 991.98px) {
  .navbar-collapse .public-icon-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
  }
  .navbar-collapse .public-icon-nav .nav-item {
    width: auto;
  }
}

.card {
  border: 1px solid #dde6f4;
  box-shadow: 0 8px 20px rgba(25, 45, 90, 0.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(25, 45, 90, 0.12);
}
.card-img-top { height: 190px; object-fit: cover; }

.catalog-filters-card.sticky-lg-top {
  top: 1rem;
  z-index: 2;
}
.catalog-filters-form .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

html[data-bs-theme="dark"] body {
  background: #0d1118;
  color: #dbe5f5;
}
html[data-bs-theme="dark"] .text-muted {
  color: #8ea3bf !important;
}
html[data-bs-theme="dark"] .app-header {
  background: linear-gradient(90deg, #0f1724 0%, #162033 100%);
}
html[data-bs-theme="dark"] .navbar .nav-link:hover {
  background: rgba(148, 197, 255, .14);
}
html[data-bs-theme="dark"] .nav-icon-link {
  color: #dbe5f5;
}
html[data-bs-theme="dark"] .card {
  border-color: #263247;
  background: #131c2b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Hero inicio: colores explicitos para dia/noche (evita texto claro sobre fondo claro) */
.home-hero {
  background: linear-gradient(135deg, #e8f1fc 0%, #f2f7ff 100%);
  border-color: #cfe2ff !important;
  color: #152238;
}
.home-hero-title {
  color: #0d1f3a;
}
.home-hero-lead {
  color: #2c3f5c;
}
html[data-bs-theme="dark"] .home-hero {
  background: linear-gradient(135deg, #1a2436 0%, #243047 100%);
  border-color: #3d4f68 !important;
  color: #e8eef9;
}
html[data-bs-theme="dark"] .home-hero-title {
  color: #f1f6ff;
}
html[data-bs-theme="dark"] .home-hero-lead {
  color: #c6d4ea;
}

/* Logo balanza */
.brand-scale-svg {
  flex-shrink: 0;
  color: #0d6efd;
}
html[data-bs-theme="dark"] .brand-scale-svg {
  color: #9ec5fe;
}

.theme-toggle-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icono solo cuenta (invitado) */
.nav-login-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #0d6efd;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.nav-login-icon:hover {
  background: rgba(13, 110, 253, 0.12);
  color: #0a58ca;
  transform: scale(1.05);
}
html[data-bs-theme="dark"] .nav-login-icon {
  color: #9ec5fe;
}
html[data-bs-theme="dark"] .nav-login-icon:hover {
  background: rgba(158, 197, 254, 0.15);
  color: #cfe2ff;
}

/* Pagina de login Identity */
.login-hero-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.06) 100%);
  border: 1px solid rgba(13, 110, 253, 0.25);
  font-size: 2rem;
  color: #0d6efd;
}
html[data-bs-theme="dark"] .login-hero-icon {
  background: linear-gradient(145deg, rgba(158, 197, 254, 0.2) 0%, rgba(158, 197, 254, 0.06) 100%);
  border-color: rgba(158, 197, 254, 0.35);
  color: #9ec5fe;
}
.login-card {
  border-radius: 1rem;
  background: var(--bs-body-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
html[data-bs-theme="dark"] .login-card {
  border-color: #2c3a50;
  background: #131c2b;
}