@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;700&family=Montserrat:wght@400;700&display=swap');

/* --- VARIABLES & RESETS --- */
:root {
  --primary-color: #BFB47A;
  --secondary-color: #1F3740;
  --tertiary-color: #345259;
  --accent-color: #BFB188;
  --text-color: #FFFFFF;
  --font-family-serif: 'Lora', serif;
  --font-family-sans-serif: 'Montserrat', sans-serif;

  /* Vertical Spacing Variables */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-sans-serif);
  background-color: #000;
  color: var(--text-color);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- GENERAL & SHARED STYLES --- */
.main-container {
  display: flex;
  flex-direction: column;
}

section {
  padding: var(--spacing-xl) var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-family-serif);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;
}

.cta-button {
  display: inline-block;
  padding: var(--spacing-sm) 2.5rem;
  background-color: var(--primary-color);
  color: #000000;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 3.13rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 0.25rem 0.94rem rgba(0,0,0,0.2);
}

.cta-button:hover {
  background-color: var(--accent-color);
  transform: scale(1.05);
}

.fade-in-up {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- HEADER & LANGUAGE SWITCHER --- */
.language-switcher-top-right {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  z-index: 1000;
  display: flex;
  gap: var(--spacing-xs);
}

.flag-icon {
  width: 1.5rem;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0.25rem;
  transition: transform 0.2s ease-in-out;
}

.flag-icon:hover {
  transform: scale(1.1);
}

.header-logo {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  z-index: 1000;
  width: 8rem;
}

/* --- HERO SECTION --- */
.hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/LA-HISTORIA-DE-AREHUCAS.jpg');
  background-size: cover;
  background-position: center center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-md);
}

.hero-content {
  max-width: 37.5rem;
}

.title {
  font-family: var(--font-family-serif);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
  text-shadow: 0.125rem 0.125rem 0.5rem rgba(0,0,0,0.7);
  line-height: 1.2;
  text-transform: uppercase;
}

.title .text-arehucas {
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--primary-color);
  display: block;
  font-weight: 900;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: var(--spacing-md);
  font-style: italic;
  max-width: 30ch; /* Limit line length on mobile */
  margin-left: auto;
  margin-right: auto;
}

/* --- STORY SECTION --- */
.story-section {
  padding: var(--spacing-xl) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--secondary-color);
}

.story-container {
  text-align: center;
  max-width: 40rem;
}

.story-title {
  font-family: var(--font-family-serif);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 400;
  color: var(--text-color);
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: var(--spacing-lg);
}

.story-title-highlight {
  display: block;
  font-weight: 700;
  color: var(--primary-color);
  font-size: clamp(3rem, 9vw, 4.5rem);
}

.story-content p {
  font-size: 1.125rem;
  color: var(--text-color);
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
  opacity: 0.9;
}

.story-content p:last-child {
  margin-bottom: 0;
}

/* --- LEGACY PARALLAX SECTION --- */
.legacy-parallax-section {
  min-height: 70vh;
  background-image: url('../img/Bodega.jpg');
  background-attachment: scroll; /* Mobile-first: no fixed attachment */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--spacing-md);
}

.legacy-parallax-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.parallax-content-box {
  position: relative;
  z-index: 2;
  background-color: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--spacing-lg);
  border-radius: 0.75rem;
  text-align: center;
  max-width: 42rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.parallax-content-box p {
  font-size: 1.125rem;
  line-height: 1.7;
}

/* --- FAQ SECTION --- */
.faq-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--secondary-color);
}

.faq-grid-container {
  display: block; /* Mobile: single column */
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
}

.faq-title-column {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.faq-title-column .section-title {
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1.1;
}

.faq-item {
  border-bottom: 1px solid var(--primary-color);
  padding: var(--spacing-sm) 0;
}

.faq-item:first-child {
  border-top: 1px solid var(--primary-color);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: var(--spacing-sm) 0;
}

.faq-question h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  padding-right: var(--spacing-sm);
}

.faq-icon {
  font-size: 2rem;
  font-weight: 300;
  color: var(--primary-color);
  transition: transform 0.3s ease-in-out;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out;
  font-size: 1rem;
  padding-right: 2rem;
}

.faq-answer p {
  padding-bottom: var(--spacing-md);
}

.faq-item.active .faq-answer {
  max-height: 20rem;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* --- FORM SECTION --- */
.form-section {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--spacing-md);
  background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../img/ExA_002 1970.jpg');
  background-size: cover;
  background-position: center;
}

.form-container-glass {
  width: 100%;
  max-width: 40rem;
  background-color: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--spacing-lg);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.form-intro {
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: bold;
  color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--tertiary-color);
  border-radius: 0.5rem;
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(191, 177, 136, 0.3);
}

.form-group-checkbox {
  display: flex;
  align-items: center;
  text-align: left;
  margin-bottom: 1rem;
}

.form-group-checkbox label {
  font-size: 0.875rem;
  opacity: 0.8;
  line-height: 1.5;
  padding-left: var(--spacing-sm);
}

.form-group-checkbox label a {
  color: var(--primary-color);
  text-decoration: underline;
}

.form-group-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--primary-color);
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.form-group-checkbox input[type="checkbox"]:checked {
  background-color: var(--primary-color);
}

.form-group-checkbox input[type="checkbox"]:checked::after {
  content: '✔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 0.875rem;
}

.form-legal {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.form-submit-wrapper .cta-button {
  width: 100%;
  padding: 1rem;
  font-size: 1.25rem;
}

/* --- FOOTER --- */
.footer {
  padding: var(--spacing-lg) var(--spacing-md);
  background-color: #101010;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 75rem;
  margin: 0 auto;
  gap: var(--spacing-md);
}

.footer-logo-column { order: 1; }
.footer-social-column { order: 2; margin: var(--spacing-sm) 0; }
.footer-links-column { order: 3; }

.footer-logo {
  width: 10rem;
  margin-bottom: var(--spacing-sm);
}

.footer-copyright {
  font-size: 0.875rem;
  opacity: 0.7;
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-links-column a,
.social-links a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}

.footer-links-column a:hover,
.social-links a:hover {
  color: var(--primary-color);
}

.social-links a:hover {
  transform: scale(1.1);
}


/* --- MEDIA QUERIES FOR LARGER SCREENS --- */

/* Tablet */
@media (min-width: 768px) {
  section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    gap: var(--spacing-lg);
  }

  .footer-logo-column { order: 1; }
  .footer-links-column { order: 2; flex-direction: row; }
  .footer-social-column { order: 3; }
}

/* Desktop */
@media (min-width: 1024px) {
  /* Restore vertical story title for desktop */
  .story-container {
    display: flex;
    align-items: center;
    text-align: left;
    max-width: 75rem;
    gap: var(--spacing-lg);
  }
  .story-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    padding: 0;
    padding-right: var(--spacing-md);
    border-right: 2px solid var(--primary-color);
    margin-bottom: 0;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
  }
  .story-title-highlight {
    display: inline;
    font-size: inherit;
  }
  .story-content {
    text-align: left;
  }

  /* Restore parallax effect for desktop */
  .legacy-parallax-section {
    background-attachment: fixed;
  }

  /* Restore 2-column FAQ for desktop */
  .faq-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    max-width: 87.5rem;
  }
  .faq-title-column {
    text-align: left;
  }
  .faq-title-column .section-title {
    text-align: left;
  }
}

/* --- POP-UP STYLES --- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  position: relative;
  background-color: var(--secondary-color);
  padding: var(--spacing-lg);
  border-radius: 1rem;
  border: 1px solid var(--primary-color);
  text-align: center;
  max-width: 90%;
  width: 30rem;
  transform: scale(0.9);
  transition: transform 0.4s ease;
}

.popup-overlay.visible .popup-content {
  transform: scale(1);
}

.popup-content h2 {
  font-family: var(--font-family-serif);
  color: var(--primary-color);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: var(--spacing-sm);
}

.popup-content p {
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}

/* --- FORM HIGHLIGHT --- */
.form-highlight {
  box-shadow: 0 0 15px 5px rgba(191, 177, 136, 0.7);
  transition: box-shadow 0.3s ease-in-out;
}
