/* =========================
   ROOT VARIABLES
========================= */
:root {
  --bg-color: #f2f0f1;
  --white: #ffffff;
  --black: #000000;
  --dark-teal: #003d29;
  --gray-text: #666666;
  --border-color: #e0e0e0;
  --accent-red: #ff3333;
}

/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--black);
}

/* =========================
   FIXED HEADER OFFSET
   (CRITICAL)
========================= */
main.main {
  padding-top: 100px; /* height of fixed navbar */
}

/* =========================
   CONTAINER
========================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   BREADCRUMB & TITLE
========================= */
.breadcrumb {
  font-size: 14px;
  color: var(--gray-text);
  margin-bottom: 10px;
}

.breadcrumb-link {
  color: #053027;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 30px;
  text-transform: uppercase;
  text-align: center;
}

/* =========================
   CART LAYOUT
========================= */
.cart-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

/* =========================
   CART ITEMS
========================= */
.cart-items {
  background: var(--white);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.item {
  display: flex;
  padding: 24px 0;
  border-bottom: 1px solid #eee;
}

.item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-img {
  width: 120px;
  height: 120px;
  margin-right: 20px;
  object-fit: cover;
  border-radius: 0;      /* removes rounded box feel */
  background: none;      /* removes grey background */
}

/* =========================
   ITEM DETAILS
========================= */
.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-header {
  display: flex;
  justify-content: space-between;
}

.item-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}

.item-meta {
  font-size: 13px;
  color: var(--gray-text);
  line-height: 1.5;
}

.trash-btn {
  color: var(--accent-red);
  cursor: pointer;
  font-size: 18px;
}

/* =========================
   ITEM FOOTER
========================= */
.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.item-price {
  font-size: 22px;
  font-weight: 700;
}

/* =========================
   QUANTITY CONTROLS
========================= */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #f0f0f0;
  padding: 6px 14px;
  border-radius: 30px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}
.qty-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}


.qty-btn:hover {
  background: #e6e6e6;
}

/* =========================
   ORDER SUMMARY
========================= */
.order-summary {
  background: var(--white);
  border-radius: 20px;
  padding: 25px;
  border: 1px solid var(--border-color);
}

.order-summary h2 {
  font-size: 24px;
  margin-bottom: 25px;
}

.delivery-select {
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #f0f0f0;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  min-width: 220px;
  color: #053027;              /* selected text color */
  font-weight: 500;
}

/* When user clicks / focuses the dropdown */
.delivery-select:focus {
  border-color: #79C046;
  box-shadow: 0 0 0 2px rgba(121, 192, 70, 0.25);
}

/* Hover effect */
.delivery-select:hover {
  background: #e9e9e9;
}


/* =========================
   SUMMARY ROWS
========================= */
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 16px;
  color: var(--gray-text);
}

.summary-row span:last-child {
  font-weight: 700;
  color: var(--black);
}

.discount-row span:last-child {
  color: var(--accent-red);
}

.summary-total {
  border-top: 1px solid #eee;
  padding-top: 20px;
  margin-top: 20px;
  font-size: 20px;
}

/* =========================
   PROMO CODE
========================= */
.promo-box {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}

.promo-input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 30px;
  border: none;
  background: #f0f0f0;
  outline: none;
}

.apply-btn {
  background: #053027;
  color: white;
  padding: 0 25px;
  border-radius: 30px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* =========================
   CHECKOUT BUTTON
========================= */
.checkout-btn {
  width: 100%;
  background: #053027;
  color: white;
  padding: 18px;
  border-radius: 40px;
  border: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.checkout-btn:hover {
  opacity: 0.85;
}

.continue-shopping {
  margin: 40px 0;
  text-align: center;
}

.continue-shopping a {
  text-decoration: none;
  font-weight: 600;
  color: #053027;
}

.continue-shopping a:hover {
  text-decoration: underline;
}


.trash-btn {
  color: #ff3333;
  cursor: pointer;
  font-size: 18px;
}

.trash-btn:hover {
  opacity: 0.7;
}


/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}

/* =========================
   MOBILE: COMPACT CART ITEMS
========================= */
@media (max-width: 768px) {

  /* Remove white card feel */
  .cart-items {
    background: transparent !important;
    padding: 0 !important;
  }

  /* Each cart item becomes compact */
  .item {
    display: grid !important;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    padding: 16px 0 !important;
    border-bottom: 1px solid #eee;
  }

  /* Image smaller & clean */
  .product-img {
    width: 110px !important;
    height: 110px !important;
    margin: 0 !important;
  }

  /* Item details compact */
  .item-details {
    gap: 6px;
  }

  /* Move price next to image */
  .item-price {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700;
    white-space: nowrap;
  }

  /* Footer no longer stacks vertically */
  .item-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100%;
  }

  /* Quantity controls smaller */
  @media (max-width: 768px) {

  .quantity-controls {
    background: #e9f5e1 !important;   /* soft brand green */
    border-radius: 20px;
    padding: 4px 10px !important;
    gap: 10px !important;
  }

  .qty-btn {
    background: #ffffff;
    width: 26px;
    height: 26px;
    font-size: 14px;
    border-radius: 50%;
  }

}

}


/* =========================
   FORCE MOBILE FIXES
========================= */

@media (max-width: 768px) {

  /* Stop horizontal overflow completely */
  html, body {
    width: 100%;
    overflow-x: hidden !important;
  }

  /* Override Bootstrap container */
  main.main .container {
    max-width: 100% !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
  }

  /* Force cart layout to single column */
  .cart-layout {
    display: block !important;
    width: 100% !important;
  }

  /* Ensure cart + summary fit screen */
  .cart-items,
  .order-summary {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Stack cart items vertically */
  .item {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Fix image overflow */
  .product-img {
    width: 100% !important;
    max-width: 160px !important;
    margin-right: 0 !important;
    margin-bottom: 12px !important;
  }

  /* Fix footer spacing */
   .item-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100%;
  }
  /* Quantity controls stay inside screen */
  .quantity-controls {
    margin-left: 0 !important;
  }

  /* Delivery dropdown MUST shrink */
  .delivery-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

}

/* =========================
   MOBILE: REMOVE BORDERS & COMPRESSION
========================= */
@media (max-width: 768px) {

  /* Remove card borders on mobile */
  .cart-items,
  .order-summary {
    border: none !important;
    border-radius: 0 !important;
    padding: 16px !important;
  }

  /* Reduce inner item padding */
  .item {
    padding: 16px 0 !important;
  }

  /* Make empty space feel natural */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* =========================
   MOBILE: FIX PROMO APPLY BUTTON CUT-OFF
========================= */
@media (max-width: 768px) {

  .promo-box {
    flex-direction: column !important;
    gap: 10px;
  }

  .promo-input {
    width: 100% !important;
  }

  .apply-btn {
    width: 100% !important;
    padding: 14px !important;
  }

  .delivery-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    padding: 10px 36px 10px 14px !important; /* extra space for arrow */
    font-size: 14px;

    white-space: nowrap;      /* native select behavior */
    overflow: hidden;
    text-overflow: ellipsis;  /* prevents ugly clipping */
  }
}

