/* Cart page and modal */

.cart-section { max-width: 1000px; margin: 60px auto; padding: 0 20px; }
.cart-section h2 { text-align: center; margin-bottom: 40px; font-size: 2rem; }
.empty-cart { font-family: "Satoshi", sans-serif;text-align: center; padding: 40px; font-size: 1.2rem; }
.empty-cart a { font-family: "Satoshi", sans-serif;color: #d4af37; text-decoration: none; }

.cart-container { background-color: white; padding: 30px; border: 1px solid #e0dcd5; font-family: "Satoshi", sans-serif; }
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}
.cart-table thead {
  background-color: #f7f5ed;
}
.cart-table th,
.cart-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e0dcd5;
}

/* Mobile: convert table to card layout */
@media (max-width: 768px) {
  .cart-table {
    display: block;
    border: none;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tbody {
    display: block;
  }

  .cart-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #e0dcd5;
    border-radius: 4px;
    background-color: #f7f5ed;
    margin-bottom: 15px;
    overflow: hidden;
  }

  .cart-table td {
    padding: 12px;
    border: none;
    border-right: 1px solid #e0dcd5;
    border-bottom: 1px solid #e0dcd5;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .cart-table td:nth-child(2n) {
    border-right: none;
  }

  .cart-table td:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .cart-table td:first-child {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid #e0dcd5;
    font-weight: bold;
    text-align: center;
    padding: 15px;
  }

  .cart-table td:nth-child(5) {
    grid-column: 1 / -1;
    border-bottom: none;
    padding: 10px;
    text-align: center;
  }

  /* Label rows before values */
  .cart-table td.cart-qty-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
  }
}

.quantity-input { width: 60px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.btn-remove { font-family: "Satoshi", sans-serif; background-color: #e74c3c; color: white; border: none; padding: 8px 15px; cursor: pointer; }
.btn-remove:hover { background-color: #c0392b; }

.cart-summary { background-color: #f7f5ed; padding: 20px; margin-bottom: 30px;  }
.summary-item { display: flex; justify-content: space-between; margin: 10px 0; font-size: 1.1rem; }
.summary-item.total { font-weight: bold; font-size: 1.3rem; border-top: 2px solid #d4af37; padding-top: 10px; }

.cart-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.btn-continue,
.btn-checkout {
font-family:"Satoshi", sans-serif;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.3s ease;
}
.btn-continue {
  background-color: #f7f5ed;
  color: #1a1a1a;
  text-decoration: none;
  display: inline-block;
  border: 2px solid #1a1a1a;
  min-width: 200px;
  text-align: center;
}
.btn-continue:hover {
  background-color: #1a1a1a;
  color: white;
}
.btn-checkout {
  background-color: #1a1a1a;
  color: white;
  min-width: 200px;
}
.btn-checkout:hover {
  background-color: #d4af37;
  color: black;
}

/* Modal */
.modal { display: flex; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.modal-content { background-color: white; padding: 40px; border-radius: 8px; text-align: center; max-width: 400px; }
.loader { border: 4px solid #f7f5ed; border-top: 4px solid #d4af37; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Cart table quantity controls */
.cart-qty-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.quantity-controls-cart {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
}

.quantity-controls-cart .qty-value {
  display: inline-block;
  min-width: 28px;
  width: 28px;
  text-align: center;
  font-family: "Satoshi", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.quantity-controls-cart button.qty-minus,
.quantity-controls-cart button.qty-plus {
  width: 32px !important;
  height: 32px !important;
  border: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  padding: 0;
}

.quantity-controls-cart button.qty-minus:hover,
.quantity-controls-cart button.qty-plus:hover {
  background: #d4af37;
  color: #1a1a1a;
}

@media (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
  
  .cart-actions {
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;
  }
  .btn-continue,
  .btn-checkout {
    width: 100%;
    padding: 14px 20px;
    min-width: unset;
  }
  
  .cart-table { font-size: 0.9rem; }
  .cart-table th, .cart-table td { padding: 10px; }
  
  .btn-remove {
    padding: 6px 12px;
    font-size: 0.9rem;
    width: 100%;
  }
}