/* Healthy Cooking Block - Frontend Styles */
.healthy-cooking {
  background-color: var(--color-green-100, var(--color-green-200));
  width: 100%;
}

.healthy-cooking .content-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--spacing-20, 80px) var(--spacing-7, 28px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--font-size-5xl, 48px);
}

.healthy-cooking .text-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-7, 28px);
  width: 100%;
}

.healthy-cooking .block-heading {
  /* Figma: H1 */
  color: var(--color-green-900, #373A19) !important;
  font-family: var(--font-heading, "Sora") !important;
  font-size: var(--font-size-5xl, 48px) !important;
  font-weight: var(--font-weight-extrabold, 800) !important;
  line-height: 0.9166666666666666em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  margin: 0 !important;
  width: 100%;
}

.healthy-cooking .block-description {
  /* Figma: Body copy */
  color: var(--color-green-900, #373A19) !important;
  font-family: var(--font-body, "Azo Sans", "Inter") !important;
  font-size: var(--font-size-base, 16px) !important;
  font-weight: var(--font-weight-normal, 400) !important;
  line-height: 1.5em !important;
  text-align: center !important;
  max-width: 576px;
  margin: 0 auto !important;
}

.healthy-cooking .swaps-grid {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--font-size-5xl, 48px);
  width: 100%;
}

.healthy-cooking .swap-item {
  display: flex;
  justify-content: center;
  align-items: center;
}

.healthy-cooking .swap-image {
  display: block;
  max-width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-backface-visibility: hidden; /* iOS performance fix */
  backface-visibility: hidden;
  transform: translateZ(0); /* Force hardware acceleration */
}

/* Images fade in when loaded */
.healthy-cooking.loaded .swap-image {
  opacity: 1;
}

/* Fallback: Show images after a delay if JS fails */
@media (max-width: 768px) {
  .healthy-cooking .swap-image {
    animation: fadeInImage 0.5s ease 0.5s forwards;
  }
}

@keyframes fadeInImage {
  to {
    opacity: 1;
  }
}

/* Specific image sizes from Figma desktop */
.healthy-cooking .swap-item:nth-child(1) .swap-image { width: 403px; max-height: 173px; }
.healthy-cooking .swap-item:nth-child(2) .swap-image { width: 399px; max-height: 179px; }
.healthy-cooking .swap-item:nth-child(3) .swap-image { width: 422px; max-height: 184px; }
.healthy-cooking .swap-item:nth-child(4) .swap-image { width: 387px; max-height: 184px; }
.healthy-cooking .swap-item:nth-child(5) .swap-image { width: 420px; max-height: 193px; }
.healthy-cooking .swap-item:nth-child(6) .swap-image { width: 398px; max-height: 194px; }
.healthy-cooking .swap-item:nth-child(7) .swap-image { width: 392px; max-height: 192px; }
.healthy-cooking .swap-item:nth-child(8) .swap-image { width: 391px; max-height: 201.78px; }

.healthy-cooking .cta-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-4, 16px);
  width: 100%;
}

.healthy-cooking .download-button {
  /* Figma: Button Primary Large - exact specifications */
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-6, 24px);
  background-color: var(--color-yellow-200, #FBEB8F);
  outline: 1px solid var(--color-green-400, #8FA888);
  outline-offset: -1px;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 348px; /* Exact Figma max-width */
  box-sizing: border-box;
  height: 72px; /* Fixed height from Figma */
  overflow: hidden;
  margin: 0 auto; /* Center the button */
}

.healthy-cooking .download-button:hover {
  background-color: var(--primary-hover, #F5E66B);
  border-color: var(--color-green-700, var(--color-green-800));
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.healthy-cooking .button-text {
  /* Figma: Button Title - exact specifications */
  color: var(--color-green-950) !important;
  font-family: var(--font-body, "Azo Sans", "Inter") !important;
  font-size: 0.875rem !important; /* 14px - text-sm */
  font-weight: 500 !important; /* font-medium */
  line-height: 1 !important; /* leading-none */
  letter-spacing: 0.05em !important; /* tracking-wide */
  text-transform: uppercase !important;
  text-align: center !important;
  flex: 1; /* Allow text to take up available space */
  display: flex;
  justify-content: center;
}

.healthy-cooking .download-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.healthy-cooking .download-icon path {
  fill: var(--color-green-950);
}

/* Desktop/Mobile visibility */
.healthy-cooking .desktop-grid {
  display: flex;
}

.healthy-cooking .mobile-slider {
  display: none;
}

/* Mobile Slider Styles */
.healthy-cooking .swaps-slider {
  width: 100%;
  position: relative;
}

.healthy-cooking .slider-wrapper {
  overflow: hidden;
  width: 100%;
  max-width: 332px; /* Figma mobile image width */
  margin: 0 auto;
}

.healthy-cooking .slider-track {
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
  -webkit-transform: translateZ(0); /* iOS hardware acceleration */
  transform: translateZ(0);
}

.healthy-cooking .slider-slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.healthy-cooking .slider-slide .swap-image {
  width: 332px;
  max-width: 100%;
  height: 142px;
  object-fit: contain;
  -webkit-touch-callout: none; /* iOS - prevent image save dialog */
  -webkit-user-select: none; /* iOS - prevent selection */
  user-select: none;
}

/* Pagination Controls */
.healthy-cooking .slider-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 8px 8px;
  /* background-color: rgba(251, 235, 143, 0.5); */
  /* border-top: 1px solid var(--color-green-400, #D4D2C4); */
  margin-top: 16px;
}

.healthy-cooking .slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 2px solid var(--color-green-950);
  cursor: pointer;
  transition: all 0.2s ease;
}

.healthy-cooking .slider-nav:hover:not(:disabled) {
  background-color: var(--color-yellow-200, #FBEB8F);
}

.healthy-cooking .slider-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.healthy-cooking .nav-icon {
  width: 24px;
  height: 24px;
  color: var(--color-green-950);
}

.healthy-cooking .slider-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.healthy-cooking .slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-green-400, #D4D2C4);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.healthy-cooking .slider-dot.active {
  width: 12px;
  height: 12px;
  background-color: var(--color-green-950);
}

.healthy-cooking .slider-dot:hover:not(.active) {
  background-color: var(--color-green-700, var(--color-green-800));
}

/* Mobile responsive - based on Figma mobile design */
@media (max-width: 768px) {
  /* Hide desktop grid, show mobile slider */
  .healthy-cooking .desktop-grid {
    display: none;
  }
  
  .healthy-cooking .mobile-slider {
    display: block;
  }

  .healthy-cooking .content-wrapper {
    padding: var(--spacing-20, 80px) var(--spacing-7, 28px);
    gap: var(--font-size-5xl, 48px);
  }

  .healthy-cooking .block-heading {
    font-size: var(--font-size-4xl, 36px) !important;
    line-height: 0.8888888888888888em !important;
  }

  .healthy-cooking .swaps-grid {
    gap: var(--spacing-20, 80px);
    justify-content: center;
  }

  /* Mobile image size from Figma */
  .healthy-cooking .swap-item .swap-image {
    width: 332px !important;
    max-width: 100%;
    height: auto !important;
    max-height: 142px !important;
  }

  .healthy-cooking .download-button {
    height: 60px; /* Slightly smaller height on mobile */
    padding: var(--spacing-5, 20px);
    max-width: 100%;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  .healthy-cooking .content-wrapper {
    padding: var(--spacing-16, 64px) var(--spacing-5, 20px);
  }

  .healthy-cooking .block-description {
    padding: 0 var(--spacing-4, 16px);
  }

  .healthy-cooking .swaps-grid {
    gap: var(--spacing-11, 44px);
  }

  /* Scale down images proportionally on very small screens */
  .healthy-cooking .swap-item .swap-image {
    width: 280px !important;
    max-width: calc(100vw - 40px);
  }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  /* iOS only styles */
  .healthy-cooking .slider-wrapper {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  .healthy-cooking .slider-track {
    -webkit-transform: translate3d(0, 0, 0); /* Force GPU acceleration */
    transform: translate3d(0, 0, 0);
  }
  
  .healthy-cooking .swap-image {
    -webkit-transform: translateZ(0); /* Prevent flickering */
    transform: translateZ(0);
  }
}

 