/* ===========================
   BASE
=========================== */
body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background-color: #faf5ef;
  color: #3a2a27;
  line-height: 1.6;
  transition: background-color 0.6s ease, color 0.6s ease;
}

/* ===========================
   HEADER
=========================== */
header {
  background-color: #7b1113;
  padding: 0 40px;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 180px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: scale(1.05);
}

.nav-principal {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-principal a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-principal a:hover {
  color: #ffddc4;
}

.nav-principal a.active {
  border-bottom: 2px solid #ffddc4;
}

/* Botón ☰ desplegable */
.menu-desplegable {
  position: relative;
}

.menu-btn {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  padding: 6px 10px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.menu-btn:hover {
  transform: scale(1.1);
  color: #ffddc4;
}

.dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  width: 200px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 12px 0;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dropdown.visible {
  opacity: 1;
  pointer-events: auto;
}

.dropdown a {
  text-decoration: none;
  color: #ff073a; 
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown li {
  list-style: none;
}

.dropdown a:hover {
  background-color: rgba(255, 7, 58, 0.15);
  color: white;
}

.dropdown hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 6px 0;
}

/* Responsive header */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 20px;
  }

  .logo img {
    height: 100px;
    margin-bottom: 10px;
  }

  .nav-principal {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }

  .dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ===========================
   BLOQUE LEGAL
=========================== */
.legal {
  max-width: 900px;
  margin: 60px auto;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  text-align: center;
  /* centrado en modo claro */
  transition: background-color 0.6s ease, color 0.6s ease;
}

.legal h1 {
  font-family: "Playfair Display", serif;
  font-size: 32px;
  margin-bottom: 20px;
}

/* ===========================
   FOOTER
=========================== */
footer {
  background-color: #7b1113;
  color: #ffffff;
  padding: 60px 40px;
  border-top: 2px solid #5d0c0d;
  font-size: 16px;
  transition: background-color 0.6s ease, color 0.6s ease;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.footer-column.contacto ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column.contacto li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #f5f5f5;
  transition: color 0.3s ease;
}

.footer-column.contacto li span {
  font-size: 18px;
}

.footer-column.contacto a {
  color: #ffddc4;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-column.contacto a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-column h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #ffddc4;
  font-weight: 600;
}

.footer-column p,
.footer-column a {
  font-size: 15px;
  margin: 4px 0;
  color: #f5f5f5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Newsletter */
.newsletter form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter input {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ffddc4;
  font-size: 14px;
  background-color: #fff8f0;
  color: #3a2a27;
}

.newsletter button.btn {
  background-color: #a33b3d;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.newsletter button.btn:hover {
  background-color: #8c2f31;
}



.footer-bottom {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: #ffddc4;
}

.footer-legals-line {
  margin-top: 30px;
  text-align: center;
  font-size: 14px;
  color: #ffddc4;
}

.footer-legals-line a {
  color: #ffddc4;
  text-decoration: none;
  font-weight: 500;
  margin: 0 6px;
  transition: color 0.3s ease;
}

.footer-legals-line a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ===========================
   BOTÓN FLOTANTE
=========================== */
#toggle-theme {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #7b1113;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: 0.3s ease;
  z-index: 200;
}

#toggle-theme:hover {
  background-color: #5c0d0f;
  transform: scale(1.1);
}

body.dark-mode #toggle-theme {
  background-color: #5c0d0f;
}

body.dark-mode #toggle-theme:hover {
  background-color: #380202;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-column {
    width: 100%;
    margin-bottom: 20px;
  }

  .legal {
    margin: 40px 20px;
    padding: 15px;
  }
}

/* ===========================
   MODO OSCURO
=========================== */
body.dark-mode {
  background-color: #2a0a0a;
  color: #ffddc4;
  transition: background-color 0.6s ease, color 0.6s ease;
}

/* Header */
body.dark-mode header {
  background-color: #380202;
  border-color: #440909;
}

body.dark-mode .nav-principal a {
  color: #ffddc4;
}

body.dark-mode .nav-principal a:hover {
  color: #ffffff;
}

body.dark-mode .nav-principal a.active {
  border-bottom: 2px solid #ff5a5a;
}

body.dark-mode .menu-btn {
  color: #ffddc4;
}

body.dark-mode .dropdown {
  background: rgba(40, 10, 10, 0.25);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.05);
}

body.dark-mode .dropdown a {
  color: #ffddc4;
}

body.dark-mode .dropdown a:hover {
  background-color: rgba(232, 76, 76, 0.2);
  color: white;
}

/* Bloque legal */
body.dark-mode .legal {
  background-color: rgba(60, 10, 10, 0.6);
  /* más claro que el fondo */
  color: #ffddc4;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  text-align: center;
}

body.dark-mode .legal h1 {
  color: #ffddc4;
}

/* Footer */
body.dark-mode footer {
  background-color: #3b0f0f;
  /* tono diferenciado del body */
  color: #f5f5f5;
  border-top: 2px solid #440909;
}

body.dark-mode .footer-column h3 {
  color: #ffddc4;
}

body.dark-mode .footer-column p,
body.dark-mode .footer-column a,
body.dark-mode .footer-column.contacto li {
  color: #e0e0e0;
}

body.dark-mode .footer-column.contacto a {
  color: #ffddc4;
}

body.dark-mode .footer-column.contacto a:hover,
body.dark-mode .footer-legals-line a:hover {
  color: #ffffff;
}

body.dark-mode .newsletter input {
  background-color: #2a0a0a;
  color: #f5f5f5;
  border-color: #7b1113;
}

body.dark-mode .newsletter button.btn {
  background-color: #a33b3d;
}

body.dark-mode .newsletter button.btn:hover {
  background-color: #ff5a5a;
}

body.dark-mode .footer-bottom,
body.dark-mode .footer-legals-line {
  color: #ffddc4;
}

body.dark-mode .footer-legals-line a {
  color: #ffddc4;
}

/* Botón flotante */
body.dark-mode #toggle-theme {
  background-color: #5c0d0f;
}

body.dark-mode #toggle-theme:hover {
  background-color: #380202;
}

/* ===========================
   TRANSICIONES GENERALES
=========================== */
body,
header,
footer,
.nav-principal a,
.dropdown,
.legal,
.btn,
.newsletter input,
.newsletter button.btn {
  transition: background-color 0.6s ease,
    color 0.6s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
}

body.dark-mode .dropdown a {
  color: #ffffff; /* blanco puro */
 
}

.language-dropdown {
  position: relative;
  display: inline-block;
}

.lang-btn {
  background-color: transparent;
  border: 2px solid #ffddc4;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.lang-btn:hover {
  background-color: #ffddc4;
  color: #7b1113;
  transform: scale(1.05);
}

.lang-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 80px;
  background: rgba(255, 221, 196, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 6px 0;
  list-style: none;
  margin: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lang-menu.visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.lang-menu li a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  display: block;
  text-align: center;
  padding: 4px 12px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.lang-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #7b1113;
  border-radius: 6px;
}

/* === Ajustes solicitados para el menú de idioma === */

/* Fondo semitransparente + texto rojo oscuro en modo claro */
.lang-menu {
  background: rgba(255, 221, 196, 0.85) !important;
}

.lang-menu li a {
  color: #7b1113 !important;
  /* rojo oscuro */
}

/* Hover en modo claro */
.lang-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #7b1113 !important;
}

/* === Modo oscuro === */
body.dark-mode .lang-menu {
  background: rgba(40, 10, 10, 0.85) !important;
}

body.dark-mode .lang-menu li a {
  color: #ffffff !important;
  /* blanco */
}

body.dark-mode .lang-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}


/* Botón flotante del carrito */
#cart-button {
  position: fixed;
  bottom: 80px; /* debajo del botón de modo oscuro */
  right: 20px;
  background-color: #7b1113;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease, transform 0.3s ease;
  z-index: 200;
}

#cart-button:hover {
  background-color: #5c0d0f;
  transform: scale(1.1);
}

/* Panel del carrito */
#cart-panel {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 280px;
  background-color: #fff8f0;
  border: 2px solid #ffddc4;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 300;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cart-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.cart-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#cart-panel h3 {
  margin-top: 0;
  font-size: 18px;
  color: #7b1113;
}

#cart-items {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

#cart-items li {
  font-size: 15px;
  margin-bottom: 6px;
  color: #3a2a27;
}

#cart-empty {
  font-size: 14px;
  color: #a33b3d;
  margin-bottom: 10px;
}

/* Modo oscuro */
body.dark-mode #cart-panel {
  background-color: #2a0a0a;
  border-color: #7b1113;
}

body.dark-mode #cart-panel h3,
body.dark-mode #cart-items li,
body.dark-mode #cart-empty {
  color: #ffddc4;
}


.afegir-carreto {
  background-color: #a33b3d;
  color: white;
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.afegir-carreto:hover {
  background-color: #7b1113;
  transform: scale(1.05);
  border: 2px solid #ff073a;
  box-shadow: 0 0 10px #ff073a;
}

body.dark-mode .afegir-carreto {
  background-color: #7b1113;
  color: #ffddc4;
}

body.dark-mode .afegir-carreto:hover {
  background-color: #ff073a;
  color: white;
  border-color: #ff073a;
}

.afegir-carreto {
  background-color: #a33b3d;
  color: white;
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.afegir-carreto:hover {
  background-color: #7b1113;
  transform: scale(1.05);
  border: 2px solid #ff073a;
  box-shadow: 0 0 10px #ff073a;
}

/* Modo oscuro */
body.dark-mode .afegir-carreto {
  background-color: #7b1113;
  color: #ffddc4;
}

body.dark-mode .afegir-carreto:hover {
  background-color: #ff073a;
  color: white;
  border-color: #ff073a;
}

/* ===== PRELOADER GENERAL ===== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* Fondo transparente con blur fuerte */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);

  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;

  /* Ocultación suave */
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* ===== SPINNER CIRCULAR ===== */
.loader {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 221, 196, 0.4); /* tono suave */
  border-top-color: #ffddc4; /* color principal */
  border-radius: 50%;

  /* Velocidad ajustada (más lento y elegante) */
  animation: girar 1.4s linear infinite;
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

/* ===== OCULTAR PRELOADER SUAVEMENTE ===== */
#preloader.oculto {
  opacity: 0;
  visibility: hidden;
}

/* ===== EVITAR QUE SE MUESTRE SI YA CARGÓ UNA VEZ ===== */
.skip-preloader #preloader {
  display: none !important;
}
