/* ============================================
   HOME PAGE — BOTTLES
   ============================================ */

/* === BREAKPOINTS ===
  breakpoint-tablet: 600px;
  breakpoint-desktop-s: 900px;
  breakpoint-desktop-m: 1200px;
  breakpoint-desktop-l: 1600px;
*/

.home {
  --width-card: 100vw;
  --max-width-text: auto;
  --width-close: auto;
  --min-width-open: auto;
  --top-padding: calc(var(--header-height) + (var(--header-margin-top) * 3));
  --transition-images-delay: all 0.8s ease-in-out;
  --transition-text-delay: all 1s ease-in-out;
}

@media (min-width: 600px) {
  .home {
    --width-card: 100%;
    --max-width-text: 250px;
    --width-close: 200px;
    --min-width-open: 400px;
  }
}

@media (min-width: 900px) {
  .home {
    --max-width-text: 250px;
    --width-close: 200px;
    --min-width-open: 450px;
  }
}

@media (min-width: 1200px) {
  .home {
    --max-width-text: 300px;
    --width-close: 250px;
    --min-width-open: 600px;
  }
}

@media (min-width: 1600px) {
  .home {
    --max-width-text: 350px;
    --width-close: 300px;
    --min-width-open: 700px;
  }
}

.bottles-grid {
  position: relative;
}

.bottles__inner {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes bounce {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-100px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 899px) {
  .bottles__track.has-more-than-1 {
    animation: 1s ease-in-out 0s 1 bounce;
  }
}

@media (min-width: 900px) and (max-width: 1599px) {
  .bottles__track.has-more-than-4 {
    animation: 1s ease-in-out 0s 1 bounce;
  }
}

@media (min-width: 1600px) {
  .bottles__track.has-more-than-5 {
    animation: 1s ease-in-out 0s 1 bounce;
  }
}

.bottles__track {
  display: flex;
  width: 100%;
  height: 100vh;
}

.admin-bar .bottles__track {
  height: calc(100vh - 32px);
}

.bottle-card {
  width: var(--width-card);
  background-color: var(--background-color-light);
  position: relative;
  padding: var(--top-padding) var(--padding-s) var(--padding-s) var(--padding-s);
  overflow: hidden;
  transition: var(--transition-text-delay);
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .bottle-card {
    flex-shrink: 1;
    min-width: 25vw;
  }
}

@media (min-width: 1600px) {
  .bottle-card {
    min-width: 20vw;
  }
}

.bottle-card__link {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* ==== TEXTS ==== */

.bottle-card__texts {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--max-width-text);
}
.bottle-card__texts-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bottle-card__texts__kicker {
  display: none;
  color: var(--accent-color);
  text-transform: uppercase;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  transition: var(--transition-text-delay);
}

.bottle-card__texts__title {
  color: var(--black-color);
  text-transform: uppercase;
  font-weight: bold;
  font-size: 24px;
  line-height: 1;
  transition: var(--transition-text-delay);
}

.bottle-card__texts__tagline {
  color: var(--accent-color);
  font-size: 20px;
}

.bottle-card__texts__description {
  display: none;
  opacity: 0;
  transition: var(--transition-text-delay);
}

.bottle-card__texts__button {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  padding: 8px 16px;
  gap: 8px;
}

.bottle-card__texts__button__text {
  overflow: hidden;
  white-space: nowrap;
}

.bottle-card__texts__button__icon {
  color: white;
  width: 24px;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .bottle-card__texts__button {
    background-color: transparent;
    color: var(--black-color);
    border-color: var(--black-color);
    padding: 8px 8px;
    transition: var(--transition-text-delay);
    gap: 0px;
  }

  .bottle-card__texts__button__text {
    opacity: 0;
    max-width: 0;
    transition: var(--transition-text-delay);
  }

  .bottle-card__texts__button__icon {
    color: var(--black-color);
    transition: var(--transition-text-delay);
  }
}

/* ==== BOTTLE VISUAL (shared component) ==== */
.bottles-grid .bottle-card__image {
  height: 100%;
  position: relative;
}

.bottles-grid .bottle-visual {
  transition: var(--transition-images-delay);
}

.bottles-grid .bottle-visual__water {
  opacity: 0;
  transition: var(--transition-images-delay);
}

.bottles-grid .bottle-visual__group {
  transform: rotate(0);
  transition: var(--transition-images-delay);
}

.bottles-grid .bottle-visual__bottle {
  transition: var(--transition-images-delay);
}

.bottles-grid .bottle-visual__logo {
  opacity: 0;
  transition: var(--transition-images-delay);
}

.bottles-grid .bottle-visual__element {
  opacity: 0;
  transition: var(--transition-images-delay);
}

/* -- HOVER -- */
@media (min-width: 600px) {
  .bottles__inner:hover .bottle-card:not(:hover) {
    width: var(--width-close);
    min-width: var(--width-close);
  }

  .bottle-card:hover {
    width: 100%;
    min-width: var(--min-width-open);
  }

  .bottles-grid .bottle-card {
    &:hover {
      .bottle-card__texts__kicker {
        display: block;
        opacity: 1;
      }

      .bottle-card__texts__title {
        font-size: 40px;
      }

      .bottle-card__texts__description {
        display: block;
        opacity: 1;
      }

      .bottle-card__texts__button {
        background-color: var(--accent-color);
        color: white;
        border-color: var(--accent-color);
        padding: 8px 16px;
        gap: 8px;
      }

      .bottle-card__texts__button__text {
        opacity: 1;
        max-width: 500px;
      }

      .bottle-card__texts__button__icon {
        color: white;
      }

      /* IMAGES */
      .bottle-visual {
        transform: scale(1.5) translateY(-15%) translateX(50%);
      }
      .bottle-visual__group {
        transform: rotate(8deg);
      }
      .bottle-visual__water {
        opacity: 0.3;
      }
      .bottle-visual__logo {
        opacity: 0.5;
      }
      .bottle-visual__element {
        opacity: 1;
      }
    }
  }
}

/* Snap forward to the fully-hovered geometry instantly the moment a card is
   clicked — you have to be hovering the card to click it, so this completes
   the direction of motion already in progress instead of reversing it. That
   keeps the page-transition snapshot (see page-transitions.css) consistent
   every time, instead of landing wherever the 0.8s hover animation happened
   to be mid-flight when the click landed. Scoped to the same breakpoint as
   the hover effect itself — below 600px there's no hover/scale effect to
   preserve, so forcing it there just made cards stick grown/rotated on
   mobile after a tap (there's no hover to "reset" away from). */
@media (min-width: 600px) {
  .bottle-card.is-navigating {
    transition: none !important;
    width: 100% !important;
    min-width: var(--min-width-open) !important;
  }

  .bottle-card.is-navigating .bottle-visual {
    transition: none !important;
    transform: scale(1.5) translateY(-15%) translateX(50%) !important;
  }

  .bottle-card.is-navigating .bottle-visual__group {
    transition: none !important;
    transform: rotate(8deg) !important;
  }
}

/* ==== NO BOTTLE ==== */
.bottles-grid__no-bottle {
  height: 100vh;
  background-color: var(--main-bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.bottles-grid__no-bottle p {
  font-size: 32px;
  font-weight: bold;
}
