/* Checkout Page Styles */
.checkout-container {
  min-height: 100vh;
  background: #fef8e4;
  font-family: 'Poppins', sans-serif;
}

/* Header Styles */
.checkout-header {
  background: white;
  padding: 20px 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-circle img{
  width: 50px;
  height: 50px;
  background: #6F4F37;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(49, 34, 23, 0.3);
}

.logo-text {
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.brand-name {
  color: #6F4F37;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.back-to-menu-btn {
  background: #6F4F37;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px;
  text-decoration: none;
  display: inline-block;
}

.back-to-menu-btn:hover {
  background: #8B5A3C;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
  color: white;
  text-decoration: none;
}

/* Main Content */
.checkout-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 40px;
}

.checkout-content > div{
  height: 100%;
}

/* Section Styles */
.left-section,
.middle-section {
  background: white;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

.right-section {
  background: white;
  border-radius: 20px;
  padding: 0;
  box-shadow: none;
  height: fit-content;
}

.section-title {
  color: #6F4F37;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.info-section {
  margin-bottom: 30px;
}

.info-section:last-child {
  margin-bottom: 0;
}

/* Info Fields */
.info-field {
  margin-bottom: 10px;
}

.info-field label {
  display: block;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-field input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: #f9f9f9;
  color: #666;
  box-sizing: border-box;
}

.info-field input:focus {
  outline: none;
  border-color: #6F4F37;
  background: white;
}

/* Payment Buttons */
.payment-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.payment-btn {
  background: #f5f5f5;
  color: #666;
  border: 2px solid #e0e0e0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 80px;
  position: relative;
  overflow: hidden;
}

.payment-btn:hover {
  background: #e8e8e8;
  border-color: #6F4F37;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(111, 79, 55, 0.1);
}

.payment-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(111, 79, 55, 0.2);
}

.payment-btn.active {
  background: #6F4F37;
  color: white;
  border-color: #6F4F37;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
}

.payment-btn.active:hover {
  background: #5a3f2a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(111, 79, 55, 0.4);
}

.payment-btn.active:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(111, 79, 55, 0.3);
}

.payment-btn:focus {
  outline: none;
  border-color: #6F4F37;
  box-shadow: 0 0 0 3px rgba(111, 79, 55, 0.2);
}

.payment-btn.active:focus {
  box-shadow: 0 0 0 3px rgba(111, 79, 55, 0.4), 0 4px 12px rgba(111, 79, 55, 0.3);
}

/* Payment Info */
.payment-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 15px;
  border-left: 4px solid #6F4F37;
}

.branch-info {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Pickup Date */
.pickup-label {
  display: block;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.date-input-container {
  position: relative;
  margin-bottom: 15px;
}

.date-input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
}

.calendar-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

.time-select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  box-sizing: border-box;
}

.time-select:focus {
  outline: none;
  border-color: #6F4F37;
}

.time-note {
  margin-top: 5px;
  text-align: center;
}

.time-note small {
  color: #666;
  font-size: 12px;
  font-style: italic;
}

/* Total Section */
.total-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  margin-top: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.total-row:last-child {
  margin-bottom: 0;
}

.total-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.total-amount {
  background: #e1c191;
  color: #6F4F37;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
}

.final-total {
  border-top: 2px solid #e0e0e0;
  padding-top: 15px;
  margin-top: 10px;
}

.final-total .total-label {
  font-size: 18px;
  font-weight: 700;
}

.final-total .total-amount {
  background: #6F4F37;
  color: white;
  font-size: 20px;
}

/* Cart Section */
.cart-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-header {
  margin-bottom: 20px;
}

/* Pickup Section */
.pickup-section {
  margin-top: 20px;
}

.pickup-btn {
  background: #e0e0e0;
  color: #666;
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.pickup-btn:hover {
  background: #d0d0d0;
}

.cart-items {
  flex: 1;
  min-height: 100px;
}

.cart-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.item-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.item-details {
  font-size: 12px;
  color: #666;
}

/* Extra items in checkout invoice */
.checkout-item-extras {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #d0d0d0;
}

.checkout-extras-label {
  font-size: 11px;
  color: #6F4F37;
  font-weight: 600;
  font-style: italic;
  margin: 4px 0;
}

.checkout-extra-detail {
  font-size: 10px;
  color: #888;
  margin: 2px 0;
  padding-left: 8px;
}

.checkout-extra-request {
  font-size: 10px;
  color: #6F4F37;
  font-style: italic;
  margin: 4px 0 0 0;
  padding-left: 8px;
}


/* Toggle Switch Styles */
.toggle-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  width: 100%;
  max-width: 300px;
}

.toggle-label {
  font-size: 1rem;
  font-weight: 600;
  color: #6F4F37;
  margin: 0;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  display: inline-block;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
  background-color: #6F4F37;
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-slider:hover {
  box-shadow: 0 0 8px rgba(111, 79, 55, 0.3);
}

/* Invoice Total Section */
.invoice-total-section {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 20px 0;
  border-left: 4px solid #6F4F37;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.invoice-total-row:last-child {
  margin-bottom: 0;
}

.invoice-total-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.invoice-total-amount {
  font-size: 14px;
  font-weight: 600;
  color: #6F4F37;
}

.invoice-final-total {
  border-top: 2px solid #e0e0e0;
  padding-top: 10px;
  margin-top: 8px;
}

.invoice-final-total .invoice-total-label {
  font-size: 18px;
  font-weight: 700;
  color: #6F4F37;
}

.invoice-final-total .invoice-total-amount {
  font-size: 18px;
  font-weight: 700;
  color: #6F4F37;
}

.purchase-btn {
  background: #6F4F37;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.purchase-btn:hover {
  background: #8B5A3C;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
}

.purchase-btn.disabled,
.purchase-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.purchase-btn.disabled:hover,
.purchase-btn:disabled:hover {
  background: #ccc;
  transform: none;
  box-shadow: none;
}

/* Use Rewards Points Button */
.use-rewards-btn {
  background: #6F4F37;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
}

.use-rewards-btn:hover:not(:disabled) {
  background: #8B5A3C;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
}

.use-rewards-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.use-rewards-btn:disabled:hover {
  background: #ccc;
  transform: none;
  box-shadow: none;
}

/* Points Info Styles */
.points-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  border-left: 4px solid #6F4F37;
}

.points-details p {
  margin: 5px 0;
  font-size: 14px;
  color: #333;
}

.points-details p strong {
  color: #6F4F37;
}

/* Toggle Switch Responsive Styles */
@media (max-width: 768px) {
  .toggle-switch-container {
    padding: 12px 15px;
    max-width: 280px;
  }

  .toggle-label {
    font-size: 0.9rem;
  }

  .toggle-slider {
    width: 45px;
    height: 22px;
  }

  .toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
  }

  .toggle-input:checked + .toggle-slider:before {
    transform: translateX(23px);
  }
}

@media (max-width: 480px) {
  .toggle-switch-container {
    padding: 10px 12px;
    max-width: 250px;
  }

  .toggle-label {
    font-size: 0.85rem;
  }

  .toggle-slider {
    width: 40px;
    height: 20px;
  }

  .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }

  .toggle-input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .checkout-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 20px;
  }
  
  .header-content {
    padding: 0 20px;
    flex-direction: row;
  }
  
  .checkout-header {
    padding: 15px 0;
  }
}

@media (max-width: 768px) {
  .checkout-header {
    padding: 15px 20px;
    margin-bottom: 20px;
  }

  .header-content {
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }
  
  .logo-section {
    flex-direction: row;
    gap: 10px;
    align-items: center;
    flex: 1;
  }

  .logo-circle img {
    width: 40px;
    height: 40px;
  }
  
  .brand-name {
    font-size: 18px;
  }

  .back-to-menu-btn {
    padding: 8px 16px;
    font-size: 13px;
    margin: 0;
    width: auto;
    white-space: nowrap;
  }
  
  .left-section,
  .middle-section {
    padding: 20px;
  }
  
  .right-section {
    padding: 0;
  }
  
  .checkout-content {
    padding: 0 15px;
  }
  
  .payment-buttons {
    flex-direction: column;
  }
  
  .payment-btn {
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .checkout-header {
    padding: 10px 15px;
    margin-bottom: 15px;
  }

  .header-content {
    gap: 8px;
  }

  .logo-section {
    gap: 8px;
  }

  .logo-circle img {
    width: 35px;
    height: 35px;
  }

  .brand-name {
    font-size: 16px;
  }

  .back-to-menu-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 18px;
  }
  
  .section-title {
    font-size: 18px;
  }
  
  .left-section,
  .middle-section {
    padding: 15px;
  }
  
  .right-section {
    padding: 0;
  }
}

/* Payment Result Popup Styles */
.payment-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.payment-result-modal {
  background: white;
  border-radius: 20px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.payment-result-content {
  padding: 30px;
  text-align: center;
}

.payment-result-content.success {
  border-top: 4px solid #4CAF50;
}

.payment-result-content.error {
  border-top: 4px solid #f44336;
}

.payment-result-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.payment-result-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.payment-result-content.success .payment-result-title {
  color: #4CAF50;
}

.payment-result-content.error .payment-result-title {
  color: #f44336;
}

.payment-result-message {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.payment-result-redirect {
  font-size: 14px;
  color: #999;
  margin-bottom: 25px;
  font-style: italic;
}

.payment-result-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.payment-result-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.payment-result-btn.success {
  background: #4CAF50;
  color: white;
}

.payment-result-btn.success:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.payment-result-btn.retry {
  background: #6F4F37;
  color: white;
}

.payment-result-btn.retry:hover {
  background: #5a3d2a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
}