/* --- Brand Variables --- */
:root {
  --primary-color: #d4a373; 
  --primary-hover: #bc8f63;
  --text-dark: #222222;
  --text-light: #777777;
  --light-bg: #f9f9f9;
  --border-color: #eaeaea;
  --danger: #d32f2f;
  --radius: 6px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --transition: all 0.25s ease-in-out;
}

.cart-section {
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  background-color: #ffffff;
}

/* --- Centered Header --- */
.cart-header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cart-header h1 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.cart-header p {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Optional elegant underline for the title */
.cart-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  margin-top: 1rem;
  border-radius: 6px;
}

/* --- Layout --- */
.cart-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: start;
}

/* --- Professional Cart List (Grid Setup) --- */
.cart-items-container {
  display: flex;
  flex-direction: column;
}

.cart-labels {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 40px;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-labels div:nth-child(n+2) {
  text-align: center;
}
.cart-labels div:last-child {
  text-align: right;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Item Grid */
.cart-item {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 40px;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

/* Product Info Column */
.item-product-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.item-image {
  width: 90px;
  height: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--light-bg);
  flex-shrink: 0;
}

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

.item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-details h3 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.item-details h3 a {
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition);
}

.item-details h3 a:hover {
  color: var(--primary-color);
}

.item-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

.item-variant {
  color: var(--primary-color);
  font-weight: 500;
  margin-top: 0.2rem;
  display: inline-block;
}

/* Center-aligned columns */
.item-price-col,
.item-quantity-col,
.item-total-col {
  text-align: center;
}

.item-price-col {
  font-size: 1rem;
  color: var(--text-dark);
}

.item-total-col {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Professional Input */
.item-quantity-col input {
  width: 70px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-dark);
  background: #ffffff;
  transition: var(--transition);
  margin: 0 auto;
  display: block;
}

.item-quantity-col input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.15);
}

/* Sleek Trash Button */
.btn-remove {
  background: transparent;
  color: #c4c4c4;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-remove:hover {
  background: rgba(211, 47, 47, 0.08);
  color: var(--danger);
}

/* --- Cart Summary Sidebar --- */
.cart-summary {
  background: var(--light-bg);
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  position: sticky;
  top: 2rem;
}

.cart-summary h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  font-weight: 600;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-light);
}

.summary-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-dark);
}

/* Buttons */
.cart-summary .btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1.1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  margin-bottom: 1rem;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(212, 163, 115, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 163, 115, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--text-dark);
  background-color: #ffffff;
}

/* --- Empty Cart State --- */
.empty-cart {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--light-bg);
  border-radius: var(--radius);
  border: 1px dashed var(--border-color);
}

.empty-cart-icon {
  font-size: 3.5rem;
  color: #dddddd;
  margin-bottom: 1.5rem;
}

.empty-cart h2 {
  font-size: 1.8rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-cart p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.empty-cart .btn {
  display: inline-block;
  padding: 1rem 3rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  width: auto;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .cart-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .cart-section {
    padding: 2rem 1rem;
  }
  .cart-header h1 {
    font-size: 2rem;
  }
  .cart-labels {
    display: none; /* Hide column headers on mobile */
  }
  .cart-item {
    grid-template-columns: 1fr; /* Stack everything */
    position: relative;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
  }
  .item-product-info {
    padding-right: 2rem; /* Space for absolute trash btn */
  }
  .item-price-col {
    display: none; /* Hide single unit price to save space */
  }
  .item-quantity-col, 
  .item-total-col {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .item-quantity-col::before {
    content: "Quantity:";
    color: var(--text-light);
    font-size: 0.9rem;
  }
  .item-total-col::before {
    content: "Total:";
    color: var(--text-light);
    font-size: 0.9rem;
  }
  .item-quantity-col input {
    margin: 0;
  }
  .btn-remove {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  .cart-summary {
    padding: 1.5rem;
  }
}