/* --- BASE RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Set these to match your actual navbar heights */
  --nav-height: 92px;         /* desktop header height */
  --nav-height-mobile: 30px;  /* mobile header height */

  /* Gap between cart main and recommendations */
  --cart-to-reco-gap: 120px !important;   /* adjust this to change the space */
}

/* Reserve space for the navbar so page content begins below it.
   This prevents the navbar from overlaying the cart title/contents. */
#app-container {
  padding-top: var(--nav-height);
}

body {
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  background-color: #f9f9f9;
  color: #111;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.continue-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 20px;
}
.home-carousel {
  margin-bottom: 60px; /* Add this line to create space above the footer */
}
.continue-shopping-link {
  display: inline-block;              /* Keeps width to text only */
  font-size: 15px;
  font-weight: 500;
  color: #111;
  text-decoration: none;
  position: relative;
  padding: 4px 6px;
}

.continue-shopping-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: #111;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.continue-shopping-link:hover {
  color: #000;
}

.continue-shopping-link:hover::after {
  transform: scaleX(1);
}


/* --- CART WRAPPER --- */
.cart-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1300px;
  margin: 60px auto;
  padding: 40px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  gap: 40px;
}

/* --- LEFT SECTION: CART ITEMS --- */
.cart-items-section {
  flex: 1 1 60%;
  min-width: 300px;
}

.cart-items-section h1 {
  text-align: center;
  font-size: 36px;
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: #111;
}

/* --- INDIVIDUAL ITEM --- */
.cart-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
  align-items: center;
  animation: fadeIn 0.5s ease forwards;
}

.cart-item img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.item-details {
  flex: 1;
}

.item-details h3 {
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 600;
}

.item-details p {
  font-size: 15px;
  color: #777;
  margin-bottom: 10px;
}

.item-price {
  font-size: 18px;
  color: #D4AF37;
  font-weight: 700;
}

/* --- QUANTITY + REMOVE --- */
.quantity-control {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.quantity-btn {
  width: 44px;
  height: 44px;
  font-size: 20px;
  font-weight: 600;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: #111;
  color: white;
  transform: translateY(-1px);
}

.quantity-number {
  font-size: 16px;
  font-weight: 500;
  min-width: 32px;
  text-align: center;
}

/* --- REMOVE ITEM BUTTON --- */
.remove-item {
  background: none;
  border: none;
  color: #999;
  margin-top: 12px;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

.remove-item:hover {
  color: #D4AF37;
}

/* --- RIGHT SECTION: ORDER SUMMARY --- */
/* Increase sticky top by nav height so the summary doesn't get hidden under navbar */
.cart-summary {
  flex: 1 1 35%;
  min-width: 280px;
  background: #fcfcfc;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0,0,0,0.06);
  position: sticky;
  top: calc(30px + var(--nav-height));
  z-index: 2;
}

.cart-summary h2 {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}

/* --- TOTALS --- */
.subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  margin-bottom: 20px;
}

.shipping-info {
  font-size: 14px;
  color: #777;
  margin: 10px 0 20px;
  line-height: 1.4;
}

/* --- COUPON INPUT --- */
.discount-section {
  margin-bottom: 20px;
}

.discount-section input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  border: 1px solid #ddd;
  transition: border-color 0.3s;
}

.discount-section input:focus {
  outline: none;
  border-color: #f94f6d;
}

.discount-section small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #999;
}

/* --- CHECKOUT BUTTON --- */
#checkout-btn {
  width: 100%;
  padding: 16px 0;
  border: none;
  border-radius: 4px;
  background: #000;
  color: white;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

#checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  color: #000;
  background: #fff;
}

/* --- EMPTY CART STATE --- */
.empty-cart {
  padding: 40px;
  text-align: center;
}

.empty-cart .back-link {
  font-weight: 600;
  color: #f94f6d;
  font-size: 15px;
  text-decoration: underline;
  display: inline-block;
  margin-top: 15px;
}

input:invalid, textarea:invalid {
  border-color: red;
}

input.error, textarea.error {
  border-color: red !important;
}
#apply-coupon {
  display: block;
  margin-bottom: 20px;
  padding: 8px 0; /* Only top/bottom padding */
  background: transparent;
  color: #000;
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: none; /* No full border */
  cursor: pointer;
  position: relative; /* Needed for underline */
  transition: color 0.25s ease;
}

/* Animated underline */
#apply-coupon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px; /* Thin line */
  background: #000;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

#apply-coupon:hover {
  color: rgba(0, 0, 0, 0.7); /* Slight fade on hover */
}

#apply-coupon:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

#apply-coupon:active {
  color: #000; /* Reset color on click */
}

/* ========== REWARDS PROGRESS BAR (From cart-slider) ========== */
.cart-rewards {
  padding: 16px 18px;
  background: linear-gradient(180deg,#fff 0%, #fff9fa 100%);
  border-radius: 12px;
  margin: 14px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  text-align: center;
  font-family: var(--lux-body, "Montserrat", "Helvetica Neue", Arial, sans-serif);
}

.cart-rewards .reward-msg {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #222;
}
.cart-rewards .reward-submsg {
  font-size: 12px;
  margin-bottom: 16px;
  color: #555;
}

.reward-progress {
  position: relative;
  height: 60px;
}

.reward-line {
  position: absolute;
  top: 22px; left: 0; right: 0;
  height: 6px;
  background: #eee;
  border-radius: 6px;
}
.reward-line-fill {
  position: absolute;
  top: 22px; left: 0;
  height: 6px;
  background: linear-gradient(90deg,#ff5aa8,#ff7bbf);
  border-radius: 6px;
  transition: width .4s ease;
}

/* Each milestone */
.reward-step {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #fde5ef;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}
.reward-step .reward-icon {
  font-size: 16px;
  line-height: 1;
}
.reward-step .reward-label {
  position: absolute;
  top: 46px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  color: #333;
}

/* Step states */
.reward-step.completed {
  background: linear-gradient(90deg,#ff5aa8,#ff7bbf);
  color: #fff;
  border: none;
}
.reward-step.completed .reward-icon {
  content: "✔";
}

.reward-step.active {
  border-color: #ff7bbf;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 14px rgba(255,90,168,0.18);
}
.reward-step:not(.completed):not(.active) {
  opacity: 0.65;
}

/* Positioning steps across the line */
.reward-step:nth-of-type(1) { left: 0%; }
.reward-step:nth-of-type(2) { left: 50%; }
.reward-step:nth-of-type(3) { left: 100%; }

.reward-step .reward-label {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  width: 100%;
  white-space: normal;
  text-align: center;
  color: #333;
}

/* Gift message */
.gift-msg {
  background: #f0fff4;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 14px;
  text-align: center;
}

/* Small apply button for auto discount */
.small-apply-btn {
  background: #ff5aa8;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.small-apply-btn:hover {
  background: #e04a90;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* use mobile nav height */
  #app-container {
    padding-top: var(--nav-height-mobile);
  }
  .cart-rewards {
    margin: 20px 0;
    padding: 15px;
  }
  
  .reward-msg {
    font-size: 14px;
  }
  
  .reward-submsg {
    font-size: 13px;
  }
  
  .reward-progress {
    height: 70px;
    margin: 20px 0 10px;
  }
  
  .reward-step {
    width: 32px;
    height: 32px;
  }
  
  .reward-step .reward-label {
    font-size: 7px;
    top: 36px;
  }
}

@media (max-width: 480px) {
  .reward-label {
    font-size: 8px;
    max-width: 60px;
  }
  
  .reward-step {
    min-width: 60px;
  }
  
  .reward-msg, .reward-submsg {
    text-align: center;
    padding: 0 10px;
  }
  
  .reward-line,
  .reward-line-fill {
    left: 8%;
    right: 8%;
  }
  
  #reward-step-1 { left: 8%; }
  #reward-step-3 { left: 92%; }
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {

  .continue-shopping-link {
    justify-content: center;
    font-size: 15px;
    text-align: center;
  }
  
  .cart-container {
    flex-direction: column;
    width: 100%;
    margin: 0;
    border-radius: none;
    padding: none;
  }

  .cart-summary {
    position: static;
    margin-top: 30px;
    width: 100%;
    top: auto; /* reset sticky offset on small screens */
  }

  .cart-items-section h1 {
    font-size: 26px;
    text-align: center;
    font-weight: 400;
    letter-spacing: 2px;
  }

  .cart-item img {
    width: 90px;
    height: 90px;
  }

  .item-details h3 {
    font-size: 18px;
    font-weight: 400;
  }

  .quantity-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  #checkout-btn {
    font-size: 16px;
    padding: 14px 0;
  }
}

/* ---- Gap between Order Summary and Recommended For You ---- */
/* Add margin-top to the home-carousel that follows the main.cart-container */
main.cart-container + .home-carousel,
main.cart-container + section.home-carousel {
  margin-top: var(--cart-to-reco-gap);
}

/* reduce gap on smaller screens */
@media (max-width: 768px) {
  :root { --cart-to-reco-gap: 28px; }
  main.cart-container + .home-carousel,
  main.cart-container + section.home-carousel {
    margin-top: var(--cart-to-reco-gap);
  }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

