/* Base Styles */
:root {
  --primary: #4caf50;
  --secondary: #8bc34a;
  --dark-green: #1e5631;
  --light: #f1f8e9;
  --text: #333;
  --text-light: #777;
  --white: #fff;
  --gray: #f5f5f5;
  --border: #e0e0e0;
  --error: #e74c3c;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Open Sans", sans-serif;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  background-color: var(--gray);
}

/* Header */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 2.5%;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Header Icons */
.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-right: auto;
  padding-left: 20px;
}

.header-icons a {
  color: #4a2c2a;
  font-size: 1.5rem;
  transition: all 0.3s;
  position: relative;
}

.header-icons a:hover {
  color: #4caf50;
  transform: translateY(-2px);
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -12px;
  background: #4caf50;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Adjust header layout */
header {
  display: flex;
  align-items: center;
  padding: 15px 5%;
}

.logo {
  margin: 0 auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .header-icons {
    gap: 15px;
    padding-left: 10px;
  }
  .header-icons a {
    font-size: 1rem;
  }
}

.logo img {
  height: 120px;
}

/* Centered Navigation */
nav {
  flex: 1;
  max-width: 800px;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav a {
  text-decoration: none;
  justify-content: center;
  color: var(--text);
  font-weight: 500;
  font-size: 25px;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--primary);
}
/* Main Cart Container */
.cart-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.cart-container h1 {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  color: var(--dark-green);
  margin-bottom: 1.5rem;
  text-align: center;
}

.cart-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* Cart Items Section */
.cart-items {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

#item-count {
  color: var(--text-light);
  font-size: 0.9rem;
}

.empty-cart {
  text-align: center;
  padding: 3rem 0;
}

.empty-cart i {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.empty-cart p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Cart Item Styles */
.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.cart-item-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cart-item-category {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.cart-item-price {
  font-weight: 600;
  color: var(--dark-green);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.quantity-btn {
  background: var(--gray);
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  width: 30px;
}

.quantity-input {
  width: 40px;
  text-align: center;
  border: none;
  padding: 0.5rem;
  font-size: 1rem;
}

/* Remove number input spinners */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.quantity-input[type="number"] {
  -moz-appearance: textfield;
}

.remove-item {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  margin-left: 1rem;
}

.remove-item:hover {
  color: var(--error);
}

/* Cart Summary Section */
.cart-summary {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  position: sticky;
  top: 1rem;
}

.cart-summary h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.summary-details {
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.summary-row.total {
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.delivery-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.delivery-info h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: var(--dark-green);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--light);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Checkout Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

/* Confirmation Modal */
.confirmation {
  text-align: center;
  padding: 3rem 2rem;
}

.confirmation-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.confirmation h2 {
  margin-bottom: 1rem;
}

.confirmation p {
  margin-bottom: 1.5rem;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
  .cart-content {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
  }

  .cart-item-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .form-actions {
    flex-direction: column;
  }

  .confirmation-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Location Modal */
#location-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.location-modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
}

.close-location-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

/* Type selection in cart */
.type-selection {
  margin-top: 10px;
  display: flex;
  gap: 15px;
}

.type-selection label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.type-selection input[type="radio"] {
  margin: 0;
}

/* NEW CSS TO BE DELETED IF DOESNT WORK */

/* Address and Payment Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

/* Address Form */
.address-form .form-group {
  margin-bottom: 15px;
}

.address-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.address-form input,
.address-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.payment-method {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.payment-method:hover {
  border-color: #4caf50;
}

.payment-method.selected {
  border-color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
}

.payment-method i {
  margin-right: 10px;
  font-size: 20px;
}

/* Order Summary in Payment Modal */
.order-summary {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
}

.order-summary p {
  margin: 5px 0;
}

/* Confirmation Modal */
.confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.confirmation-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  text-align: center;
}

/* Type selection in cart */
.type-selection {
  margin-top: 10px;
  display: flex;
  gap: 15px;
}

.type-selection label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.type-selection input[type="radio"] {
  margin: 0;
}

/* PAYMENT MODAL CSS */

/* Card Modal Styles */
#card-modal .modal-content {
  max-width: 500px;
}

.card-form {
  margin-top: 20px;
}

.card-icons {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  color: #555;
}

.card-icons i {
  margin: 0 10px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

#card-number {
  letter-spacing: 1.5px;
}

#submit-card {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
}

/* Pickup Option Styles */
.delivery-option {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--gray);
  border-radius: 4px;
}

.delivery-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

.delivery-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
