/* css/styles2.css */

/* ========================= RESET ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
img {
  max-width: 100%;
  display: block;
}
html {
  scroll-behavior: smooth;
}

/* ========================= TOKENS ========================= */
:root {
  --bg-deep: #1a0e0d;
  --bg-main: #2a1a18;
  --bg-card: #3a2220;
  --brown: #4a2c2a;
  --brown-mid: #6b3d3a;
  --gold: #c6a96b;
  --cream: #f5efe6;
  --cream-muted: rgba(245, 239, 230, 0.45);
  --cream-dim: rgba(245, 239, 230, 0.25);
  --gold-border: rgba(198, 169, 107, 0.2);
  --radius: 8px;
  --transition: 0.3s ease;
}

/* ========================= BASE ========================= */
body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg-main);
  color: var(--cream);
  line-height: 1.6;
}

body.loading {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-family: Georgia, serif;
}
h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-family: Georgia, serif;
}
h3 {
  font-size: 1.1rem;
}

p {
  color: var(--cream-muted);
  margin-bottom: 12px;
  line-height: 1.7;
}
a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
.section {
  padding: 96px 0;
}
.section-alt {
  background: var(--bg-deep);
}

/* ── Parallax bands ──────────────────────────────────────────────────────── */
.parallax-band {
  height: 75vh;
  overflow: hidden;
  position: relative;
}

.parallax-band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: center;
  will-change: transform;
}

.text-center {
  text-align: center;
}
.mt-2 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 24px;
}

/* ========================= LABEL ========================= */
.section-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

/* ========================= LOADER ========================= */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  font-family: Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(16px);
}

.loader-bar-wrap {
  width: 120px;
  height: 1px;
  background: rgba(198, 169, 107, 0.15);
  border-radius: 1px;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 1px;
  transition: width 0.3s ease;
}

/* ========================= NAVBAR ========================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 0;
  z-index: 1000;
  background: transparent;
  transition:
    background var(--transition),
    border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(26, 14, 13, 0.97);
  border-bottom-color: var(--gold-border);
  backdrop-filter: blur(8px);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1) sepia(0.3) hue-rotate(5deg) saturate(1.5);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-nav a {
  color: var(--cream-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

.navbar-nav a:hover {
  color: var(--gold);
}

.navbar-cta {
  padding: 8px 16px !important;
  color: var(--bg-deep) !important;
}

.navbar-cta:hover {
  color: var(--bg-deep) !important;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: var(--transition);
}

@media (max-width: 767px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-deep);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--gold-border);
  }

  .navbar-nav.open {
    display: flex;
  }
}

/* ========================= HERO ========================= */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 85%,
    rgba(74, 44, 42, 0.55) 0%,
    rgba(26, 14, 13, 0.8) 100%
  );
  z-index: 3;
}

.layer {
  position: absolute;
  width: 100%;
  height: 120%;
  top: -10%;
  left: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.layer-back {
  z-index: 0;
  background-image: url("../assets/img/hero-back.png");
}
.layer-mid {
  z-index: 1;
  background-image: url("../assets/img/hero-mid.png");
}
.layer-front {
  z-index: 2;
  background-image: url("../assets/img/hero-front.png");
}

.hero-content {
  position: relative;
  z-index: 4;
  max-width: 750px;
  padding: 0 20px;
}

.hero-supertitle {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 16px;
  opacity: 0;
}

.hero-line {
  display: block;
  line-height: 1.05;
  opacity: 0;
}

.hero-line-1 {
  color: var(--cream);
}
.hero-line-2 {
  color: var(--gold);
}

.hero-sub {
  color: var(--cream-muted);
  font-size: 1rem;
  margin: 20px 0 28px;
  opacity: 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cream-dim);
  font-size: 1.2rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ========================= BUTTONS ========================= */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: var(--cream);
  color: var(--bg-deep);
}

.btn-secondary {
  border: 1px solid rgba(245, 239, 230, 0.35);
  color: var(--cream);
  background: transparent;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ========================= TICKER ========================= */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  border-top: 1px solid var(--gold-border);
  border-bottom: 1px solid var(--gold-border);
  user-select: none;
}

.ticker-gold {
  background: var(--brown);
}
.ticker-cream {
  background: var(--brown-mid);
}

.ticker-track {
  display: inline-flex;
  will-change: transform;
  animation: ticker-scroll 22s linear infinite;
}

.ticker-track-reverse {
  animation-direction: reverse;
  animation-duration: 28s;
}

.ticker-gold .ticker-track span {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

.ticker-cream .ticker-track span {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: rgba(245, 239, 230, 0.6);
  text-transform: uppercase;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

/* ========================= GRID ========================= */
.grid {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================= CARDS ========================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(198, 169, 107, 0.12);
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover img {
  transform: scale(1.06);
}

.card-content {
  padding: 18px;
}
.card-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--cream);
}
.card-text {
  font-size: 0.88rem;
  color: var(--cream-muted);
  margin: 0;
}

/* ========================= PRODUCTOS ========================= */
#productos {
  background: var(--bg-main);
}

/* ========================= PRENSA ========================= */
.card-prensa-tipo {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ========================= HISTORIA ========================= */
.historia-layout {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .historia-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.historia-text h2 {
  color: var(--cream);
}

.historia-img {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--gold-border);
}

.historia-img img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition:
    transform 0.6s ease,
    filter 0.6s ease;
}

.historia-img:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.historia-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(198, 169, 107, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: var(--radius);
  pointer-events: none;
}

.historia-img:hover::after {
  opacity: 1;
}

/* ========================= DIFERENCIALES ========================= */
#diferenciales {
  background: var(--bg-deep);
}

.diferenciales-grid {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}

@media (min-width: 640px) {
  .diferenciales-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .diferenciales-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.diferencial {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: border-color var(--transition);
}

.diferencial:hover {
  border-color: var(--gold);
}

.diferencial-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 14px;
}

.diferencial h3 {
  font-size: 0.95rem;
  color: var(--cream);
  margin-bottom: 8px;
}
.diferencial p {
  font-size: 0.85rem;
  margin: 0;
}

/* ========================= DÓNDE COMPRAR ========================= */
#comprar {
  background: var(--bg-main);
}

.comprar-lista {
  list-style: none;
  max-width: 600px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comprar-lista li {
  font-size: 1rem;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--gold-border);
  color: var(--cream-muted);
}

.comprar-lista strong {
  color: var(--cream);
}

.comprar-lista a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comprar-mapa {
  margin-top: 40px;
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gold-border);
}

.comprar-mapa iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ========================= FORM ========================= */
#contacto {
  background: var(--bg-main);
}

.form {
  max-width: 520px;
  margin: 40px auto 0;
}

.form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 6px;
  margin-top: 20px;
  letter-spacing: 0.03em;
}

.form label:first-of-type {
  margin-top: 0;
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(198, 169, 107, 0.2);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--cream);
  transition: border-color var(--transition);
  resize: vertical;
}

.input::placeholder {
  color: rgba(245, 239, 230, 0.25);
}
.input:focus {
  outline: none;
  border-color: var(--gold);
}
.input.error {
  border-color: #e74c3c;
}

.form-feedback {
  margin-top: 12px;
  font-size: 0.9rem;
  min-height: 1.4em;
}
.form-feedback.success {
  color: #2ecc71;
}
.form-feedback.error {
  color: #e74c3c;
}

/* ========================= FOOTER ========================= */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--gold-border);
  color: var(--cream);
  padding: 48px 0 24px;
  text-align: center;
}

.footer-brand {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 24px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-nav a {
  color: var(--cream-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--gold);
}

.footer-redes {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-redes a {
  color: var(--cream-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-redes a:hover {
  color: var(--gold);
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(245, 239, 230, 0.2);
  margin: 0;
}

/* ========================= PRENSA ========================= */
#prensa {
  background: var(--bg-deep);
}

/* ========================= MOBILE ========================= */
@media (max-width: 480px) {
  .section {
    padding: 64px 0;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
  .comprar-mapa {
    height: 280px;
  }
}

/* ========================= THEME TRANSITION ========================= */
html,
body {
  transition:
    background-color var(--transition),
    color var(--transition);
}

/* ========================= THEME TOGGLE BUTTON ========================= */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--cream-muted);
  padding: 4px 8px;
  transition: color var(--transition);
  line-height: 1;
  order: -1;
}

.theme-toggle:hover {
  color: var(--gold);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Smooth scroll offset para navbar fija */
section[id] {
  scroll-margin-top: 72px;
}

/* ========================= MAPA LEAFLET ========================= */

/* Boost de contraste en los tiles — Dark Matter es demasiado oscuro por defecto */
#mapa2 .leaflet-tile-pane {
  filter: brightness(2.8) contrast(1.15) sepia(0.12);
}

/* Marcador dorado personalizado */
.mapa-marker {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border: 2px solid var(--cream);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 16px rgba(198, 169, 107, 0.4);
}

.mapa-marker::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--bg-deep);
  border-radius: 50%;
}

/* Popup del marcador */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  border: 1px solid var(--gold-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  color: var(--cream) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

.leaflet-popup-content {
  margin: 14px 18px !important;
  font-family: system-ui, sans-serif !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
}

.mapa-popup-title {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.mapa-popup-addr {
  color: var(--cream-muted);
  font-size: 0.8rem;
}

/* Controles de zoom */
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--gold) !important;
  border-color: var(--gold-border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--brown) !important;
}

/* Atribución */
.leaflet-control-attribution {
  background: rgba(26, 14, 13, 0.85) !important;
  color: rgba(245, 239, 230, 0.3) !important;
  font-size: 0.6rem !important;
}

.leaflet-control-attribution a {
  color: rgba(198, 169, 107, 0.5) !important;
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    transition: none;
  }
}

/* ========================= LIGHT MODE ========================= */
[data-theme="light"] {
  --bg-deep: #ffffff;
  --bg-main: #f5efe6;
  --bg-card: #ffffff;
  --cream: #0b0b0b;
  --cream-muted: #2a2a2a;
  --cream-dim: rgba(11, 11, 11, 0.4);
  --gold-border: rgba(74, 44, 42, 0.15);
}

/* Navbar initial: semi-transparent backdrop in light mode */
[data-theme="light"] .navbar:not(.scrolled) {
  background: rgba(245, 239, 230, 0.5);
  backdrop-filter: blur(4px);
}

/* Navbar scrolled state */
[data-theme="light"] .navbar.scrolled {
  background: rgba(245, 239, 230, 0.97);
  border-bottom-color: rgba(74, 44, 42, 0.15);
  backdrop-filter: blur(8px);
}

/* Logo: remove dark-mode inversion filter */
[data-theme="light"] .navbar-logo img {
  filter: none;
}

/* Mobile dropdown menu background — desktop only uses transparent */
@media (max-width: 767px) {
  [data-theme="light"] .navbar-nav {
    background: var(--bg-main);
  }
}

/* Secondary button border (hardcoded in base, needs override) */
[data-theme="light"] .btn-secondary {
  border-color: rgba(74, 44, 42, 0.4);
}

/* Hero: lock text + buttons to dark-mode values — hero always has dark overlay */
[data-theme="light"] .hero .hero-supertitle {
  color: rgba(245, 239, 230, 0.25);
}
[data-theme="light"] .hero .hero-line-1 {
  color: #f5efe6;
}
[data-theme="light"] .hero .hero-sub {
  color: rgba(245, 239, 230, 0.45);
}
[data-theme="light"] .hero .hero-scroll-hint {
  color: rgba(245, 239, 230, 0.25);
}
[data-theme="light"] .hero .btn-secondary {
  border-color: rgba(245, 239, 230, 0.35);
  color: #f5efe6;
}
[data-theme="light"] .hero .btn-primary {
  color: #1a0e0d;
}

/* Form inputs: placeholder color (hardcoded in base) */
[data-theme="light"] .input::placeholder {
  color: rgba(11, 11, 11, 0.35);
}

/* Footer copyright (hardcoded rgba in base) */
[data-theme="light"] .footer-copy {
  color: rgba(11, 11, 11, 0.3);
}

/* Leaflet map: reset dark tile filter and attribution in light mode */
[data-theme="light"] #mapa2 .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg);
}

[data-theme="light"] .leaflet-control-attribution {
  background: rgba(245, 239, 230, 0.85) !important;
  color: rgba(11, 11, 11, 0.5) !important;
}

[data-theme="light"] .leaflet-control-attribution a {
  color: rgba(74, 44, 42, 0.7) !important;
}

/* ========================= SUPPRESS TRANSITIONS ========================= */
/* Suppress transitions during initial theme application */
html.no-transitions,
html.no-transitions body {
  transition: none !important;
}
