/*******************************
 *    REFLECTIONS PAGE STYLES
 *******************************/

@font-face {
  font-family: 'Lvvvdy';
  src: url('assets/Lvvvdy.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --text-color: #666;
  --dark-bg: #0a0a0a;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-color: var(--dark-bg);
  font-family: 'Amatic SC', sans-serif;
}

/************************************
 *    LOADING SCREEN
 ************************************/
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--dark-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  color: #888;
  font-size: 18px;
  font-family: 'Lvvvdy', sans-serif;
  letter-spacing: 0.1em;
}

.reflection-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/************************************
 *    REFLECTION IMAGE
 ************************************/
#reflection-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Changed from cover to contain to show full image */
  object-position: center;
  transition: filter 0.3s ease;
}

/************************************
 *    HOTSPOT OVERLAY (SVG)
 ************************************/
#hotspot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#hotspot-overlay rect {
  pointer-events: all;
  transition: fill 0.2s ease, stroke 0.2s ease;
  outline: none;
}

/* Only show focus indicator for keyboard navigation, not mouse clicks */
#hotspot-overlay rect:focus-visible {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
}

/* Glow effect on crack (controlled by JavaScript) */
#crack-glow,
#woman-crack-glow {
  position: absolute;
  width: 0.5%;
  height: 3%;
  left: 49.1%;
  top: 82.1%;
  border-radius: 40%;
  background: rgb(255, 255, 255);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  transform: rotate(60deg);
  box-shadow: 0 0 20px 8px rgba(255, 255, 255, 0.9),
    0 0 40px 15px rgba(255, 255, 255, 0.6),
    0 0 60px 25px rgba(255, 255, 255, 0.3);
}

#crack-glow.active,
#woman-crack-glow.active {
  opacity: 1;
  animation: unlocking-hum 3s ease-in-out infinite;
}

@keyframes unlocking-hum {

  0%,
  100% {
    transform: rotate(60deg) scale(1);
    box-shadow: 0 0 20px 8px rgba(255, 255, 255, 0.85),
      0 0 40px 15px rgba(255, 255, 255, 0.55),
      0 0 60px 25px rgba(255, 255, 255, 0.25);
  }

  50% {
    transform: rotate(60deg) scale(1.02);
    box-shadow: 0 0 22px 9px rgba(255, 255, 255, 0.95),
      0 0 44px 17px rgba(255, 255, 255, 0.65),
      0 0 65px 27px rgba(255, 255, 255, 0.35);
  }
}

/************************************
 *    SHATTER CANVAS
 ************************************/
#shatter-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#shatter-canvas.active {
  opacity: 1;
  pointer-events: auto;
}

/************************************
 *    BOTTLE CART CONTAINER
 ************************************/
#bottle-cart-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  overflow-y: auto;
}

#bottle-cart-container.visible {
  display: flex !important;
  opacity: 1;
}

#bottle-cart-container.visible #close-cart-btn {
  display: block !important;
  opacity: 1 !important;
}

#bottle-emergence {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  padding: 40px;
  opacity: 0;
  transform: scale(0.05) translateY(0);
  transition: opacity 3.5s ease-out,
    transform 3.5s ease-out;
  will-change: opacity, transform;
  pointer-events: auto;
}

#bottle-emergence::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 40%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: background-glow 3s ease-in-out infinite;
}

@keyframes background-glow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

#bottle-cart-container.visible #bottle-emergence {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition-delay: 0s;
}

#emerged-bottle {
  max-width: 500px;
  max-height: 600px;
  object-fit: contain;
  margin-bottom: 30px;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 40px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 60px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 80px rgba(255, 255, 255, 0.3));
  animation: bottle-shine 3s ease-in-out infinite;
}

@keyframes bottle-shine {

  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 40px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 60px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 80px rgba(255, 255, 255, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 1)) drop-shadow(0 0 50px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 70px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 100px rgba(255, 255, 255, 0.4));
  }
}

.button-group {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 15px;
  width: 100%;
  max-width: 500px;
}

.purchase-btn {
  font-family: 'Lvvvdy', sans-serif;
  font-size: 20px;
  padding: 16px 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.08em;
  border-radius: 8px;
  border: none;
  font-weight: normal;
  position: relative;
  min-width: 200px;
}

.apple-pay-btn {
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid #888;
}

.apple-pay-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 814 1000" fill="white"%3E%3Cpath d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.apple-pay-btn:hover {
  background: #1a1a1a;
  border-color: #aaa;
  transform: scale(1.03);
}

.cart-btn {
  background: transparent;
  border: 2px solid #888;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ccc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>') center/contain no-repeat;
}

.cart-btn:hover {
  background: #888;
  transform: scale(1.03);
}

.cart-btn:hover .cart-icon {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>') center/contain no-repeat;
}

#close-cart-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0;
  /* Hide the × text */
  z-index: 101;
  /* Above cart container */
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: all 0.3s ease;
  outline: none; /* Remove blue focus box */
}

#close-cart-btn:hover {
  transform: scale(1.1);
}

#close-cart-btn:focus {
  outline: none; /* Remove blue focus box */
}

#close-cart-btn::before,
#close-cart-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg,
      transparent 0%,
      #888 20%,
      #888 80%,
      transparent 100%);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
  transform-origin: center;
  transition: all 0.3s ease;
}

#close-cart-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#close-cart-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#close-cart-btn:hover::before,
#close-cart-btn:hover::after {
  background: linear-gradient(90deg,
      transparent 0%,
      #ccc 20%,
      #ccc 80%,
      transparent 100%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
  width: 35px;
}

/************************************
 *    VIDEO MODAL
 ************************************/
#video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  overflow-y: auto;
}

#video-modal.visible {
  display: flex !important;
  opacity: 1;
}

#video-modal.visible #video-close-btn {
  display: block !important;
  opacity: 1 !important;
}

#video-emergence {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 1200px;
  opacity: 0.3;
  transform: scale(0.05) translateY(0);
  transition: opacity 3.5s ease-out,
    transform 3.5s ease-out;
}

#video-modal.visible #video-emergence {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition-delay: 0s;
}

#video-iframe {
  width: 100%;
  height: 50.625vw;
  /* 16:9 aspect ratio */
  max-width: 1200px;
  max-height: 675px;
  box-shadow: 0 0 20px 8px rgba(255, 255, 255, 0.3),
    0 0 40px 15px rgba(255, 255, 255, 0.2),
    0 0 60px 25px rgba(255, 255, 255, 0.1);
}

#video-close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 201;
  font-size: 0;
  /* Hide the × text */
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: all 0.3s ease;
  outline: none;
}

#video-close-btn:hover {
  transform: scale(1.1);
}

#video-close-btn:focus {
  outline: none;
}

#video-close-btn::before,
#video-close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg,
      transparent 0%,
      #888 20%,
      #888 80%,
      transparent 100%);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
  transform-origin: center;
  transition: all 0.3s ease;
}

#video-close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#video-close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#video-close-btn:hover::before,
#video-close-btn:hover::after {
  background: linear-gradient(90deg,
      transparent 0%,
      #ccc 20%,
      #ccc 80%,
      transparent 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Mobile adjustments */
@media (max-width: 767px) {

  /* Adjust crack glow for mobile - move to better position */
  #crack-glow,
  #woman-crack-glow {
    width: 1%;
    height: 4%;
    left: 48.5%;
    top: 75%;
  }

  /* Make hotspots slightly larger for easier touch */
  #bottle-hotspot {
    width: 18 !important;
    height: 28 !important;
  }

  #woman-hotspot {
    width: 35 !important;
    height: 65 !important;
  }

  /* Adjust video for mobile */
  #video-iframe {
    width: 95%;
    height: 53.4375vw;
    /* 16:9 aspect ratio for mobile */
  }

  #video-close-btn {
    top: -50px;
    right: 0;
    width: 35px;
    height: 35px;
  }

  #video-close-btn::before,
  #video-close-btn::after {
    width: 25px;
  }

  /* Adjust bottle emergence for mobile */
  #bottle-emergence {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }

  /* Disable background glow on mobile for better performance */
  #bottle-emergence::before {
    animation: none;
    opacity: 0.6;
  }

  #emerged-bottle {
    max-width: 280px;
    max-height: 350px;
    margin-bottom: 20px;
  }

  .button-group {
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    width: 100%;
  }

  .purchase-btn {
    padding: 18px 30px;
    font-size: 18px;
    min-height: 56px;
    width: 100%;
  }

  .apple-pay-icon,
  .cart-icon {
    width: 28px;
    height: 28px;
  }

  #close-cart-btn {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
  }

  #close-cart-btn::before,
  #close-cart-btn::after {
    width: 25px;
  }
}

/* Mobile landscape adjustments */
@media (max-width: 767px) and (orientation: landscape) {
  #bottle-emergence {
    padding: 15px;
    max-height: 90vh;
    overflow-y: auto;
  }

  #emerged-bottle {
    max-width: 200px;
    max-height: 250px;
    margin-bottom: 15px;
  }

  .button-group {
    flex-direction: row;
    gap: 10px;
    max-width: 400px;
  }

  .purchase-btn {
    padding: 14px 24px;
    font-size: 16px;
    min-height: 48px;
  }

  #close-cart-btn {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
}

/* Tablet/landscape adjustments */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

  #crack-glow,
  #woman-crack-glow {
    left: 48%;
    top: 78%;
  }
}

/* Ultra-wide displays */
@media (min-aspect-ratio: 21/9) {

  #crack-glow,
  #woman-crack-glow {
    left: 50%;
    top: 80%;
  }
}

/* Portrait orientation adjustments */
@media (orientation: portrait) and (max-width: 767px) {

  #crack-glow,
  #woman-crack-glow {
    left: 48%;
    top: 70%;
  }

  #bottle-hotspot {
    x: 24;
    y: 50;
    width: 18;
    height: 30;
  }
}

/************************************
 *    PAYMENT FORM STYLES
 ************************************/
#payment-form-container {
  width: 100%;
  max-width: 500px;
  padding: 30px;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.product-title {
  font-family: 'Lvvvdy', sans-serif;
  font-size: 28px;
  color: #fff;
  text-align: center;
  margin: 0 0 10px 0;
  letter-spacing: 0.05em;
}

.product-price {
  font-family: 'Amatic SC', sans-serif;
  font-size: 24px;
  color: #ccc;
  text-align: center;
  margin: 0 0 25px 0;
}

#payment-request-button {
  margin-bottom: 20px;
}

#or-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

#or-divider span {
  background: rgba(20, 20, 20, 0.9);
  padding: 0 15px;
  color: #888;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

#or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
}

#payment-form {
  margin-top: 20px;
}

#address-element {
  margin-bottom: 20px;
}

#payment-element {
  margin-bottom: 20px;
}

#submit-payment {
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  padding: 16px;
  font-family: 'Lvvvdy', sans-serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#submit-payment:hover:not(:disabled) {
  background: #f0f0f0;
  transform: scale(1.02);
}

#submit-payment:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#submit-payment:disabled:hover {
  transform: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
}

.payment-message {
  margin-top: 15px;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
}

.payment-message.error {
  color: #ff6b6b;
}

.payment-message.success {
  color: #51cf66;
}

/* Mobile payment form adjustments */
@media (max-width: 767px) {
  #payment-form-container {
    max-width: 90%;
    padding: 20px 15px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .product-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .product-price {
    font-size: 18px;
    margin-bottom: 20px;
  }

  #payment-element {
    margin-bottom: 20px;
  }

  #submit-payment {
    padding: 18px;
    font-size: 18px;
    min-height: 56px;
  }

  #payment-message {
    font-size: 14px;
    padding: 12px;
  }
}

/************************************
 *    ANIMATIONS
 ************************************/

/************************************
 *    ACCESSIBILITY
 ************************************/
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.1s !important;
    animation-duration: 0.1s !important;
  }
}