﻿/* --------------------------------------------------
   ROOT VARIABLES
-------------------------------------------------- */
:root {
  --bg-dark: #0b0b0b;
  --text-light: #f5f5f5;
  --accent-red: #ff0000;
  --accent-gold: #ff9900;
  --font-header: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --------------------------------------------------
   GLOBAL
-------------------------------------------------- */
body {
  margin: 0;
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-body);
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* --------------------------------------------------
   FREE SHIPPING BANNER
-------------------------------------------------- */
.free-shipping-banner {
  background: #4CAF50;
  color: white;
  text-align: center;
  padding: 12px 0;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --------------------------------------------------
   HERO
-------------------------------------------------- */
.hero {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #000;
  position: relative;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 20px rgba(255,153,0,0.3);
  margin-bottom: 1rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 153, 0, 0.25),
    rgba(0, 0, 0, 0.85)
  );
  pointer-events: none;
}

.hero h2 {
  font-size: 2.5rem;
  font-family: var(--font-header);
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------
   SECTION WRAPPER
-------------------------------------------------- */
section {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
  text-align: center;
}

.section-title {
  font-size: 2rem;
  font-family: var(--font-header);
  color: var(--accent-red);
  margin-bottom: 1rem;
}

/* --------------------------------------------------
   INTRO BOX
-------------------------------------------------- */
.intro-box {
  background-color: #1a1a1a;
  border: 1px solid #333;
  padding: 2rem;
  border-radius: 10px;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.intro-box span {
  color: var(--accent-gold);
  font-weight: 600;
}

/* --------------------------------------------------
   PRODUCT GRID
-------------------------------------------------- */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

/* --------------------------------------------------
   PRODUCT CARDS
-------------------------------------------------- */
.card {
  background-color: #1a1a1a;
  border: 1px solid #333;
  padding: 1.5rem;
  flex: 1 1 250px;
  max-width: 300px;
  text-align: center;
  border-radius: 10px;
}

/* Image container box - FIXED SQUARE SIZE */
.card .img-box {
  width: 100%;
  height: 300px; /* Fixed height - matches width for square */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a; /* Match card background */
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 2px solid var(--accent-gold);
  overflow: hidden;
  position: relative;
}

.card .img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fills the square box perfectly */
  border-radius: 0;
  margin: 0;
  border: none;
  display: block;
}

/* Legacy support for cards without img-box */
.card > img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 2px solid var(--accent-gold);
}

.card .price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow:
    0 0 6px rgba(255, 200, 50, 0.8),
    0 0 12px rgba(255, 170, 0, 0.6),
    0 0 18px rgba(255, 150, 0, 0.4);
  margin-bottom: 0.8rem;
}

.card p {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* --------------------------------------------------
   CTA BUTTONS
-------------------------------------------------- */
.cta a {
  display: inline-block;
  background-color: var(--accent-red);
  color: #fff;
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.3s;
}

.cta a:hover {
  background-color: #cc0000;
}

/* Out of stock */
.add-to-cart-btn.out-of-stock {
  background: #555;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Suggest card */
.card.suggest-card {
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 12px rgba(255,153,0,0.3);
}

.card.suggest-card h3 {
  font-family: var(--font-header);
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------
   CART ICON
-------------------------------------------------- */
#cart-icon {
  position: fixed;
  top: 300px;
  right: 28px;
  z-index: 9999;
  cursor: pointer;
}

#cart-svg {
  width: 60px;
  height: 60px;
}

#cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-red);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------
   CART PANEL
-------------------------------------------------- */
#cart-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  height: 100vh;
  background: #111;
  color: white;
  padding: 20px;
  box-shadow: -4px 0 12px rgba(0,0,0,0.4);
  z-index: 9998;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

#cart-panel.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--accent-gold);
}

#close-cart {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

#cart-items {
  flex: 1;
  overflow-y: auto;
  margin-top: 20px;
}

.cart-item {
  border-bottom: 1px solid #333;
  padding: 12px 0;
}

.cart-item-name {
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.cart-item-price {
  font-size: 1rem;
  margin: 4px 0;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controls button {
  background: var(--accent-gold);
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  color: black;
  font-weight: bold;
}

.remove-item {
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 0.9rem;
}

/* --------------------------------------------------
   CART FOOTER
-------------------------------------------------- */
.cart-footer {
  position: sticky;
  bottom: 0;
  background: #111;
  padding-top: 15px;
  padding-bottom: 105px;
  border-top: 1px solid #333;
  z-index: 10;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-gold);
  color: black;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: bold;
}

/* --------------------------------------------------
   CHECKOUT SCREEN
-------------------------------------------------- */
#checkout-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  color: white;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
}

#checkout-screen.open {
  display: flex;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-header h2 {
  margin: 0;
  font-size: 2rem;
  color: var(--accent-gold);
}

#close-checkout {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.checkout-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.checkout-section label {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.checkout-section input,
.checkout-section textarea {
  background: #222;
  border: 1px solid #444;
  padding: 10px;
  color: white;
  font-size: 1rem;
}

#order-summary {
  height: 140px;
}

.checkout-submit-btn {
  margin-top: 30px;
  padding: 14px;
  background: var(--accent-gold);
  color: black;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: bold;
}

/* --------------------------------------------------
   CONFIRMATION SCREEN
-------------------------------------------------- */
#confirmation-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  color: white;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  box-sizing: border-box;
}

#confirmation-screen.open {
  display: flex;
}

.confirmation-content {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInContainer 0.6s ease-out forwards;
  animation-delay: 0.4s;
}

.confirmation-content h2 {
  font-size: 2rem;
  color: var(--accent-gold);
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.7s;
}

.confirmation-content p {
  font-size: 1.25rem;
  line-height: 1.6;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 1s;
}

.confirmation-btn {
  margin-top: 20px;
  padding: 12px 20px;
  background: var(--accent-gold);
  color: black;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 1.3s;
}

/* Checkmark animation */
.checkmark-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid #4CAF50;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px auto;
  animation: pop-in 0.4s ease-out forwards;
}

.checkmark {
  width: 40px;
  height: 80px;
  border-right: 10px solid #4CAF50;
  border-bottom: 10px solid #4CAF50;
  transform: rotate(45deg) scale(0);
  transform-origin: bottom left;
  animation: draw-check 0.4s ease-out forwards;
  filter: drop-shadow(0 0 12px rgba(76, 175, 80, 0.6));
}

@keyframes pop-in {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes draw-check {
  0% { transform: rotate(45deg) scale(0); }
  100% { transform: rotate(45deg) scale(1); }
}

/* Countdown bar */
#countdown-bar {
  width: 90%;
  max-width: 400px;
  height: 6px;
  background: rgba(76, 175, 80, 0.3);
  border-radius: 3px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

#countdown-bar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: #4CAF50;
  animation: countdown-shrink var(--countdown-time) linear forwards;
}

@keyframes countdown-shrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* --------------------------------------------------
   BUTTON HOVER EFFECTS
-------------------------------------------------- */
button,
.add-to-cart-btn,
.checkout-btn,
.confirmation-btn {
  transition: 0.25s ease;
}

button:hover,
.add-to-cart-btn:hover,
.checkout-btn:hover,
.confirmation-btn:hover {
  box-shadow: 0 0 12px var(--accent-gold);
  transform: scale(1.03);
}

/* --------------------------------------------------
   MOBILE POLISH
-------------------------------------------------- */
@media (max-width: 600px) {

  .hero img {
    height: 200px;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .intro-box {
    padding: 1.25rem;
    font-size: 0.95rem;
  }

  section {
    padding: 1.25rem;
  }

  .grid {
    gap: 1.25rem;
  }

  .card {
    padding: 1rem;
    max-width: 100%;
  }

  .card .img-box {
    height: 250px; /* Smaller square on mobile */
  }

  .card .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .card > img {
    height: 250px;
    object-fit: cover;
  }

  .card .price {
    font-size: 1.2rem;
  }

  .cta a {
    padding: 0.65rem 1.2rem;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  footer {
    padding: 1.25rem;
    font-size: 0.85rem;
  }

  #confirmation-screen {
    padding: 15px;
  }

  .confirmation-content h2 {
    font-size: 1.6rem;
  }

  #confirmation-screen .confirmation-content p {
    font-size: 1rem;
  }

  #cart-panel {
    height: calc(100vh - 20px);
    overflow-y: auto;
  }

  #checkout-screen {
    padding: 20px;
  }

  .checkout-header h2 {
    font-size: 1.6rem;
  }

  .checkout-submit-btn {
    font-size: 1.1rem;
  }
}