/* =========================================
   CHECKOUT PAGE STYLES
   ========================================= */

body {
  background-color: #f4f4f4;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 900;
}
.checkout-header h3 {
  font-size: 1.1rem;
}
.checkout-header .back-arrow,
.checkout-header .home-icon {
  font-size: 1.3rem;
  color: #333;
}

.checkout-container {
  padding: 10px;
  display: flex;
  flex-direction: column; /* Mobile par upar-neeche */
  gap: 15px;
}

.checkout-section {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 15px;
}
.checkout-section h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

/* Form Styles */
.shipping-form .form-group {
  margin-bottom: 15px;
}
.shipping-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: #555;
}
.shipping-form input,
.shipping-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.form-group-row {
  display: flex;
  gap: 10px;
}
.form-group-row .form-group {
  flex: 1;
}

/* Payment Options */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.payment-method {
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  cursor: pointer;
}

/* Jab radio button select ho */
.payment-method input[type="radio"]:checked + .payment-details {
  /* Yeh CSS abhi kaam nahi karega, humein alag se karna hoga */
}
/* Selected state highlight */
.payment-method:has(input[type="radio"]:checked) {
  border-color: #d3a14b;
  background-color: #fcf8f3;
}
.payment-method input[type="radio"] {
  margin-top: 5px;
}
.payment-details strong {
  font-size: 1rem;
  color: #333;
}
.payment-details p {
  font-size: 0.85rem;
  color: #777;
  margin: 4px 0 0 0;
}
.payment-icons {
  margin-top: 10px;
}
.payment-icons img {
  height: 25px;
  width: 25px;
}

/* Order Summary */
.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.summary-item img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 1px solid #eee;
  object-fit: cover;
}
.summary-item-details { flex-grow: 1; }
.summary-item-details .item-brand { font-size: 0.8rem; color: #888; }
.summary-item-details .item-name { font-size: 0.9rem; font-weight: 500; }
.summary-item .item-price { font-weight: 500; }

.summary-total {
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
  margin-top: 10px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #555;
}
.total-row.final-total span {
  font-size: 1.1rem;
  font-weight: bold;
  color: #000;
}
.btn-place-order {
  display: block;
  width: 100%;
  padding: 15px;
  background-color: #28a745;
  color: white;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: bold;
  /* margin-top: 20px; */ /* Is line ko hata do ya comment out kar do */
}

/* --- QR CODE MODAL STYLES --- */

/* The Modal (background) */
.qr-modal {
  display: none; /* Hidden by default */
  position: fixed; 
  z-index: 9999; /* Sit on top */
  padding-top: 100px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgb(0,0,0); 
  background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

/* Modal Content (The Image) */
.qr-modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 500px; /* Zyada bada na ho */
  border-radius: 10px;
  animation-name: zoom;
  animation-duration: 0.3s;
}

/* Caption of Modal Image */
#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

/* Add Animation */
@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

/* The Close Button */
.close-qr {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close-qr:hover,
.close-qr:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Desktop Responsive */
@media (min-width: 768px) {
  .checkout-container {
    flex-direction: row; /* Side-by-side */
    max-width: 1100px;
    margin: 20px auto;
    align-items: flex-start;
  }
  .checkout-form-column {
    flex: 2; /* 2/3 hissa lega */
  }
  .checkout-summary-column {
    flex: 1; /* 1/3 hissa lega */
    position: sticky; /* Scroll ke saath chipka rahega */
    top: 90px;
  }
}