/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Montserrat:wght@300;400;600&display=swap');

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  padding: 60px 12px 16px; /* tighter vertical spacing */
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex: 1 0 auto;
  background: #000;
}

/* General cart container */
.cart-container {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 12px;
  background-color: #000;
  color: #fff;
}

/* "Your Cart" Title for Non-Empty Cart */
#cart-title-nonempty {
  font-family: 'Fjalla One', sans-serif;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-top: 0;
  margin-bottom: 16px;
  color: #fff;
}

/* Cart Header (Grid with 5 columns) */
.cart-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 60px;
  align-items: center;
  gap: 20px;
  padding: 10px;
  border-bottom: 2px solid #444;
  margin-bottom: 20px;
  font-size: 1rem;
  text-transform: uppercase;
  font-weight: bold;
}

.cart-header-name {
  padding-left: 10px;
  text-align: left;
}
.cart-header-price,
.cart-header-quantity,
.cart-header-total,
.cart-header-remove {
  text-align: center;
}

/* Cart Item (Grid with 5 columns) */
.cart-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 60px;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  border-bottom: 1px solid #444;
}

/* Column 1: Product (Image + Info) */
.cart-item-product {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-item-image {
  width: 80px;
  height: 100px;
  object-fit: cover;
}
.cart-item-info {
  display: flex;
  flex-direction: column;
}
.cart-item-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}
.cart-item-size {
  font-size: 1rem;
  color: #aaa;
}
.cart-item-each {
  display: none;
  font-size: 0.9rem;
  color: #aaa;
}

/* Column 2: Price */
.cart-item-price {
  font-family: 'Fjalla One', sans-serif;
  font-size: 1.2rem;
  text-align: center;
}

/* Column 3: Quantity */
.cart-item-quantity {
  text-align: center;
}
.cart-item-quantity input {
  height: 30px;
  width: 50px;
  font-family: 'Fjalla One', sans-serif;
  font-size: 1rem;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Column 4: Total */
.cart-item-total {
  font-family: 'Fjalla One', sans-serif;
  font-size: 1.2rem;
  text-align: center;
}

/* Column 5: Remove Button */
.remove-item {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  padding: 5px 8px;
  min-width: 60px;
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.3s ease-in-out;
  justify-self: center;
}
.remove-item:hover {
  background-color: #cc0000;
}

/* Subtotal styling */
.subtotal {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
  color: #fff;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.subtotal-label {
  margin-right: 0;
}
.discount-label {
  margin-right: 0;
}
.clear-discount {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

/* Note styling */
.note {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  text-align: right;
  color: #fff;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Newsletter / Extra Options */
.extra-checkout-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 20px;
  gap: 15px;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
}

.newsletter-label {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Discount Code Styling */
.discount-code-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 20px;
  margin-top: 10px;
}
.discount-code-container .discount-error {
  width: 100%;
  color: #ff6b6b;
  font-size: 0.9rem;
  text-align: right;
}
.discount-code-container input[type="text"] {
  padding: 6px 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 200px;
}
.discount-code-container button {
  padding: 6px 14px;
  font-size: 1rem;
  background-color: #fff;
  color: black;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Fjalla One', sans-serif;
  transition: background-color 0.3s ease;
}
.discount-code-container button:hover {
  background-color: #007bff;
  color: white;
}

/* Small screens */
@media (max-width: 520px) {
  .cart-container {
    padding: 12px;
  }

  .cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 60px;
    font-size: 0.9rem;
    gap: 8px;
    padding: 8px;
  }

  .cart-item {
    grid-template-columns: 2fr 1fr 60px;
    gap: 8px;
    padding: 12px;
  }

  .cart-item-price,
  .cart-item-quantity,
  .cart-item-total,
  .remove-item {
    text-align: left;
    justify-self: flex-start;
  }

  .cart-item-quantity input {
    width: 70px;
  }

  .discount-code-container {
    justify-content: flex-start;
  }

  .discount-code-container input[type="text"] {
    width: 100%;
  }

  .checkout-wrapper {
    justify-content: flex-start;
  }

  .subtotal {
    justify-content: flex-start;
  }
}

/* Hide total column on narrow screens */
@media (max-width: 600px) {
  .cart-header {
    grid-template-columns: 2fr 1fr 60px;
  }
  .cart-header-total,
  .cart-header-price {
    display: none;
  }
  .cart-item {
    grid-template-columns: 2fr 1fr 60px;
  }
  .cart-item-total,
  .cart-item-price {
    display: none;
  }
  .cart-item-each {
    display: block;
  }
}

/* Checkout Button Wrapper */
.checkout-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* Checkout Button */
.checkout {
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  font-family: 'Fjalla One', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.checkout:hover {
  background-color: #007bff;
  color: white;
}

/* Empty Cart Message */
.empty-cart-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: 12px;
}
.empty-cart-wrapper h2 {
  font-family: 'Fjalla One', sans-serif;
  font-size: 2rem;
}
.empty-cart-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 18px;
}
.empty-cart-message p {
  font-size: 20px;
  font-weight: 300;
  margin-bottom: 10px;
}

/* Back to Shop Button */
.continue-shopping {
  background-color: white;
  color: rgb(0, 0, 0);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-family: 'Fjalla One', sans-serif;
  font-size: 16px;
  border-radius: 5px;
}
.continue-shopping:hover {
  background-color: #0056b3;
}
