:root {
  --color-amarillo: #c29959;
  --color-marron: #78553c;
  --color-vino: #961e2d;
  --color-verde: #2d4a24;
  --color-beige: #e6dcc8;
  --color-gris: #a8a8a8;
  --color-blanco: #f5f5f0;
  --color-texto: #1a1208;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Source Sans 3', 'Lato', sans-serif;
  --max-width: 1200px;
  --nav-height: 72px;
  --section-pad: 5rem 1.5rem;
}

@view-transition { navigation: auto; }

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-texto);
  background-color: var(--color-blanco);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-height: 100vh;
}

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { opacity: 0.85; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

.section-title {
  text-align: center;
  margin-bottom: 0.7rem;
  color: var(--color-texto);
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--color-marron);
  margin-bottom: 3rem;
}

.title-decor {
  width: 60px;
  height: 3px;
  background-color: var(--color-amarillo);
  margin: 0.8rem auto 0;
}

section { padding: var(--section-pad); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  min-height: 52px;
  min-width: 44px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background-color: var(--color-amarillo); color: var(--color-texto); }
.btn-dark { background-color: var(--color-verde); color: #fff; }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline-dark { background: transparent; color: var(--color-verde); border: 2px solid var(--color-verde); }
.btn-whatsapp { background-color: #25D366; color: #fff; font-size: 1.05rem; padding: 1rem 2.5rem; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-blanco);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.12); }

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-amarillo);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-texto);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-amarillo);
  border-bottom-color: var(--color-amarillo);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.lang-switcher {
  display: flex;
  gap: 2px;
}

.lang-btn {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  color: var(--color-gris);
  min-width: 32px;
  min-height: 32px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-btn:hover { color: var(--color-texto); }
.lang-btn.active {
  background-color: var(--color-amarillo);
  color: var(--color-blanco);
}

.btn-nav-reservar {
  font-size: 0.88rem;
  padding: 0.6rem 1.2rem;
  min-height: 42px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background-color: var(--color-texto);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.menu-text { font-size: 0.7rem; color: var(--color-texto); margin-top: 2px; }

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background-color: var(--color-verde);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(45, 74, 36, 0.6);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem 1.5rem;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.hero-content h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.hero-content p { font-size: clamp(1rem, 2.5vw, 1.3rem); margin-bottom: 2rem; opacity: 0.92; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.page-hero {
  min-height: 35vh;
  background-color: var(--color-verde);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: var(--section-pad);
}

.page-hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-content { animation: none; }
}

/* Image placeholders */
.img-placeholder {
  background-color: var(--color-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  min-height: 220px;
  color: var(--color-gris);
  font-size: 0.85rem;
  flex-direction: column;
  gap: 0.5rem;
}

/* Menu del Dia */
.menu-section { background-color: var(--color-blanco); }
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.menu-info h3 { color: var(--color-amarillo); margin-bottom: 0.8rem; }
.menu-info p { margin-bottom: 1.2rem; max-width: 500px; }
.menu-precio {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-vino);
  margin: 1.2rem 0;
}
.menu-fallback { text-align: center; padding: 1rem; }

/* Gallery */
.gallery-section { background-color: var(--color-verde); color: #fff; }
.gallery-section .section-title { color: #fff; }
.gallery-section .title-decor { background-color: var(--color-amarillo); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.gallery-item { border-radius: 10px; overflow: hidden; }
.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
}
.gallery-item figcaption {
  padding: 0.8rem 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--color-beige);
}

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.service-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.service-card svg { width: 36px; height: 36px; color: var(--color-amarillo); flex-shrink: 0; }
.service-card h3 { color: var(--color-amarillo); font-size: 1.25rem; }
.service-card p { font-size: 0.95rem; color: var(--color-texto); opacity: 0.85; flex: 1; }
.service-card .card-link { font-weight: 600; color: var(--color-verde); font-size: 0.95rem; }

/* History layout */
.history-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.history-text p { margin-bottom: 1.2rem; }
.history-highlight {
  background-color: var(--color-beige);
  border-left: 4px solid var(--color-amarillo);
  padding: 1.8rem;
  border-radius: 0 12px 12px 0;
  margin: 2rem 0;
  font-style: italic;
}

.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 2rem 0;
  margin-top: 3rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-amarillo);
  z-index: 0;
}
.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-amarillo);
}
.timeline-year {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-marron);
}
.timeline-label { font-size: 0.9rem; }

/* Location page */
.ubicacion-card {
  background-color: var(--color-beige);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 3rem;
}
.ubicacion-card h2 { color: var(--color-marron); margin-bottom: 0.5rem; }
.ubicacion-card p { margin-bottom: 1rem; }
.ubicacion-card address { font-style: normal; font-weight: 600; margin-bottom: 1.5rem; }
.map-wrapper { border-radius: 12px; overflow: hidden; }

/* Horarios table */
.horarios-section h2 { text-align: center; margin-bottom: 2rem; }
.horarios-table { width: 100%; max-width: 700px; margin: 0 auto; border-collapse: collapse; }
.horarios-table thead { background-color: var(--color-amarillo); color: var(--color-texto); }
.horarios-table th {
  padding: 1rem 1.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-align: left;
}
.horarios-table th:first-child { border-radius: 8px 0 0 0; }
.horarios-table th:last-child { border-radius: 0 8px 0 0; }
.horarios-table td { padding: 0.9rem 1.2rem; font-size: 0.95rem; }
.horarios-table tbody tr:nth-child(even) { background-color: var(--color-beige); }
.horarios-table tbody tr:nth-child(odd) { background-color: #fff; }
.horarios-table .cerrado { color: var(--color-vino); font-weight: 700; }
.horarios-nota { text-align: center; margin-top: 1.5rem; font-style: italic; color: var(--color-marron); }

/* Reservas tabs */
.reservas-tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.tab-btn {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background-color: var(--color-beige);
  color: var(--color-texto);
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 48px;
}
.tab-btn.active { background-color: var(--color-amarillo); color: var(--color-texto); }
.tab-btn:hover:not(.active) { background-color: var(--color-gris); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.reserva-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-texto);
}
.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-beige);
  border-radius: 8px;
  background-color: #fff;
  color: var(--color-texto);
  transition: border-color 0.2s ease;
  min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-amarillo);
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--color-vino);
  background-color: #fef8f8;
}

.field-error {
  font-size: 0.82rem;
  color: var(--color-vino);
  margin-top: 0.2rem;
  min-height: 1em;
  animation: fadeIn 0.25s ease;
}

.form-group input::placeholder { color: var(--color-gris); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .field-hint { font-size: 0.82rem; color: var(--color-marron); }

.form-message {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
}
.form-message--ok    { background-color: #edf7ed; color: #2d6a2d; border: 1px solid #a8d5a8; }
.form-message--error { background-color: #fdf0f0; color: #8b2020; border: 1px solid #e8b4b4; }

.form-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
}

/* Huerta */
.huerta-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  background-color: #fff;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.huerta-content p { margin-bottom: 1.8rem; }

/* Footer */
.footer {
  background-color: var(--color-verde);
  color: #fff;
  padding: 3rem 1.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 2rem;
}

.footer-col h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--color-amarillo);
}

.footer-col nav { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col nav a { font-size: 0.95rem; opacity: 0.9; }
.footer-col nav a:hover { opacity: 1; color: var(--color-amarillo); }

.footer-col p { font-size: 0.95rem; margin-bottom: 0.4rem; opacity: 0.9; }

.social-links { display: flex; gap: 1rem; margin-top: 0.8rem; }
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.12);
  transition: background-color 0.2s ease;
}
.social-links a:hover { background-color: rgba(255,255,255,0.25); }
.social-links svg { width: 20px; height: 20px; fill: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Mobile styles */
@media (max-width: 768px) {
  :root { --nav-height: 64px; --section-pad: 3.5rem 1.2rem; }

  body { font-size: 18px; }

  .nav-links { display: none; }
  .menu-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--color-blanco);
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

  .btn-nav-reservar { display: none; }
  .nav-links.open .btn-nav-reservar-mobile { display: inline-flex; width: 100%; }
  .btn-nav-reservar-mobile { display: none; }

  .hero { min-height: 60vh; }

  .menu-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .menu-image { order: -1; }

  .gallery-grid { grid-template-columns: 1fr; }

  .services-grid { grid-template-columns: 1fr; gap: 1.2rem; }

  .history-block { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding-left: 2rem; }
  .timeline::before { top: 0; bottom: 0; left: 14px; right: auto; width: 2px; height: auto; }
  .timeline-item { flex-direction: row; gap: 1rem; }
  .timeline-dot { flex-shrink: 0; }

  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .social-links { justify-content: center; }

  .reservas-tabs { flex-direction: column; align-items: stretch; }
  .tab-btn { text-align: center; }

  .huerta-content { padding: 2rem 1rem; }
}

@media (max-width: 375px) {
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; }
  .form-submit { width: 100%; }
}

@media (min-width: 769px) {
  .btn-nav-reservar-mobile { display: none; }
}
