/* ===========================
   ESTILOS RÚSTICOS ARTESANALES
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500&family=Lora&display=swap');

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

body {
  font-family: 'Lora', serif;
  background-color: #f8f4ef;
  color: #3e2f1c;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease;
  overflow-x: hidden;
}

header {
  background-image:
    url('./assets/portada.png'),
    url('./assets/portada.jpg'),
    url('./assets/portada.webp'),
    url('https://images.unsplash.com/photo-1608032075819-6e3f78bcdcd8?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 340px;
  color: #fff;
  text-align: center;
  padding: 4rem 1rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  margin: 0;
  position: relative;
  z-index: 1;
}

header p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.site-logo {
  height: 150px;
  max-height: 340px;
  width: auto;
  display: block;
  margin: 0 auto 0.6rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .site-logo {
    height: 80px;
  }
}

.filter-buttons {
  text-align: center;
  margin: 1.5rem 0;
}

.filter-buttons button {
  background-color: #a1764c;
  border: none;
  color: #fffdfa;
  padding: 0.6rem 1rem;
  margin: 0 0.3rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Lora', serif;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.filter-buttons button:hover {
  background-color: #c39467;
  transform: translateY(-2px);
}

section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

h2 {
  font-family: 'Playfair Display', serif;
  border-bottom: 2px solid #a1764c;
  display: inline-block;
  padding-bottom: 0.3rem;
  margin-bottom: 1.5rem;
  color: #4a3522;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: #fffdfa;
  border: 1px solid #e0d2c2;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: opacity 0.45s ease, transform 0.35s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card:hover {
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
}

.card-content h3 {
  margin: 0 0 0.5rem;
  color: #4a3522;
  font-size: 1.2rem;
}

.card-content p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.price {
  font-weight: bold;
  color: #a1764c;
}

footer {
  background-color: #3e2f1c;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

footer a {
  color: #f8e3c2;
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* asegurar que .hidden sea !important */
.hidden {
  display: none !important;
}

/* agregar will-change solo cuando sea necesario (ya lo tienes en JS) */
.carousel-track {
  will-change: transform;
}

/* ========================================
   REDES SOCIALES EN FOOTER
   ======================================== */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 0;
  width: 36px;
  height: 36px;
  color: #fff;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-icon svg {
  width: 24px;
  height: 24px;
}

.social-icon--whatsapp {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.social-icon--whatsapp svg {
  width: 20px;
  height: 20px;
}

.social-icon--whatsapp:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.65);
  transform: scale(1.12);
}

.social-icon:hover {
  background: transparent;
  transform: scale(1.2);
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.5));
}

.social-icon:active {
  transform: translateY(-1px) scale(1.05);
}

.social-icon:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

/* ========================================
   CTA FLOTANTE, CONTACTO Y MODALES
   ======================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: #fff;
  max-width: 740px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.modal-img {
  width: 40%;
  max-width: 280px;
  object-fit: cover;
  border-radius: 6px;
}

.modal-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
}

.modal-desc {
  margin: 0;
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.contact-section {
  transition: max-height 360ms ease, padding 360ms ease, opacity 360ms ease;
  overflow: hidden;
  max-height: 1000px;
  opacity: 1;
  position: relative;
  padding: 28px 20px;
  background: linear-gradient(180deg, #fff, #fbfbfb);
  border-top: 1px solid #eee;
  max-width: 1100px;
  margin: 28px auto;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
}

.contact-section.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0 auto;
}

.contact-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  padding: 6px;
  cursor: pointer;
  color: #666;
}

.contact-close:focus {
  outline: 2px solid #2c6f4b;
  border-radius: 6px;
}

.contact-section h2 {
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.contact-section p.lead {
  margin: 0 0 14px;
  color: #444;
}

.contact-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.contact-grid .full {
  grid-column: 1 / -1;
}

.contact-grid input,
.contact-grid textarea,
.contact-grid select {
  padding: 12px 14px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
}

.contact-grid textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.contact-btn-main {
  background: #2c6f4b;
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(44, 111, 75, 0.18);
}

.contact-btn-ghost {
  background: transparent;
  color: #2c6f4b;
  border: 2px solid #2c6f4b;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.contact-feedback {
  margin-top: 10px;
  font-size: 0.95rem;
}

.fab-btn {
  position: fixed;
  right: 18px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cta-contact {
  bottom: 18px;
  background: #fc3503;
  color: #fff;
  padding: 14px 18px;
}

.cta-contact .pulse {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

.cta-contact .cta-text {
  display: inline;
}

.cta-contact .cta-text-short {
  display: none;
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  70% {
    transform: scale(1.9);
    opacity: 0;
  }
  100% {
    transform: scale(0.9);
    opacity: 0;
  }
}

.header-divider {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #2c6f4b 15%, #1a1919ff 50%, #2c6f4b 85%, transparent 100%);
  margin: 20px 0;
  box-shadow: 0 2px 6px rgba(44, 111, 75, 0.15);
  position: relative;
}

.header-divider::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 8px;
  background: rgb(17, 4, 0)2, 0);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(255, 122, 89, 0.4);
}

/* ========================================
   HERO Y CARRUSEL
   ======================================== */
.hero-carousel {
  position: relative;
  width: 100%;
  margin: 1.5rem 0 2.5rem;
  padding-inline: clamp(12px, 5vw, 72px);
  overflow: hidden;
  box-sizing: border-box;
}

.hero-carousel .carousel {
  border-radius: 0;
}

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  height: 100%;
  margin: 0;
  padding: 0;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.carousel-indicators {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}

.carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.carousel-indicators button:hover,
.carousel-indicators button:focus {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

.carousel-indicators button.active {
  width: 18px;
  background: #ff7a59;
}

.modal-content--dark {
  background: #0f0f0f;
  color: #f5f5f5;
  border-radius: 10px;
  padding: 20px;
  gap: 20px;
}

.modal-content--dark .modal-img {
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  width: 100%;
  height: auto;
}

.modal-copy {
  font-family: 'Lora', serif;
  max-width: 320px;
  line-height: 1.4;
}

.modal-copy h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin: 0 0 12px;
  color: #ff7a59;
}

.modal-copy p {
  margin: 0;
  font-size: 1rem;
  color: #e2e2e2;
}

/* ========================================
   MEDIA QUERIES
   ======================================== */
@media (max-width: 1024px) {
  .hero-carousel {
    padding-inline: clamp(18px, 6vw, 56px);
    margin: 1.4rem 0 2rem;
  }

  .social-links {
    justify-content: flex-start;
    padding-left: 20px;
  }

  .carousel-btn {
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
  }

  .carousel-controls {
    padding: 0 16px;
  }

  .carousel-indicators {
    bottom: 20px;
    padding: 8px 14px;
  }
}

@media (max-width: 768px) {
  .hero-carousel {
    padding-inline: clamp(16px, 6vw, 42px);
    margin: 1.15rem 0 1.75rem;
  }

  .cta-contact .cta-text {
    display: none;
  }

  .cta-contact .cta-text-short {
    display: inline;
  }

  .cta-contact {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .hero-carousel {
    padding-inline: clamp(14px, 7vw, 36px);
    margin: 1rem 0 1.5rem;
  }

  .carousel {
    aspect-ratio: 4 / 3;
  }

  .social-links {
    justify-content: flex-start;
    gap: 12px;
    margin-top: 15px;
    padding-top: 12px;
    padding-left: 15px;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-icon svg {
    width: 20px;
    height: 20px;
  }

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

  .cta-contact {
    right: 10px;
    bottom: 10px;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .cta-contact .pulse {
    width: 8px;
    height: 8px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .carousel-controls {
    padding: 0 10px;
  }

  .carousel-indicators {
    bottom: 16px;
    padding: 6px 12px;
  }

  .carousel-indicators button {
    width: 10px;
    height: 10px;
  }

  .carousel-indicators button.active {
    width: 28px;
  }
}

@media (max-width: 480px) {
  .hero-carousel {
    padding-inline: clamp(12px, 8vw, 28px);
    margin: 0.75rem 0 1.25rem;
  }
  .carousel {
    aspect-ratio: 1 / 1;
  }
  .site-logo {
    height: 80px;
  }

  .cta-contact {
    bottom: 92px;
    width: 44px;
    height: 44px;
    padding: 10px;
  }
}

/* ===========================
   ESTILOS PARA EL CAROUSEL
   =========================== */
.hero-carousel,
.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.carousel-track,
.carousel-slide {
  height: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
