/* Hide scrollbars for card overflow */
.no-scrollbar::-webkit-scrollbar { 
  display: none; 
}

.no-scrollbar { 
  -ms-overflow-style: none; 
  scrollbar-width: none; 
}

/* Section styles */
#gourmet-nut-hpf-section {
  position: relative;
  width: 100%;
  max-width: 1280px;
  padding: 3rem 1rem;
  margin: 0 auto;
}

/* Ellipse background element */
#gourmet-nut-hpf-section::before {
  content: '';
  position: absolute;
  bottom: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 2162px;
  height: 418px;
  background-color: #FFFCEE;
  border-radius: 50%;
  z-index: 100;
  pointer-events: none;
}

/* Header styles */
#gourmet-nut-hpf-section .header {
  text-align: center;
  margin-bottom: 3rem;
}

#gourmet-nut-hpf-section .header h1 {
  font-size: 3rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1rem;
}

#gourmet-nut-hpf-section .header p {
  font-size: 1.25rem;
  color: #6b7280;
}

/* Product cards container */
#gourmet-nut-hpf-section .product-cards-container {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  justify-content: center;
  align-items: flex-end;
  transition: all 0.5s;
}

@media (min-width: 768px) {
  #gourmet-nut-hpf-section .product-cards-container {
    flex-direction: row;
  }
}

#gourmet-nut-hpf-section .product-cards-container .product-card {
  opacity: 0;
  transform: translateY(50px);
  animation: fadeUp 0.6s ease-out forwards;
}

/* staggered delays */
#gourmet-nut-hpf-section .product-cards-container .product-card:nth-child(1) {
  animation-delay: 500ms;
}
#gourmet-nut-hpf-section .product-cards-container .product-card:nth-child(2) {
  animation-delay: 1000ms;
}
#gourmet-nut-hpf-section .product-cards-container .product-card:nth-child(3) {
  animation-delay: 1500ms;
}

/* keyframes */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product card styles */
#gourmet-nut-hpf-section .product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 1.5rem;
  cursor: pointer;
  transition: all 0.5s;
  overflow: visible;
  background-color: rgba(237, 200, 147, 0.66);
  width: 380px;
  height: 670px;
  transition: width 0.45s ease, height 0.45s ease, background-color 0.3s ease;
}

/* Top logo positioning */
#gourmet-nut-hpf-section .top-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 1;
}

#gourmet-nut-hpf-section .top-logo.hidden-on-expand {
  opacity: 0;
}

#gourmet-nut-hpf-section .top-logo-power {
  width: 250px;
  height: 86px;
}

#gourmet-nut-hpf-section .top-logo-modern {
  width: 250px;
  height: 122px;
}

#gourmet-nut-hpf-section .top-logo-simple {
  width: 250px;
  height: 96px;
}

/* Modern Mill logo circle */
#gourmet-nut-hpf-section .modern-logo-circle {
  width: 4rem;
  height: 4rem;
  background-color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gourmet-nut-hpf-section .modern-logo-text {
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  text-align: center;
}

/* Simple Slices logo */
#gourmet-nut-hpf-section .simple-logo-container {
  background-color: white;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

#gourmet-nut-hpf-section .simple-logo-simple {
  color: #dc2626;
  font-weight: bold;
  font-size: 1.125rem;
}

#gourmet-nut-hpf-section .simple-logo-slices {
  color: #dc2626;
  font-style: italic;
  font-size: 1.25rem;
  margin-top: -0.25rem;
}

/* Default background - base class */
#gourmet-nut-hpf-section .default-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.5s;
}

/* Unique default background classes for each card */
#gourmet-nut-hpf-section .default-bg-power-up {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.5s;
}

#gourmet-nut-hpf-section .default-bg-modern-mill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.5s;
}

#gourmet-nut-hpf-section .default-bg-simple-slices {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.5s;
}

/* 3D effect - Power Up */
#gourmet-nut-hpf-section .default-bg-power-up {
  left: -80px;
  bottom: -50px;
  width: calc(100% + min(120px, 18vw));
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#gourmet-nut-hpf-section .default-bg-power-up img {
  width: min(400px, 60vw) !important;
  height: min(527px, 78vw) !important;
  object-fit: cover;
}

/* 3D effect - Modern Mill */
#gourmet-nut-hpf-section .default-bg-modern-mill {
  left: -10px;
  width: calc(100% + min(80px, 12vw));
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#gourmet-nut-hpf-section .default-bg-modern-mill img {
  width: min(400px, 60vw) !important;
  height: min(459px, 68vw) !important;
  object-fit: cover;
}

/* 3D effect - Simple Slices */
#gourmet-nut-hpf-section .default-bg-simple-slices {
  left: -30px;
  bottom: -120px;
  width: calc(100% + min(120px, 18vw));
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#gourmet-nut-hpf-section .default-bg-simple-slices img {
  width: min(431px, 65vw) !important;
  height: min(603px, 90vw) !important;
  object-fit: cover;
}

/* Expanded content */
#gourmet-nut-hpf-section .expanded-content {
  display: flex;
  width: 100%;
  height: 100%;
  transition: all 0.5s;
  border-radius: 1.5rem;
  overflow: hidden;
}

#gourmet-nut-hpf-section .expanded-img {
  height: 100%;
  background-size: cover;
  background-position: center;
  width: 411px;
  border-top-left-radius: 1.5rem;
  border-bottom-left-radius: 1.5rem;
  transform-origin: center center;
  opacity: 0;
  visibility: hidden;
}
#gourmet-nut-hpf-section .expanded-img img {
  opacity: 0;
  transform-origin: right bottom;
  transform: scale(2);
  visibility: hidden;
  transition: transform 0.5s ease, opacity 1.5s ease;
}

#gourmet-nut-hpf-section .expanded-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 70px 2rem 0 2rem;
  border-top-right-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
  opacity: 0;
  /* transform: scale(0.2); */
  transform-origin: left top; /* grow from top-left */
  visibility: hidden;          /* keeps element in layout but invisible */
  /* transition: transform 0.5s ease, opacity 0.5s ease; */
}
#gourmet-nut-hpf-section .expanded-img.visible, 
#gourmet-nut-hpf-section .expanded-img.visible img, 
#gourmet-nut-hpf-section .expanded-right.visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

/* default hidden state for text elements inside expanded-right */
#gourmet-nut-hpf-section .expanded-right h2,
#gourmet-nut-hpf-section .expanded-right p,
#gourmet-nut-hpf-section .expanded-right .shop-button {
  opacity: 0;
  transform: scale(0.2);
  transform-origin: left top;
  visibility: hidden;
  transition: transform 0.9s ease, opacity 0.5s ease;
}

/* when JS removes .hidden from .expanded-right, scale up text */
#gourmet-nut-hpf-section .expanded-right.visible h2, 
#gourmet-nut-hpf-section .expanded-right.visible p, 
#gourmet-nut-hpf-section .expanded-right.visible .shop-button {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

/* optional: stagger animation for nice effect */
#gourmet-nut-hpf-section .expanded-right h2 {
  transition-delay: 0.3s;
}
#gourmet-nut-hpf-section .expanded-right p {
  transition-delay: 0.35s;
}
#gourmet-nut-hpf-section .expanded-right .shop-button {
  transition-delay: 0.4s;
}


#gourmet-nut-hpf-section .expanded-right-power {
  background-color: #143C9A;
}

#gourmet-nut-hpf-section .expanded-right-modern {
  background-color: #B7E396;
}

#gourmet-nut-hpf-section .expanded-right-simple {
  background-color: #CE132A;
}

/* Expanded logo styles */
#gourmet-nut-hpf-section .expanded-logo {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 300px;
  height: 122px;
}

/* Content styles */
#gourmet-nut-hpf-section .expanded-title-power,
#gourmet-nut-hpf-section .expanded-title-modern,
#gourmet-nut-hpf-section .expanded-title-simple {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-align: left;
  color: #ffffff;
}
#gourmet-nut-hpf-section .expanded-title-simple {
  max-width: 320px;
}
#gourmet-nut-hpf-section .expanded-title-modern { color: #231F20; }

#gourmet-nut-hpf-section .expanded-description-power,
#gourmet-nut-hpf-section .expanded-description-modern,
#gourmet-nut-hpf-section .expanded-description-simple {
  color: #ffffff;
  margin-bottom: 2rem;
  text-align: left;
  line-height: 1.625;
}
#gourmet-nut-hpf-section .expanded-description-modern { color: #231F20; }

/* Button styles */
#gourmet-nut-hpf-section .shop-button {
  color: #333333;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: colors 0.3s;
  border: none;
  cursor: pointer;
}

#gourmet-nut-hpf-section .shop-button-power {
  background-color: #FFFCED;
}

#gourmet-nut-hpf-section .shop-button-power:hover {
  background-color: transparent;
  color: #FFFFFF;
  border: 1px solid transparent;
  outline: 3px solid #FFFFFF;
  outline-offset: -5px;
}

#gourmet-nut-hpf-section .shop-button-modern {
  background-color: #FFFCED;
}

#gourmet-nut-hpf-section .shop-button-modern:hover {
  background-color: transparent;
  color: #231F20;
  border: 1px solid transparent;
  outline: 3px solid #231F20;
  outline-offset: -5px;
}

#gourmet-nut-hpf-section .shop-button-simple {
  background-color: #FFFCED;
}

#gourmet-nut-hpf-section .shop-button-simple:hover {
  background-color: transparent;
  color: #FFFFFF;
  border: 1px solid transparent;
  outline: 3px solid #FFFFFF;
  outline-offset: -5px;
}

/* Product package image styles for shrunk cards */
#gourmet-nut-hpf-section .product-img {
  position: absolute;
  width: 175px;
  height: 240px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-20%);
  z-index: 15;
  transition: all 0.5s ease;
  pointer-events: none;
}

#gourmet-nut-hpf-section .product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Shrunk card logo styles */
#gourmet-nut-hpf-section .shrunk-logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  transition: all 0.5s ease;
  pointer-events: none;
}

#gourmet-nut-hpf-section .shrunk-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#gourmet-nut-hpf-section .shrunk-logo-power {
  width: 120px;
  height: 40px;
}

#gourmet-nut-hpf-section .shrunk-logo-modern {
  width: 120px;
  height: 60px;
}

#gourmet-nut-hpf-section .shrunk-logo-simple {
  width: 120px;
  height: 45px;
}

/* Product package image positioning when other cards are expanded */

/* When Power Up is expanded - Modern Mill and Simple Slices tilt right */
#gourmet-nut-hpf-section .product-img-modern-mill.when-power-expanded {
  transform: translateX(-80%) translateX(50px) rotate(4deg);
}

#gourmet-nut-hpf-section .product-img-simple-slices.when-power-expanded {
  transform: translateX(-80%) translateX(60px) rotate(4deg);
}

/* When Modern Mill is expanded - Power Up tilts left, Simple Slices tilts right */
#gourmet-nut-hpf-section .product-img-power-up.when-modern-expanded {
  transform: translateX(-50%) translateX(-5px) rotate(-4deg);
}

#gourmet-nut-hpf-section .product-img-simple-slices.when-modern-expanded {
  transform: translateX(-80%) translateX(60px) rotate(4deg);
}

/* When Simple Slices is expanded - Power Up and Modern Mill tilt left */
#gourmet-nut-hpf-section .product-img-power-up.when-simple-expanded {
  transform: translateX(-51%) translateX(0px) rotate(-4deg);
}

#gourmet-nut-hpf-section .product-img-modern-mill.when-simple-expanded {
  transform: translateX(-51%) translateX(0px) rotate(-4deg);
}

/* Utility classes */
#gourmet-nut-hpf-section .hidden {
  display: none !important;
}

/* Ensure default-bg elements are properly hidden when expanded */
#gourmet-nut-hpf-section .default-bg.hidden,
#gourmet-nut-hpf-section .default-bg-power-up.hidden,
#gourmet-nut-hpf-section .default-bg-modern-mill.hidden,
#gourmet-nut-hpf-section .default-bg-simple-slices.hidden {
  display: none !important;
}

/* Mobile Layout - Only for viewports smaller than 720px */
@media (max-width: 719px) {
  /* Hide ellipse background on mobile */
  #gourmet-nut-hpf-section::before {
    content: none !important;
    display: none !important;
  }
  /* Hide desktop-specific elements in mobile */
  #gourmet-nut-hpf-section .product-img,
  #gourmet-nut-hpf-section .shrunk-logo,
  #gourmet-nut-hpf-section .expanded-img,
  #gourmet-nut-hpf-section .expanded-logo {
    display: none !important;
  }
  /* Show expanded text/content in mobile */
  /*#gourmet-nut-hpf-section .expanded-right h2, */
  #gourmet-nut-hpf-section .expanded-right, 
  #gourmet-nut-hpf-section .expanded-right h2, 
  #gourmet-nut-hpf-section .expanded-right p, 
  #gourmet-nut-hpf-section .expanded-right .shop-button {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
  #gourmet-nut-hpf-section .expanded-right {
    display: flex !important;
    position: absolute;
    top: 150px;
    left: 0;
    right: 0;
    padding: 0 1rem;
    background: transparent !important;
    text-align: center;
    align-items: center;
  }
  #gourmet-nut-hpf-section .expanded-right h2 {
    margin-top: 10px;
    font-size: 1.2rem;
  }
  #gourmet-nut-hpf-section .expanded-right p {
    font-size: 1rem;
    max-width: 82%;
  }
  #gourmet-nut-hpf-section .expanded-right .shop-button {
    margin-top: 1rem;
    font-size: 1rem;
  }
  
  #gourmet-nut-hpf-section .expanded-right-power {
    top: 130px;
    display: block !important;
    padding-left: 13.5vw;
  }
  #gourmet-nut-hpf-section .expanded-right-power,
  #gourmet-nut-hpf-section .expanded-right-power h2,
  #gourmet-nut-hpf-section .expanded-right-power p {
      text-align: left !important;
      max-width: 100%;
  }
  #gourmet-nut-hpf-section .expanded-right-modern {
    top: 170px;
  }
  /* Center align mobile title and description text */
  #gourmet-nut-hpf-section .expanded-title-power,
  #gourmet-nut-hpf-section .expanded-title-modern, 
  #gourmet-nut-hpf-section .expanded-title-simple,
  #gourmet-nut-hpf-section .expanded-description-power,
  #gourmet-nut-hpf-section .expanded-description-modern,
  #gourmet-nut-hpf-section .expanded-description-simple {
    text-align: center !important;
  }
  
  /* Position mobile shop buttons */
  #gourmet-nut-hpf-section .product-card[data-card="0"] .shop-button,
  #gourmet-nut-hpf-section .product-card[data-card="2"] .shop-button {
    position: absolute;
    bottom: -80px;
    right: 0px;
    border-radius: 100px 0 0 100px;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="1"] .shop-button {
    position: absolute;
    bottom: -80px;
    left: 0px;
    border-radius: 0 100px 100px 0;
  }
  
  /* Reset main section for mobile */
  #gourmet-nut-hpf-section {
    padding: 2rem 0;
    max-width: 100%;
  }
  
  /* Mobile header adjustments */
  #gourmet-nut-hpf-section .header {
    margin-bottom: 2rem;
    padding: 0 1rem;
  }
  
  #gourmet-nut-hpf-section .header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
  }
  
  #gourmet-nut-hpf-section .header p {
    font-size: 1.5rem;
  }
  
  /* Mobile product cards container */
  #gourmet-nut-hpf-section .product-cards-container {
    position: relative;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    padding: 0 1rem;
    /* variables used to compute absolute positions */
    --card-h: 532px;
    --card-gap: 20px;
    min-height: calc(var(--card-h) * 3 + var(--card-gap) * 2);
  }
  
  /* Mobile product card base styles */
  #gourmet-nut-hpf-section .product-card {
    width: 380px !important;
    height: var(--card-h) !important;
    max-width: calc(100vw - 2rem);
    border-radius: 0 60px 40px 60px;
    position: absolute;
    overflow: hidden;
    cursor: default;
    transition: none;
    margin: 0 auto;
  }
  
  /* Mobile card alignment */
  #gourmet-nut-hpf-section .product-card[data-card="0"] {
    left: 0;
    right: auto;
    top: 0;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="1"] {
    right: 0;
    left: auto;
    top: calc(var(--card-h) + var(--card-gap));
    /* Mobile-specific border radius for Modern Mill */
    border-radius: 60px 0px 60px 40px;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="2"] {
    left: 0;
    right: auto;
    top: calc((var(--card-h) + var(--card-gap)) * 2);
    /* Mobile-specific border radius for Simple Slices */
    border-radius: 60px 60px 40px 0;
  }
  
  /* Mobile card background colors */
  #gourmet-nut-hpf-section .product-card[data-card="0"] {
    background-color: #143C9A !important;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="1"] {
    background-color: #B7E396 !important;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="2"] {
    background-color: #CE132A !important;
  }
  
  /* Mobile top logo positioning */
  #gourmet-nut-hpf-section .top-logo {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 1;
  }
  #gourmet-nut-hpf-section .top-logo-power {
      transform: none;
      left: 13.5vw;
  }
  
  /* Mobile default background positioning */
  #gourmet-nut-hpf-section .default-bg-power-up,
  #gourmet-nut-hpf-section .default-bg-modern-mill,
  #gourmet-nut-hpf-section .default-bg-simple-slices {
    position: absolute;
    display: block;
    width: auto;
    height: auto;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
  }
  
  #gourmet-nut-hpf-section .default-bg-power-up {
    left: -10px;
    top: 240px;
    width: 270px;
    height: 350px;
  }
  
  #gourmet-nut-hpf-section .default-bg-modern-mill {
    right: -40px;
    top: 70vw;
    width: 240px;
    height: 270px;
  }
  
  #gourmet-nut-hpf-section .default-bg-simple-slices {
    left: 0px;
    top: 235px;
    width: 257px;
    height: 360px;
  }
  
  /* Mobile model image sizing */
  #gourmet-nut-hpf-section .default-bg-power-up img,
  #gourmet-nut-hpf-section .default-bg-modern-mill img,
  #gourmet-nut-hpf-section .default-bg-simple-slices img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }
  
  /* Mobile content positioning */
  #gourmet-nut-hpf-section .mobile-title {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.375rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    z-index: 5;
    width: 280px;
  }
  
  #gourmet-nut-hpf-section .mobile-description {
    position: absolute;
    top: 186px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.125rem;
    text-align: center;
    line-height: 1.3;
    z-index: 5;
    width: 330px;
    padding: 0 1rem;
  }
  
  #gourmet-nut-hpf-section .mobile-shop-button {
    position: absolute;
    top: 351px;
    z-index: 10;
    background-color: #FFFCED;
    padding: 17px 35px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    color: #231F20;
    text-decoration: none;
    display: inline-block;
  }
  
  /* Mobile button positioning per card */
  #gourmet-nut-hpf-section .product-card[data-card="0"] .mobile-shop-button {
    right: 25px;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="1"] .mobile-shop-button {
    left: 25px;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="2"] .mobile-shop-button {
    right: 25px;
  }
  
  /* Mobile text colors */
  #gourmet-nut-hpf-section .product-card[data-card="0"] .mobile-title,
  #gourmet-nut-hpf-section .product-card[data-card="0"] .mobile-description {
    color: #ffffff;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="1"] .mobile-title,
  #gourmet-nut-hpf-section .product-card[data-card="1"] .mobile-description {
    color: #231F20;
  }
  
  #gourmet-nut-hpf-section .product-card[data-card="2"] .mobile-title,
  #gourmet-nut-hpf-section .product-card[data-card="2"] .mobile-description {
    color: #FFFCED;
  }
  
  /* Responsive scaling for mobile */
  @media (max-width: 430px) {
    #gourmet-nut-hpf-section .product-card {
      width: calc(100vw - 2rem) !important;
      /* height driven by container variable below */
    }
    #gourmet-nut-hpf-section .product-cards-container {
      --card-h: calc((100vw - 2rem) * 1.4);
      min-height: calc(var(--card-h) * 3 + var(--card-gap) * 2);
    }
    /* (no special scaling; use base sizes/positions) */
    
    #gourmet-nut-hpf-section .header h1 {
      font-size: 2.2rem;
    }
    
    #gourmet-nut-hpf-section .header p {
      font-size: 1.25rem;
    }
  }
}