/* =============================================================
   COCKTAIL POPUP — cocktail-popup.css
   Breakpoints: 480, 768, 1024, 1280, 1536, 2560
   ============================================================= */

/* --- Overlay backdrop --- */
#cocktail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

#cocktail-overlay.is-open {
  display: flex;
}

/* --- Popup card --- */
.cocktail-popup {
  position: relative;
  width: 80vw;
  height: 80vh;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: #f5efe4;
  background-image: url('/assets/images/box-flowers-bkg.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
}

/* --- Close button --- */
.cocktail-popup__close {
  position: absolute;
  top: 5%;
  right: 5%;
  z-index: 10;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1;
  color: #111111;
  padding: 4px 6px;
  transition: opacity 0.2s ease;
  opacity: 0.6;
}

.cocktail-popup__close:hover {
  opacity: 1;
}

.cocktail-popup__close:focus {
  outline: none;
  box-shadow: none;
}

/* --- Top decoration bar --- */
.cocktail-popup__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-shrink: 0;
  padding-top: 3%;
}

.cocktail-popup__cut-left,
.cocktail-popup__cut-right {
  display: block;
  width: 30%;
  height: auto;
  flex-shrink: 0;
}

.cocktail-popup__cut-spacer {
  flex: 1;
}

/* --- Body content area --- */
.cocktail-popup__body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5%;
  padding: 1% 8%;
}

/* --- Title --- */
.cocktail-popup__title {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #111111;
  text-align: center;
  margin: 5% 0 0 0;
  line-height: 1.2;
  width: 100%;
}

/* --- Diamond separator --- */
.cocktail-popup__diamond {
  display: block;
  width: 60%;
  margin: 0 auto;
  margin-top: 0;
  opacity: 0.7;
}

/* --- Tagline --- */
.cocktail-popup__tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(12px, 1.4vw, 16px);
  color: #111111;
  text-align: left;
  margin: 0;
  margin-top: 0;
  line-height: 1.4;
  width: 100%;
}


/* --- Ingredients list --- */
.cocktail-popup__ingredients {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cocktail-popup__ingredients li {
  font-family: var(--font-sans);
  font-size: clamp(12px, 1.3vw, 14px);
  color: #111111;
  text-align: left;
  line-height: 1.5;
}

.cocktail-popup__ingredients li .ingredient-name {
  font-weight: 700;
}

.cocktail-popup__ingredients li .ingredient-dose {
  font-weight: 400;
}

/* --- Preparation text --- */
.cocktail-popup__preparation {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(12px, 1.3vw, 14px);
  color: #111111;
  text-align: left;
  margin: 0;
  width: 100%;
  line-height: 1.6;
}

/* --- Glass illustration container --- */
.cocktail-popup__glass-wrap {
  width: 100%;
  max-height: 18%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: 5%;
}

.cocktail-popup__glass {
  display: block;
  max-height: 100%;
  max-width: 40%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* --- Bottom decoration bar --- */
.cocktail-popup__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: 3%;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

/* Mobile (max 480px) */
@media (max-width: 480px) {
  .cocktail-popup {
    width: 80vw;
    height: 80vh;
  }
  .cocktail-popup__cut-left,
  .cocktail-popup__cut-right {
    width: 35%;
  }
  .cocktail-popup__glass {
    max-width: 50%;
  }

  .cocktail-popup__close {
    top: 7%;
  }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .cocktail-popup {
    width: 72vw;
    height: 78vh;
    max-width: 580px;
    max-height: 820px;
  }

  .cocktail-popup__title {
    font-size: clamp(20px, 3.2vw, 32px);
    margin-top: 3%;
  }

  .cocktail-popup__tagline {
    font-size: clamp(14px, 2vw, 19px);
  }

  .cocktail-popup__section-label {
    font-size: clamp(12px, 1.6vw, 16px);
    margin-top: 3%;
  }

  .cocktail-popup__ingredients li {
    font-size: clamp(13px, 1.8vw, 17px);
  }

  .cocktail-popup__preparation {
    font-size: clamp(13px, 1.8vw, 17px);
  }

  .cocktail-popup__diamond {
    width: 32%;
  }

  .cocktail-popup__close {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .cocktail-popup {
    width: 80vw;
    height: 75vh;
  }
  .cocktail-popup__cut-left,
  .cocktail-popup__cut-right {
    width: 25%;
  }
}

/* Large desktop (1280px+) */
@media (min-width: 1280px) {
  .cocktail-popup {
    width: 80vw;
    height: 72vh;
  }
}

/* XL desktop (1536px+) */
@media (min-width: 1536px) {
  .cocktail-popup {
    width: 75vw;
    height: 70vh;
  }
}

/* 4K (2560px+) */
@media (min-width: 2560px) {
  .cocktail-popup {
    width: 60vw;
    height: 65vh;
  }
}

/* =============================================================
   COLLAPSIBLE SECTIONS
   ============================================================= */

/* Interactive title cursor */
.cocktail-popup__title--interactive {
  cursor: pointer;
}

/* Section label: flex row with chevron */
.cocktail-popup__section-label {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111111;
  text-align: left;
  margin: 2% 0 0 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Chevron: CSS-only rotating triangle */
.cocktail-popup__chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #111111;
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-top: 1px;
}

/* DEFAULT STATE — collapsed */
/* Tagline visible, both content blocks hidden */
.cocktail-popup__body .cocktail-popup__ingredients {
  display: none;
}

.cocktail-popup__body .cocktail-popup__preparation {
  display: none;
}

/* INGREDIENTS OPEN */
.cocktail-popup__body.section-open--ingredients
  .cocktail-popup__tagline {
  display: none;
}

.cocktail-popup__body.section-open--ingredients
  .cocktail-popup__ingredients {
  display: flex;
}

.cocktail-popup__body.section-open--ingredients
  .cocktail-popup__section-label[data-label="ingredients"]
  .cocktail-popup__chevron {
  transform: rotate(90deg);
}

/* PREPARATION OPEN */
.cocktail-popup__body.section-open--preparation
  .cocktail-popup__tagline {
  display: none;
}

.cocktail-popup__body.section-open--preparation
  .cocktail-popup__preparation {
  display: block;
}

.cocktail-popup__body.section-open--preparation
  .cocktail-popup__section-label[data-label="preparation"]
  .cocktail-popup__chevron {
  transform: rotate(90deg);
}

/* Fade transitions for content blocks */
.cocktail-popup__tagline,
.cocktail-popup__ingredients,
.cocktail-popup__preparation {
  transition: opacity 0.2s ease;
}

/* --- Garnish rendering --- */
.ingredient-spacer {
  height: 0.5em;
  list-style: none;
}

.ingredient-garnish-label {
  margin-top: 0.2em;
}

.ingredient-garnish-label .ingredient-name {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ingredient-garnish-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: #111111;
}

/* --- Flip animation --- */

/* Overlay fades in/out — no longer uses display toggle
   directly, uses opacity + pointer-events instead */
#cocktail-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#cocktail-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* Perspective wrapper for 3D flip */
.cocktail-popup-flipper {
  perspective: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The card itself transforms */
.cocktail-popup {
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#cocktail-overlay.is-open .cocktail-popup {
  transform: rotateY(0deg);
}

#cocktail-overlay.is-closing .cocktail-popup {
  transform: rotateY(180deg);
}

/* Back face of the card */
.cocktail-popup__back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background-color: #f5efe4;
  background-image: url('/assets/images/box-flowers-bkg.jpg');
  background-size: cover;
  background-position: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
}

/* Override the display:none / display:flex toggle —
   the overlay is always in the DOM but hidden via opacity */
#cocktail-overlay {
  display: flex !important;
}
