/* Modo día (predeterminado) y modo noche. El script en header fija data-theme antes del pintado. */

html,
html[data-theme="day"] {
  color-scheme: light;
  --theme-bg: #f2f2f6;
  --theme-bg-elevated: #ffffff;
  --theme-text: #1a1a1f;
  --theme-text-muted: #5e5e6a;
  --theme-heading: #121218;
  --theme-border: rgba(0, 0, 0, 0.1);
  --theme-input-bg: #ffffff;
  --theme-input-border: rgba(0, 0, 0, 0.14);
  --theme-card-shadow: 0 12px 28px rgba(15, 15, 20, 0.08);
  --theme-section-base: #ececf1;
  --theme-section-top: #f5f6fa;
  --theme-section-mid: #e6e8ee;
  --dark: #ffffff;
  --card: #ffffff;
  --darker: #f0f0f4;
  --gray: #e4e4ea;
}

html[data-theme="night"] {
  color-scheme: dark;
  --theme-bg: #0f0f12;
  --theme-bg-elevated: #141417;
  --theme-text: #e8e8ec;
  --theme-text-muted: #9a9aa6;
  --theme-heading: #ffffff;
  --theme-border: rgba(255, 255, 255, 0.1);
  --theme-input-bg: #0f0f12;
  --theme-input-border: rgba(255, 255, 255, 0.1);
  --theme-card-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  --theme-section-base: #0a0a0d;
  --theme-section-top: #101016;
  --theme-section-mid: #0d0d12;
  --dark: #25252b;
  --card: #141417;
  --darker: #0f0f12;
  --gray: #323232;
}

html,
html[data-theme="day"] body {
  background: var(--theme-bg);
  color: var(--theme-text);
}

html[data-theme="night"] body {
  background: #0f0f12;
  color: #e8e8ec;
}

/* Secciones con fondo oscuro compartido */
html[data-theme="day"] .destacados,
html[data-theme="day"] .home-gallery,
html[data-theme="day"] .catalogo {
  --section-dark-base: var(--theme-section-base);
  --section-dark-top: var(--theme-section-top);
  --section-dark-mid: var(--theme-section-mid);
  background-color: var(--theme-section-base);
  background-image:
    radial-gradient(ellipse 75% 55% at 50% -10%, rgba(255, 162, 0, 0.12) 0%, transparent 58%),
    radial-gradient(ellipse 42% 38% at 92% 68%, rgba(34, 211, 238, 0.06) 0%, transparent 52%),
    radial-gradient(ellipse 38% 34% at 8% 85%, rgba(248, 104, 66, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, var(--theme-section-top) 0%, var(--theme-section-base) 48%, var(--theme-section-mid) 100%);
}

/* Tarjetas y tipografía global */
html[data-theme="day"] .producto-card {
  box-shadow: var(--theme-card-shadow);
  border: 1px solid var(--theme-border);
}
html[data-theme="day"] .producto-card h3 {
  color: var(--theme-heading);
}
html[data-theme="day"] .producto-card .pdesc {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .producto-card .price {
  color: var(--theme-heading);
}
html[data-theme="day"] .producto-card .old {
  color: #8a8a94;
}
html[data-theme="day"] .p-artist {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .p-sizes-heading {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .size-chip {
  border-color: var(--theme-border);
  background: #f8f8fb;
  color: var(--theme-heading);
}
html[data-theme="day"] .size-chip--artist-area .size-chip-label,
html[data-theme="day"] .size-chip-dim {
  color: var(--theme-text-muted);
}

html[data-theme="day"] .section-title h2 {
  color: var(--theme-heading);
}

html[data-theme="day"] .field {
  background: var(--theme-input-bg);
  border-color: var(--theme-input-border);
  color: var(--theme-text);
}
html[data-theme="day"] label.lbl {
  color: var(--theme-text-muted);
}

/* Catálogo */
html[data-theme="day"] .catalogo .cat-head h1 {
  color: var(--theme-heading);
}
html[data-theme="day"] .catalogo .cat-head p {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .cat-filter-panel {
  background: linear-gradient(145deg, #ffffff 0%, #f6f6fa 48%, rgba(255, 162, 0, 0.06) 100%);
  border-color: var(--theme-border);
  box-shadow: var(--theme-card-shadow);
}
html[data-theme="day"] .cat-search-icon {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .cat-search-input {
  background: #ffffff;
  border-color: var(--theme-input-border);
  color: var(--theme-text);
  box-shadow: 0 4px 14px rgba(15, 15, 20, 0.06);
}
html[data-theme="day"] .cat-search-input::placeholder {
  color: #9a9aa6;
}
html[data-theme="day"] .cat-search-input:focus {
  background: #ffffff;
}
html[data-theme="day"] .cat-filter-label,
html[data-theme="day"] .cat-filter-dropdown__label {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .chip,
html[data-theme="day"] .artist-filter-card {
  background: #ffffff;
  border-color: var(--theme-border);
  color: var(--theme-text);
  box-shadow: 0 4px 12px rgba(15, 15, 20, 0.05);
}
html[data-theme="day"] .chip.is-active,
html[data-theme="day"] .artist-filter-card.is-active {
  border-color: rgba(255, 162, 0, 0.45);
  background: rgba(255, 162, 0, 0.1);
}

/* Pie de página — día: gris oscuro suave, degradado y textura de puntos */
html[data-theme="day"] .edogo-footer {
  background-color: #24242e;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(255, 162, 0, 0.1) 0%, transparent 58%),
    linear-gradient(180deg, #383842 0%, #2e2e38 46%, #24242e 100%);
  background-size: 24px 24px, 100% 100%, 100% 100%;
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="day"] .footer-hero,
html[data-theme="day"] .footer-bottom {
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="day"] .footer-panel {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="day"] .footer-brand__name {
  color: #fff;
}
html[data-theme="day"] .footer-panel h3 {
  color: var(--orange);
}
html[data-theme="day"] .footer-brand__tagline {
  color: rgba(255, 255, 255, 0.82);
}
html[data-theme="day"] .footer-brand__place,
html[data-theme="day"] .footer-links a,
html[data-theme="day"] .footer-contact a,
html[data-theme="day"] .footer-trust li {
  color: rgba(255, 255, 255, 0.62);
}
html[data-theme="day"] .footer-bottom p {
  color: rgba(255, 255, 255, 0.42);
}
html[data-theme="day"] .footer-social__btn {
  border-color: rgba(255, 162, 0, 0.45);
  color: #fff;
  background: rgba(255, 162, 0, 0.08);
}
html[data-theme="day"] .footer-social__btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #0f0f12;
}

/* Páginas con gradiente oscuro */
html[data-theme="day"] .hero {
  background: linear-gradient(180deg, #fafafc 0%, #ececf2 55%, #f2f2f6 100%);
  color: var(--theme-heading);
}
html[data-theme="day"] .login,
html[data-theme="day"] .checkout,
html[data-theme="day"] .carrito,
html[data-theme="day"] .mis-pedidos,
html[data-theme="day"] .perfil,
html[data-theme="day"] .contacto,
html[data-theme="day"] .recursos,
html[data-theme="day"] .guia-artistas,
html[data-theme="day"] .reclutamiento,
html[data-theme="day"] .info-legal-page {
  background: linear-gradient(180deg, #f6f6fa 0%, var(--theme-bg) 60%) !important;
  color: var(--theme-text);
}
html[data-theme="day"] .login-card,
html[data-theme="day"] .checkout-card,
html[data-theme="day"] .perfil-card,
html[data-theme="day"] .carrito-box {
  background: #ffffff;
  border-color: var(--theme-border);
  box-shadow: var(--theme-card-shadow);
  color: var(--theme-text);
}
html[data-theme="day"] .login-sub,
html[data-theme="day"] .login-back a {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .servicios {
  background: linear-gradient(180deg, #e4e4ea 0%, #dcdce4 48%, #d4d4de 100%);
}

/* Barra inferior móvil y vista previa carrito */
html[data-theme="day"] .mobile-bottom-nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 246, 250, 0.99) 100%);
  border-top-color: var(--theme-border);
  box-shadow: 0 -8px 24px rgba(15, 15, 20, 0.08);
}
html[data-theme="day"] .mobile-bottom-nav__item {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .mobile-bottom-nav__item.is-active .mobile-bottom-nav__label {
  color: var(--theme-heading);
}
html[data-theme="day"] .mobile-bottom-nav__dropdown {
  background: #ffffff;
  border-color: var(--theme-border);
  box-shadow: 0 16px 40px rgba(15, 15, 20, 0.12);
}
html[data-theme="day"] .mobile-bottom-nav__dropdown-item {
  color: var(--theme-text);
}

html[data-theme="day"] .cart-preview {
  background: #ffffff;
  border-color: var(--theme-border);
  box-shadow: 0 16px 40px rgba(15, 15, 20, 0.14);
}
html[data-theme="day"] .cart-preview__head {
  color: var(--theme-text-muted);
  border-bottom-color: var(--theme-border);
}
html[data-theme="day"] .cart-preview__meta strong {
  color: var(--theme-heading);
}
html[data-theme="day"] .cart-preview__meta span {
  color: var(--theme-text-muted);
}
html[data-theme="day"] .cart-preview__remove {
  border-color: var(--theme-border);
  background: #f4f4f8;
  color: var(--theme-text-muted);
}

/* Interruptor día / noche */
.theme-toggle {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.theme-toggle__track {
  position: relative;
  display: flex;
  align-items: center;
  width: 46px;
  height: 26px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  transition: background 0.25s ease, border-color 0.25s ease;
}
html[data-theme="night"] .theme-toggle__track {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}
.theme-toggle__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, background 0.25s ease;
}
html[data-theme="day"] .theme-toggle__thumb {
  transform: translateX(0);
}
html[data-theme="night"] .theme-toggle__thumb {
  transform: translateX(20px);
  background: #2a2a32;
}
.theme-toggle__glyph {
  width: 14px;
  height: 14px;
}
.theme-toggle__glyph--sun {
  color: #f59e0b;
}
.theme-toggle__glyph--moon {
  color: #a5b4fc;
}
html[data-theme="day"] .theme-toggle__glyph--moon,
html[data-theme="night"] .theme-toggle__glyph--sun {
  display: none;
}

.mobile-menu__theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 600;
}
html[data-theme="day"] .mobile-menu__theme {
  border-top-color: var(--theme-border);
  color: var(--theme-text);
}

.mobile-bottom-nav__dropdown-item--theme {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

html[data-theme="day"] .mobile-menu {
  background: #ffffff;
  border-top-color: var(--theme-border);
}
html[data-theme="day"] .mm-link {
  color: var(--theme-heading);
  border-bottom-color: var(--theme-border);
}
