/* ==========================================================
 *  CUSTOM COMPONENT STYLES (La Huerta v2.0)
 * ========================================================== */

/* --- PAGE HERO (Subpages) --- */
.page-hero {
  height: 50vh;
  min-height: 400px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  background-color: #000;
}
.hero-slider__img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: fadeSlider 15s infinite;
}
@keyframes fadeSlider {
  0% { opacity: 0; transform: scale(1); }
  5% { opacity: 1; }
  33.33% { opacity: 1; }
  38.33% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.05); }
}
.page-hero--tall {
  height: 70vh;
  min-height: 500px;
}
.page-hero__bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(44, 44, 44, 0.4) 0%, rgba(44, 44, 44, 0.8) 100%);
  z-index: 2;
}
.page-hero__content {
  position: relative;
  z-index: 3;
  color: var(--clr-text-inverse);
  padding: 0 var(--space-md);
  max-width: 800px;
}
.page-hero__breadcrumb {
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-bg-alt);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.page-hero__breadcrumb a {
  transition: color var(--transition-fast);
}
.page-hero__breadcrumb a:hover {
  color: var(--clr-surface);
}
.page-hero__title {
  font-size: var(--fs-h1);
  color: var(--clr-text-inverse);
  margin-bottom: var(--space-sm);
}
.page-hero__subtitle {
  font-size: var(--fs-body-lg);
  opacity: 0.9;
}

/* --- PRODUCT PRICE LIST (Queso) --- */
.product-price-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
  margin-bottom: var(--space-md);
}
.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--clr-border);
}
.price-item:last-child {
  border-bottom: none;
}
.price-weight {
  font-family: var(--ff-body);
  color: var(--clr-text-light);
  font-size: var(--fs-body);
}
.price-amount {
  font-family: var(--ff-heading);
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
  font-size: 1.25rem;
}
.price-label {
  font-size: var(--fs-xs);
  color: var(--clr-accent-warm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-bold);
  margin-left: 8px;
}

/* --- PRODUCT CARD STACKED FOOTER --- */
.product-card__footer--stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}
.product-card__footer--stacked .product-card__price {
  margin-bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.product-card__price-current {
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
}
.product-card__price-unit {
  font-size: var(--fs-sm);
  color: var(--clr-text-light);
}

/* --- STORYTELLING GRID (Queso) --- */
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}
.story__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.story__detail {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.story__detail-icon {
  background: var(--clr-bg-alt);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--clr-primary);
}
.story__detail h4 {
  margin-bottom: var(--space-2xs);
  font-size: var(--fs-body-lg);
}
.story__detail p {
  color: var(--clr-text-light);
  font-size: var(--fs-body-sm);
}
.story__visual {
  position: relative;
}
.story__image-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.story__badges {
  position: absolute;
  bottom: -20px;
  right: -20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 992px) {
  .story-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .story__badges { bottom: 20px; right: 20px; }
}

/* --- PREMIUM QUESO CABRA ENHANCEMENTS --- */
.divider-gold {
  width: 60px;
  height: 3px;
  background-color: var(--clr-accent-warm);
  margin: var(--space-md) auto;
  border-radius: 2px;
}

.float-anim {
  animation: floatUp 4s ease-in-out infinite;
}
.float-anim-slow {
  animation: floatUp 6s ease-in-out infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.pricing-flex {
  align-items: stretch;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--clr-border);
  background-color: var(--clr-surface);
  border-radius: var(--radius-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  overflow: visible !important;
}
.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.pricing-card--featured:hover {
  transform: scale(1.05) translateY(-5px);
}

/* --- CTA PARALLAX --- */
.cta--parallax {
  position: relative;
  overflow: hidden;
  padding: 120px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cta__bg-image {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
}
.cta__overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(30, 60, 40, 0.85);
  z-index: 1;
}
.badge--outline-light {
  border: 1px solid rgba(255,255,255,0.6);
  color: white;
  background: transparent;
  backdrop-filter: blur(4px);
  font-family: var(--ff-body);
  letter-spacing: 0.1em;
  padding: 8px 20px;
  font-size: var(--fs-sm);
  text-transform: uppercase;
}

/* --- GALLERY MASONRY GRID --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 250px;
  gap: var(--space-sm);
  grid-auto-flow: dense;
}

/* --- ACCORDION DETAILS --- */
.premium-details {
  border-bottom: 1px solid var(--clr-border);
  padding: var(--space-md) 0;
}
.premium-details summary {
  font-family: var(--ff-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.premium-details summary::-webkit-details-marker {
  display: none;
}
.premium-details summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform var(--transition-fast);
}
.premium-details[open] summary::after {
  content: '-';
}
.premium-details p {
  margin-top: var(--space-sm);
  font-family: var(--ff-body);
  color: var(--clr-text-light);
  line-height: 1.6;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(45, 80, 22, 0);
  transition: background var(--transition-base);
}
.gallery-item:hover::after {
  background: rgba(45, 80, 22, 0.2);
}
/* Masonry Spans */
.gallery-item--large { grid-column: span 2; grid-row: span 2; }
.gallery-item--wide { grid-column: span 2; }
.gallery-item--tall { grid-row: span 2; }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .gallery-item--large, .gallery-item--wide { grid-column: span 2; }
}

/* --- LIGHTBOX OVERLAY --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}
.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.lightbox__close {
  position: absolute;
  top: -40px; right: 0;
  color: white;
  font-size: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.lightbox__prev, .lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.lightbox__prev:hover, .lightbox__next:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox__prev { left: -70px; }
.lightbox__next { right: -70px; }

@media (max-width: 768px) {
  .lightbox__prev { left: 10px; }
  .lightbox__next { right: 10px; }
  .lightbox__close { top: 10px; right: 10px; z-index: 10; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
}

/* --- BASKET BUILDER UI --- */
.builder-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  max-width: 100%;
}
.builder-main-area {
  min-width: 0;
}
.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-sm);
}
.builder-item {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  transition: var(--transition-fast);
}
.builder-item:hover {
  border-color: var(--clr-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px) scale(1.02);
}
.builder-item__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 5px;
  border: 1px solid var(--clr-border);
}
.builder-item__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.builder-item__title {
  margin-bottom: 5px;
  font-size: 1.1rem;
  color: var(--clr-primary);
  font-family: var(--ff-heading);
}
.builder-item__format {
  font-size: 14px;
  color: var(--clr-text-light);
  margin-bottom: 15px;
  font-weight: var(--fw-medium);
}
.builder-item__controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--clr-bg-alt);
  border-radius: var(--radius-full);
  padding: 4px 8px;
}
.builder-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--clr-surface);
  color: var(--clr-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  border: 1px solid var(--clr-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.builder-btn:hover {
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  border-color: var(--clr-primary);
}
.builder-qty {
  font-weight: var(--fw-bold);
  width: 20px;
  text-align: center;
}

/* Builder Sidebar */
.builder-sidebar {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: sticky;
  top: 100px;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.builder-sidebar__title {
  border-bottom: 2px solid var(--clr-border-light);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}
.builder-summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  min-height: 100px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  padding: 4px 0;
  border-bottom: 1px dashed var(--clr-border-light);
}
.summary-item:last-child { border-bottom: none; }
.summary-empty {
  color: var(--clr-text-light);
  font-style: italic;
  font-size: var(--fs-sm);
  text-align: center;
  margin-top: 20px;
}
.builder-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--clr-border);
  padding-top: var(--space-md);
  margin-bottom: var(--space-lg);
}
.builder-total span:first-child {
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.builder-total-price {
  font-family: var(--ff-heading);
  font-size: var(--fs-h3);
  color: var(--clr-primary);
  font-weight: var(--fw-bold);
}
.builder-note {
  font-size: var(--fs-xs);
  color: var(--clr-text-light);
  text-align: center;
  margin-top: var(--space-sm);
}

@media (max-width: 992px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-sidebar { position: static; margin-top: var(--space-lg); }
}

@media (max-width: 992px) {
  /* Full-bleed scroll for tabs: glides smoothly to the edge of the screen */
  .builder-tabs { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
  }
  .builder-tabs::-webkit-scrollbar { display: none; }
  
  .builder-tab {
    border-radius: 50px !important; /* Elegant pill shape */
    padding: 8px 20px !important;
  }
  
  /* Transform grid items into a sleek list for mobile */
  .builder-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .builder-item {
    flex-direction: row !important;
    align-items: center;
    text-align: left;
    padding: 12px;
    gap: 15px;
  }
  .builder-item__img {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .builder-item__info {
    align-items: flex-start;
  }
  .builder-item__format {
    margin-bottom: 8px;
  }
  .builder-item__controls {
    align-self: flex-start;
  }
}

/* --- BANNER CTA FULL-WIDTH --- */
.cta-banner {
  background-color: var(--clr-primary);
  color: var(--clr-text-inverse);
  padding: var(--space-3xl) 0;
  text-align: center;
}
.cta-banner h2 {
  color: var(--clr-text-inverse);
}
.cta-banner__phone {
  font-family: var(--ff-heading);
  font-size: var(--fs-h2);
  display: block;
  margin-top: var(--space-md);
  opacity: 0.9;
}

/* --- GLASSMORPHISM SECTION --- */
.section--glass {
  position: relative;
  background-image: url('https://images.unsplash.com/photo-1464226184884-fa280b87c399?w=1600&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 1;
}
.section--glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248, 245, 240, 0.65);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: -1;
}
.glass-panel {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
  .glass-panel {
    padding: var(--space-md);
  }
}

/* --- GLASSMORPHISM CHEESE --- */
.section--glass-cheese {
  position: relative;
  background-image: url('media/quesos-de-cabra-en-el-refrigerador.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 1;
}
.section--glass-cheese::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248, 245, 240, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: -1;
}

/* ==========================================================
 *  UX ENHANCEMENTS — GLOBAL
 * ========================================================== */

/* --- Smooth scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent-warm));
  z-index: 10000;
  width: 0%;
  transition: width 0.1s linear;
}

/* --- Improved focus states (a11y) --- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Product card image zoom effect --- */
.product-card__image-wrap {
  overflow: hidden;
}
.product-card__image {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-card__image {
  transform: scale(1.06);
}

/* --- WhatsApp floating button tooltip --- */
.whatsapp-float::before {
  content: '¡Escríbenos!';
  position: absolute;
  right: 65px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.whatsapp-float::after {
  content: '';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #333;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.whatsapp-float:hover::before,
.whatsapp-float:hover::after {
  opacity: 1;
}
.whatsapp-float:hover::before {
  transform: translateY(-50%) translateX(-5px);
}

/* --- Enhanced back-to-top transitions --- */
.back-to-top {
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
}
.back-to-top:hover {
  transform: translateY(-4px);
}

/* --- Section divider fade-in --- */
.section-eyebrow {
  position: relative;
  display: inline-block;
}
.section-eyebrow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--clr-accent-warm);
  border-radius: 1px;
}

/* --- Nav active link indicator --- */
.nav__link.active {
  position: relative;
}
.nav__link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--clr-primary);
  border-radius: 1px;
}

/* --- Badge shimmer animation --- */
@keyframes badgeShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.badge--accent {
  background-size: 200% 100%;
  animation: badgeShimmer 3s ease-in-out infinite;
}

/* --- Better builder item selected state --- */
.builder-item.selected {
  border-color: var(--clr-primary);
  background: rgba(45, 80, 22, 0.04);
  box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

/* --- Smooth page transitions --- */
@keyframes pageLoad {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
body {
  animation: pageLoad 0.5s ease-out;
}

/* --- Image loading skeleton --- */
img[data-src] {
  background: linear-gradient(90deg, var(--clr-bg-alt) 25%, #e8e5e0 50%, var(--clr-bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeletonLoad 1.5s infinite;
}
@keyframes skeletonLoad {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Pricing card hover glow --- */
.pricing-card--featured {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.pricing-card--featured:hover {
  box-shadow: 0 20px 60px rgba(45, 80, 22, 0.15), 0 0 0 2px var(--clr-primary);
}

/* --- Contact section improvements --- */
.contact-grid {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* --- Footer link hover underline --- */
.footer__link {
  position: relative;
  transition: color 0.3s ease;
}
.footer__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.footer__link:hover::after {
  width: 100%;
}

/* --- Social icon hover effect --- */
.social-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
  opacity: 0.8;
}

/* --- Selection colors --- */
::selection {
  background: rgba(45, 80, 22, 0.2);
  color: var(--clr-text);
}

/* --- Better mobile builder grid --- */


/* --- iOS fix: background-attachment fixed --- */
@supports (-webkit-touch-callout: none) {
  .section--glass,
  .section--glass-cheese,
  .cta__bg-image {
    background-attachment: scroll;
  }
}

