/* cart.css — Mobile-Optimized, Clean Layout, No Horizontal Scrolling */

/* === BASE STYLES === */
body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  color: #eee;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 1rem;
  margin: 0 auto;
}

/* === HEADER === */
header {
  background: #252525;
  padding: 3.5rem 1rem 1.5rem; /* increased top padding */
  text-align: center;
  border-bottom: 2px solid #333;
  position: relative;
}

header h1 {
  font-family: 'Anton', sans-serif;
  font-size: 2.2rem;
  color: #ff3b3b;
  margin: 0 0 1rem;
}

.about-link {
  font-weight: bold;
  color: #ff3b3b;
  text-decoration: none;
}

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

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: .5rem 1rem;
  border: 1px solid #555;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* === SHIPPING BANNER === */
.shipping-banner {
  background: #ff3b3b;
  color: #1e1e1e;
  padding: 0.8rem 1rem;
  text-align: center;
  font-weight: bold;
  border-radius: 0.4rem;
  margin: 1rem 0 2rem;
}

/* === CART === */
.cart {
  background: #2e2e2e;
  padding: 1.5rem;
  border-radius: .75rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === CART TABLE (Desktop View) === */
.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #444;
}

.cart-table th {
  background: #252525;
  color: #ff3b3b;
  font-family: 'Anton', sans-serif;
}

.cart-product {
  display: flex;
  align-items: center;
  text-align: left;
}

.cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: .5rem;
  margin-right: .75rem;
}

.cart-desc {
  font-size: 0.85rem;
  color: #aaa;
}

/* === CART SUMMARY === */
.cart-summary {
  text-align: center;
}

.cart-summary p {
  margin: .5rem 0;
  color: #ccc;
}

.cart-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.checkout-btn,
.clear-btn {
  padding: .75rem 1.5rem;
  font-weight: bold;
  border: none;
  border-radius: .3rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.checkout-btn {
  background: #28a745;
  color: #fff;
}

.checkout-btn:hover {
  background: #34c759;
}

.clear-btn {
  background: #ff3b3b;
  color: #fff;
}

.clear-btn:hover {
  background: #ff5c5c;
}

/* === EMPTY CART === */
.empty-cart-message {
  text-align: center;
  color: #ccc;
  margin: 2rem 0;
}

.empty-cart-message a {
  color: #ff3b3b;
  font-weight: bold;
}

/* === INPUTS & BUTTONS === */
.qty-input {
  width: 60px;
  padding: .5rem;
  border-radius: .25rem;
  border: 1px solid #555;
  background: #1e1e1e;
  color: #eee;
}

.remove-btn {
  background: #ff3b3b;
  color: #fff;
  padding: .5rem 1rem;
  border: none;
  border-radius: .25rem;
  cursor: pointer;
  transition: background .3s;
}

.remove-btn:hover {
  background: #ff5c5c;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 2px solid #333;
  color: #888;
  margin-top: auto;
}

/* === LIGHT MODE === */
body.light-mode {
  background: #f9f9f9;
  color: #222;
}

body.light-mode header {
  background: #fff;
  border-bottom-color: #ddd;
}

body.light-mode h1 {
  color: #d62828;
}

body.light-mode .about-link {
  color: #d62828;
}

body.light-mode .shipping-banner {
  background: #ffe5e5;
  color: #444;
}

body.light-mode .cart {
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body.light-mode .cart-table th {
  background: #fff;
  color: #d62828;
}

body.light-mode .cart-summary p {
  color: #444;
}

body.light-mode .checkout-btn {
  background: #28a745;
}

body.light-mode .checkout-btn:hover {
  background: #34c759;
}

body.light-mode .clear-btn,
body.light-mode .remove-btn {
  background: #d62828;
}

body.light-mode .clear-btn:hover,
body.light-mode .remove-btn:hover {
  background: #e04848;
}

body.light-mode .qty-input {
  background: #fff;
  color: #222;
  border-color: #ccc;
}

body.light-mode .empty-cart-message {
  color: #666;
}

body.light-mode footer {
  border-top-color: #ccc;
  color: #888;
}

body.light-mode .theme-toggle {
  border-color: #bbb;
}

/* === RESPONSIVE STYLES === */

/* Collapse table into product cards on mobile */
@media (max-width: 768px) {
  .cart-table,
  .cart-table thead {
    display: none;
  }

  #cart-items tr {
    display: block;
    background: #3a3a3a;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  #cart-items td {
    display: flex;
    justify-content: space-between;
    padding: .4rem 0;
    border-bottom: none;
  }

  #cart-items td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #ff3b3b;
    margin-right: 1rem;
  }

  .cart-summary p {
    font-size: 1rem;
  }

  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .checkout-btn,
  .clear-btn {
    width: 100%;
  }
}

/* Minor adjustments for ultra-small screens */
@media (max-width: 500px) {
  header h1 {
    font-size: 1.7rem;
  }

  .shipping-banner {
    font-size: 0.85rem;
  }
}



/* === ENHANCED VISIBILITY FOR LIGHT MODE PRODUCT TITLE & PRICE === */
body.light-mode .cart-product {
  color: #222; /* Darker for better readability */
}

body.light-mode .cart-desc {
  color: #666; /* Slightly lighter for subtext */
}

body.light-mode .cart-table td {
  color: #333; /* Improve visibility of prices and other cells */
}

body.light-mode .cart-table th {
  color: #d62828; /* Keep header distinct */
}


/* === LIGHT MODE MOBILE RESPONSIVE FIXES === */
@media (max-width: 768px) {
  body.light-mode #cart-items tr {
    background: #f0f0f0; /* Light card background */
    border: 1px solid #ddd;
  }

  body.light-mode #cart-items td {
    color: #333; /* Darker text for readability */
  }

  body.light-mode #cart-items td::before {
    color: #d62828; /* Accent for labels */
  }
}

body, .container, .cart {
  margin: 0 auto;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}



