/* ==========================================================================
 * La Bussola - True 3D Drink Experience (Lattina 33 cl.)
 * Creative Floating 3D Product Showcase — Surgical Cleanup
 * Pure Spatial Atmosphere, Focused Typography, Zero Unrequested Text
 * ========================================================================== */

/* Viewport-wide floating product atmosphere */
#drink-3d-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: radial-gradient(ellipse 70% 60% at 50% 36%, rgba(30, 26, 22, 0.94) 0%, rgba(12, 10, 9, 0.98) 65%, #050403 100%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#drink-3d-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Atmospheric amber-gold spotlight behind the floating 3D can */
#drink-3d-modal::before {
  content: "";
  position: fixed;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 480px;
  max-width: 85vw;
  max-height: 85vw;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.02) 45%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
}

/* Independent Floating Close Button (Fixed Top-Right) */
.drink-3d-float-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 21, 18, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drink-3d-float-close:hover {
  color: #ffffff;
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(38, 33, 28, 0.88);
  transform: scale(1.06);
}

.drink-3d-float-close:active {
  transform: scale(0.95);
}

/* Floating Showcase Main Content (NO outer box, NO enclosing borders, NO card fill) */
.drink-3d-stage-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: auto;
  transform: scale(0.96) translateY(6px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#drink-3d-modal.is-open .drink-3d-stage-content {
  transform: scale(1) translateY(0);
}

/* 1. Floating Header */
.drink-3d-float-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2px;
}

.drink-3d-float-title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.drink-3d-float-title em {
  font-style: italic;
  color: #d4af37;
}

/* 2. The 3D Can Hero Stage */
.drink-3d-hero-viewport {
  position: relative;
  width: 100%;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}

.drink-3d-canvas-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drink-3d-canvas-box:active {
  cursor: grabbing;
}

.drink-3d-canvas-box canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 290px;
}

/* 3. Floating Selected Drink Name */
.drink-3d-float-info {
  text-align: center;
  margin: 8px 0 16px;
  width: 100%;
}

.drink-3d-info-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: #d4af37;
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

/* 4. Floating Flavour Selection Controls */
.drink-3d-float-selector {
  width: 100%;
  max-width: 480px;
  margin-bottom: 16px;
}

.drink-3d-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 600;
  margin-bottom: 7px;
  padding: 0 4px;
}

.drink-3d-selector-count {
  color: rgba(212, 175, 55, 0.85);
}

.drink-3d-pills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

.drink-3d-pill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 21, 18, 0.60);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.drink-3d-pill-btn:hover {
  background: rgba(36, 31, 27, 0.82);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-1px);
}

.drink-3d-pill-btn.is-active {
  background: rgba(212, 175, 55, 0.14);
  border-color: #d4af37;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}

.drink-3d-pill-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.drink-3d-pill-label {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
  text-align: center;
}

.drink-3d-pill-btn.is-active .drink-3d-pill-label {
  color: #d4af37;
  font-weight: 600;
}

.drink-3d-pill-badge {
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1;
  text-align: center;
}

.drink-3d-pill-btn.is-active .drink-3d-pill-badge {
  color: rgba(212, 175, 55, 0.8);
}

/* 5. Floating Action Dock (Quantity Stepper + Add to Order CTA) */
.drink-3d-float-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 4px;
}

.drink-3d-float-stepper {
  display: flex;
  align-items: center;
  background: rgba(24, 21, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  padding: 3px 5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.drink-3d-stepper-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.drink-3d-stepper-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.drink-3d-stepper-btn:active {
  transform: scale(0.92);
}

.drink-3d-stepper-num {
  width: 26px;
  text-align: center;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 14.5px;
  font-weight: 500;
  color: #f5f0e6;
}

.drink-3d-float-cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 20px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, #d4af37 0%, #ecd67c 50%, #c49b2c 100%);
  color: #0c0a09;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(212, 175, 55, 0.32);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drink-3d-float-cta:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 28px rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}

.drink-3d-float-cta:active {
  transform: scale(0.98);
}

.drink-3d-cta-sep {
  opacity: 0.45;
  margin: 0 2px;
}

.drink-3d-cta-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
 * Responsive Adjustments for Mobile (390 × 844)
 * ========================================================================== */
@media (max-width: 480px) {
  #drink-3d-modal {
    padding: 16px 14px 14px;
    justify-content: flex-start;
  }
  
  .drink-3d-float-close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
  }

  .drink-3d-float-title {
    font-size: 23px;
    margin-top: 2px;
  }

  .drink-3d-hero-viewport {
    height: 250px;
    margin: 2px 0 0;
  }

  .drink-3d-canvas-box canvas {
    max-height: 250px;
  }

  .drink-3d-float-info {
    margin: 6px 0 12px;
  }

  .drink-3d-info-title {
    font-size: 19px;
  }

  .drink-3d-float-selector {
    margin-bottom: 12px;
  }

  .drink-3d-selector-header {
    font-size: 9px;
    margin-bottom: 5px;
  }

  .drink-3d-pills-grid {
    gap: 5px;
  }

  .drink-3d-pill-btn {
    padding: 5px 2px;
    border-radius: 10px;
  }

  .drink-3d-pill-label {
    font-size: 11px;
  }

  .drink-3d-pill-badge {
    font-size: 8px;
  }

  .drink-3d-float-dock {
    gap: 8px;
    margin-top: 2px;
  }

  .drink-3d-float-stepper {
    padding: 2px 4px;
    border-radius: 11px;
  }

  .drink-3d-stepper-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .drink-3d-stepper-num {
    width: 22px;
    font-size: 13.5px;
  }

  .drink-3d-float-cta {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 11px;
    gap: 4px;
  }
}

/* Dynamic variant count adjustments */
#drink-3d-modal[data-count="2"] .drink-3d-pills-grid {
  grid-template-columns: repeat(2, 1fr);
  max-width: 320px;
  margin: 0 auto;
}

#drink-3d-modal[data-count="1"] .drink-3d-float-selector,
#drink-3d-modal[data-count="0"] .drink-3d-float-selector {
  display: none !important;
}

#drink-3d-modal[data-count="2"] .drink-3d-selector-header {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
