/* =============================================================================
   4. LAYOUT
============================================================================= */
.bg {
  position: relative;
  width: min(120vw, calc(120vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-width: 120vw;
  max-height: 120vh;
  background: url('../assets/images/wallpaper.png') center / contain no-repeat;
}

/* Chrome, Edge, Safari */
.overlay-panel::-webkit-scrollbar,
.product-detail-scroll::-webkit-scrollbar,
.cart-view::-webkit-scrollbar,
#cart-items-container::-webkit-scrollbar {
  width: 4px;
}

.overlay-panel::-webkit-scrollbar-track,
.product-detail-scroll::-webkit-scrollbar-track,
.cart-view::-webkit-scrollbar-track,
#cart-items-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.overlay-panel::-webkit-scrollbar-thumb,
.product-detail-scroll::-webkit-scrollbar-thumb,
.cart-view::-webkit-scrollbar-thumb,
#cart-items-container::-webkit-scrollbar-thumb {
  background: linear-gradient(#ffd700, #ffb700);
  border-radius: 6px;
}

.overlay-panel::-webkit-scrollbar-thumb:hover,
.product-detail-scroll::-webkit-scrollbar-thumb:hover,
.cart-view::-webkit-scrollbar-thumb:hover,
#cart-items-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#ffe066, #ffc400);
}

/* Firefox */
.overlay-panel,
.product-detail-scroll,
.cart-view,
#cart-items-container {
  scrollbar-width: thin;
  scrollbar-color: #ffd700 rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   6. BUTTON AREAS
============================================================================= */
.button-area {
  position: absolute;
  display: block;
  width: 5.3%;
  animation: bounce 3s ease-in-out infinite;
  transition: transform 1s ease, filter 1s ease;
}

.button-area img {
  width: 100%;
  height: auto;
  transition: transform var(--transition-slow), filter var(--transition-slow);
}

.button-area:hover {
  animation: bounceHover 2s ease-in-out infinite;
}

.button-area:hover img {
  transform: scale(1.1);
  filter:
    drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 12px #ff8c00);
  animation: glowPulse 1.5s infinite alternate;
}

.area1 {
  top: 58%;
  left: 12%;
}

.area2 {
  top: 58%;
  left: 19%;
}

.area3 {
  top: 58%;
  left: 25.5%;
}

.area4 {
  top: 58%;
  left: 31.8%;
}

/* =============================================================================
   7. NEWS BANNER
============================================================================= */
.news-banner {
  position: absolute;
  top: 13.9%;
  right: 13.1%;
  z-index: 10;
  width: 23.5%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
}

.news-banner::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 25%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
}

.slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-base);
}

.slide {
  min-width: 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dots {
  position: absolute;
  top: 23%;
  right: 11%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  height: auto;
  z-index: 25;
}

.dot {
  width: 1.2vh;
  height: 1.2vh;
  min-width: 2px;
  min-height: 2px;
  display: inline-block;
  background-color: var(--color-white);
  border-radius: 50%;
  transition: background-color var(--transition-base);
}

.dot.active {
  background-color: #333;
}

.nav {
  position: absolute;
  top: 0;
  z-index: 20;
  width: 20%;
  height: 100%;
  transition: background 0.3s ease;
}

.nav:hover {
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.nav.left {
  left: 0;
}

.nav.right {
  right: 0;
}

/* =============================================================================
   20. RESPONSIVE
============================================================================= */

@media (max-width: 790px) and (orientation: portrait) {
  #rotation-message {
    display: flex;
  }
}

@media (max-width: 1280px) {
  .area1 {
    top: 57%;
    left: 12%;
  }

  .area2 {
    top: 57%;
    left: 19%;
  }

  .area3 {
    top: 57%;
    left: 25.5%;
  }

  .area4 {
    top: 57%;
    left: 31.8%;
  }
}

@media (max-width: 768px) {
  .dot {
    width: 0.8vh;
    height: 0.8vh;
  }

  .checkout-panel {
    top: 86px;
    width: calc(100% - 24px);
    max-height: calc(100% - 172px);
    padding: 18px;
  }

  .checkout-summary {
    grid-template-columns: 1fr;
  }

  #product-detail-content {
    grid-template-columns: 1fr;
  }

  .product-info {
    text-align: center;
  }

  #product-detail-footer,
  .cart-footer {
    padding: 15px 5%;
  }

  .footer-price,
  .cart-total {
    margin-right: 15px;
    font-size: 1.5em;
  }

  .add-to-cart-btn,
  #checkout-button {
    padding: 12px 20px;
    font-size: 1em;
  }

  #cart-overlay.checkout-open #cart-items-container {
    padding-bottom: 430px;
  }
}

@media (max-width: 700px) {
  @keyframes bounce {
    50% {
      transform: translateY(-0.2vh);
    }
  }

  @keyframes bounceHover {
    50% {
      transform: scale(1.1) translateY(-0.2vh);
    }
  }
}


/* =============================================================================
   21. INTERFACE STATE
   ============================================================================= */

body.overlay-open .button-area,
body.overlay-open .news-banner {
  animation-play-state: paused !important;
  pointer-events: none !important;
}

body.overlay-open .floating-cat,
body.overlay-open .cat-dialog {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}