/* Basket Page Styles */
.basket-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 70vh;
}

.basket-header {
  margin-bottom: 40px;
}

.basket-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #000;
  margin: 0;
}

/* Empty Cart State */
.empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.empty-cart p {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
}

/* Basket Content */
.basket-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  align-items: start;
}

/* Basket Table */
.basket-table {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.basket-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  background: #f8f8f8;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
  color: #333;
}

.basket-items {
  /* Items will be added dynamically */
}

.basket-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  gap: 20px;
}

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

/* Product Column */
.basket-item-product {
  display: flex;
  align-items: center;
  gap: 15px;
}

.basket-item-remove {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  margin-right: 10px;
}

.basket-item-remove:hover {
  color: #c82333;
}

.basket-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.basket-item-details h3 {
  margin: 0;
  font-size: 1rem;
  color: #dc3545;
  font-weight: 500;
}

/* Price Column */
.basket-item-price {
  font-weight: 500;
  color: #333;
}

/* Quantity Column */
.basket-item-quantity {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-input {
  width: 60px;
  padding: 8px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

/* Subtotal Column */
.basket-item-subtotal {
  font-weight: 600;
  color: #333;
}

/* Coupon Section */
.coupon-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8f8f8;
  border-top: 1px solid #ddd;
}

.coupon-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coupon-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  width: 150px;
}

.coupon-label {
  font-weight: 500;
  color: #333;
}

.apply-coupon-btn {
  background: #333;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.apply-coupon-btn:hover {
  background: #555;
}

.update-basket-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.update-basket-btn:hover {
  background: #5a6268;
}

/* Continue Shopping Section */
.continue-shopping-section {
  margin: 20px 0;
}

.continue-shopping-btn {
  background: #333;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

.continue-shopping-btn:hover {
  background: #555;
  color: white;
}

/* Basket Totals */
.basket-totals {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 30px;
  background: white;
  height: fit-content;
}

.basket-totals h2 {
  margin: 0 0 20px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  font-size: 1rem;
}

.totals-row span:first-child {
  font-weight: 500;
  color: #333;
}

.shipping-row {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.shipping-row > span:first-child {
  align-self: flex-start;
}

.shipping-options {
  width: 100%;
}

.shipping-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

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

.shipping-text {
  font-size: 0.95rem;
  color: #333;
}

.shipping-note {
  font-size: 0.85rem;
  color: #666;
  margin: 10px 0 5px 0;
  line-height: 1.4;
}

.calculate-shipping {
  color: #dc3545;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.calculate-shipping:hover {
  text-decoration: underline;
}

.total-row {
  border-top: 1px solid #ddd;
  padding-top: 15px;
  margin-top: 20px;
  font-weight: 600;
  font-size: 1.1rem;
}

.total-row small {
  font-weight: 400;
  font-size: 0.85rem;
  color: #666;
}

.proceed-checkout-btn {
  width: 100%;
  background: #dc3545;
  color: white;
  border: none;
  padding: 15px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 20px 0;
  border-radius: 4px;
}

.proceed-checkout-btn:hover {
  background: #c82333;
}

/* Payment Options */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.apple-pay-btn,
.google-pay-btn {
  background: #000;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.apple-pay-btn:hover,
.google-pay-btn:hover {
  background: #333;
}

/* Shipping Information */
.shipping-info {
  margin-top: 40px;
  max-width: 800px;
}

.shipping-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin: 30px 0 10px 0;
}

.shipping-info h3:first-child {
  margin-top: 0;
}

.shipping-info p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.red-link {
  color: #dc3545;
  text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .basket-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .basket-totals {
    order: -1;
  }
}

@media (max-width: 768px) {
  .basket-container {
    padding: 20px 15px;
  }

  .basket-header h1 {
    font-size: 2rem;
  }

  .basket-table-header,
  .basket-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .basket-table-header {
    display: none; /* Hide headers on mobile */
  }

  .basket-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
  }

  .basket-item-product {
    grid-column: 1;
    margin-bottom: 10px;
  }

  .basket-item-price::before {
    content: "Price: ";
    font-weight: 600;
  }

  .basket-item-quantity::before {
    content: "Quantity: ";
    font-weight: 600;
  }

  .basket-item-subtotal::before {
    content: "Subtotal: ";
    font-weight: 600;
  }

  .coupon-section {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .coupon-input-group {
    flex-wrap: wrap;
    gap: 10px;
  }

  .coupon-input {
    flex: 1;
    min-width: 120px;
  }

  .payment-options {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .basket-item-product {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .basket-item-image {
    width: 50px;
    height: 50px;
  }

  .quantity-input {
    width: 50px;
  }
}

/* Loading State */
.basket-loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.basket-loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Success/Error Messages */
.cart-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.cart-message.show {
  opacity: 1;
  transform: translateX(0);
}

.cart-message.success {
  background: #4caf50;
}

.cart-message.error {
  background: #f44336;
}
