/**
 * @file
 * Quick Checkout Modal styles - Uses jQuery UI dialog via nm-modal.
 */

/* Loading is handled by base nm-modal system */

/* ==========================================================================
   JQUERY UI DIALOG OVERRIDES FOR QUICK CHECKOUT
   ========================================================================== */

/* Dialog container styling */
.ui-dialog.quick-checkout-dialog {
  /* Direction inherited from document based on current language */
}

/* Dialog content area */
.ui-dialog.quick-checkout-dialog .ui-dialog-content {
  padding: 0 !important;
  overflow: visible !important;
}

/* Content wrapper */
.quick-checkout-content {
  /* Direction inherited from document based on current language */
}

/* ==========================================================================
   DIALOG HEADER STYLING - Uses default nm-modal header
   ========================================================================== */

/* Hide jQuery UI's default close button icon/text */
.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close .ui-button-icon,
.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close .ui-icon {
  display: none !important;
}

/* Ensure close button X icon displays correctly */
.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close {
  overflow: visible !important;
}

.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close::before,
.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 18px !important;
  height: 2px !important;
  background: #666 !important;
  border-radius: 1px !important;
  margin-left: -9px !important;
  margin-top: -1px !important;
}

.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close::before {
  transform: rotate(45deg) !important;
}

.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close::after {
  transform: rotate(-45deg) !important;
}

.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close:hover::before,
.ui-dialog.quick-checkout-dialog .ui-dialog-titlebar-close:hover::after {
  background: #333 !important;
}

/* Two Column Layout */
.quick-checkout-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.quick-checkout-column {
  padding: 16px;
}

.quick-checkout-column--product {
  background: #f8f9fa;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.quick-checkout-column--address {
  background: #fff;
}

.qc-column-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--nm-primary-color, #667eea);
}

/* ==========================================================================
   PRODUCT & FORM STYLES
   ========================================================================== */

/* Product Info - With variation image */
.quick-checkout-product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

/* Product in column layout - no extra padding */
.quick-checkout-column--product .quick-checkout-product {
  padding: 0;
  background: transparent;
  border-bottom: none;
}

.quick-checkout-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-checkout-product-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Price Breakdown */
.quick-checkout-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* Price breakdown in column layout */
.quick-checkout-column--product .quick-checkout-price-breakdown {
  margin-top: auto;
}

.qc-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.qc-price-label {
  font-weight: 500;
}

.qc-subtotal-row .qc-subtotal {
  font-weight: 600;
  color: #333;
}

.qc-shipping-row {
  color: #888;
}

.qc-shipping-cost {
  font-weight: 500;
}

.qc-shipping-cost .free-shipping {
  color: #28a745;
  font-weight: 600;
}

.qc-shipping-cost s {
  color: #999;
  font-size: 11px;
  margin-right: 4px;
}

.qc-shipping-cost .shipping-discounted {
  color: #28a745;
  font-weight: 600;
}

.qc-shipping-cost .shipping-original {
  color: #999;
  font-size: 11px;
  margin-inline-start: 4px;
}

.qc-discount-row,
.qc-coupon-discount-row {
  color: #28a745;
}

.qc-discount {
  font-weight: 600;
}

/* Cart discount row (promotion discounts from cart) */
.qc-cart-discount-row {
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.08), rgba(27, 94, 32, 0.08));
  border-radius: 8px;
  padding: 8px 12px !important;
  margin: 4px 0 !important;
  border: 1px solid rgba(46, 125, 50, 0.2);
}

.qc-cart-discount-row .qc-price-label {
  color: #2e7d32;
  font-weight: 600;
}

.qc-cart-discount-row .qc-cart-discount {
  color: #1b5e20;
  font-weight: 700;
}

.qc-total-row {
  border-top: 2px solid #f0f0f0;
  padding-top: 10px;
  margin-top: 8px;
  font-size: 16px;
}

.qc-total-row .qc-price-label {
  font-weight: 700;
  color: #1a1a2e;
}

.qc-total {
  font-size: 20px;
  font-weight: 700;

}

/* Variation Image */
.quick-checkout-product-image {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-checkout-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Attribute Selection (Color & Size) */
.quick-checkout-attributes {
  padding: 12px 0;
  background: transparent;
  border-bottom: none;
  margin-bottom: 12px;
}

/* Attributes in column - no extra padding */
.quick-checkout-column--product .quick-checkout-attributes {
  padding: 12px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.quick-checkout-attribute-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.quick-checkout-attribute-row:last-child {
  margin-bottom: 0;
}

.quick-checkout-attribute-row > label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  min-width: 45px;
}

/* Color Buttons */
.quick-checkout-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Color Swatches */
.qc-color-btn.qc-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 0 0 1px #ddd, 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.qc-color-btn.qc-color-swatch .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.qc-color-btn.qc-color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #667eea, 0 4px 8px rgba(0,0,0,0.15);
}

.qc-color-btn.qc-color-swatch.selected {
  box-shadow: 0 0 0 3px #667eea, 0 4px 8px rgba(102, 126, 234, 0.3);
  transform: scale(1.1);
}

/* Fallback for colors without hex - text button */
.qc-color-btn:not(.qc-color-swatch) {
  width: auto;
  min-width: 28px;
  height: 28px;
  border-radius: 14px;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 10px;
  font-size: 11px;
  background: #f5f5f5;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qc-color-btn:not(.qc-color-swatch):hover {
  border-color: #667eea;
}

.qc-color-btn:not(.qc-color-swatch).selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

/* Size Buttons */
.quick-checkout-sizes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qc-size-btn {
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
}

.qc-size-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.qc-size-btn.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
}

/* Unavailable size buttons - hidden by default */
.qc-size-btn.qc-size-unavailable {
  display: none !important;
}

/* Low Stock Warning - hidden by default */
.qc-stock-warning {
  display: none !important;
  margin-top: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  border: 1px solid #ffc107;
  border-radius: 8px;
  font-size: 12px;
  color: #856404;
  text-align: center;
}

/* Only show when explicitly set to block */
.qc-stock-warning[style*="display: block"],
.qc-stock-warning[style*="display:block"] {
  display: block !important;
  animation: pulse-warning 2s infinite;
}

.qc-stock-warning .qc-stock-icon {
  margin-left: 4px;
}

.qc-stock-warning strong {
  color: #d63384;
  font-weight: 700;
}

/* Out of stock style */
.qc-stock-warning.out-of-stock {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #dc3545;
  color: #721c24;
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Max Stock Message - shown when quantity reaches max available */
.qc-max-stock-message {
  display: none;
  font-size: 11px;
  color: #dc3545;
  margin-top: 4px;
  text-align: center;
}

/* ==========================================================================
   ERROR MODAL - Uses nm-modal base styling
   ========================================================================== */

/* Error modal header - red gradient */
#qc-error-modal .nm-modal-header {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

#qc-error-modal .nm-modal-title {
  color: #fff !important;
}

/* Error modal close button - white on red */
#qc-error-modal .nm-modal-close::before,
#qc-error-modal .nm-modal-close::after {
  background: #fff !important;
}

#qc-error-modal .nm-modal-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Error modal content */
.qc-error-modal-message {
  text-align: center;
  padding: 10px 0;
}

.qc-error-modal-message .qc-error-icon {
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
}

.qc-error-modal-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* Quantity Input */
.quick-checkout-quantity-row {
  margin-top: 8px;
}

.quick-checkout-quantity {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  overflow: hidden;
  width: fit-content;
}

.qc-qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qc-qty-btn:hover {
  background: #667eea;
  color: #fff;
}

.qc-qty-btn:active {
  transform: scale(0.95);
}

.qc-qty-input {
  width: 50px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  background: #fff;
  -moz-appearance: textfield;
}

.qc-qty-input::-webkit-outer-spin-button,
.qc-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qc-qty-input:focus {
  outline: none;
}

/* Coupon/Promotion Code - Separate Section */
.quick-checkout-coupon-section {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* Coupon in column layout */
.quick-checkout-column--product .quick-checkout-coupon-section {
  border: 1px dashed rgba(102, 126, 234, 0.3);
}

.qc-coupon-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  margin: 0;
}

.qc-coupon-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
  cursor: pointer;
}

.qc-coupon-icon {
  font-size: 16px;
}

.qc-coupon-checkbox-label span:last-child {
  font-weight: 600;
  color: #667eea;
}

.quick-checkout-coupon-content {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(102, 126, 234, 0.15);
}

.quick-checkout-coupon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qc-coupon-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 18px;
  font-size: 13px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.qc-coupon-input:focus {
  outline: none;
  border-color: #667eea;
}

.qc-coupon-input::placeholder {
  color: #999;
}

.qc-apply-coupon-btn {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.qc-apply-coupon-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.qc-apply-coupon-btn:active {
  transform: scale(0.98);
}

.qc-apply-coupon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.qc-coupon-message {
  margin-top: 6px;
  font-size: 12px;
  min-height: 16px;
}

.qc-coupon-message.success {
  color: #28a745;
}

.qc-coupon-message.error {
  color: #dc3545;
}

.qc-coupon-message .discount-amount {
  font-weight: 600;
}

/* Applied coupon badge */
.qc-coupon-applied {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.3);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  color: #28a745;
}

.qc-coupon-applied .remove-coupon {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* Form - Compact */
.quick-checkout-form {
  padding: 0;
}

/* Form in column layout */
.quick-checkout-column--address .quick-checkout-form {
  padding: 0;
}

/* Form Grid - 2 columns */
.quick-checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-checkout-form-row {
  margin-bottom: 8px;
}

.quick-checkout-form-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a2e;
}

.quick-checkout-form-row label .optional {
  font-weight: 400;
  color: #aaa;
  font-size: 10px;
}

.quick-checkout-form-row input,
.quick-checkout-form-row select {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  color: #333;
}

.quick-checkout-form-row select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 32px;
  cursor: pointer;
}

.quick-checkout-form-row select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.quick-checkout-form-row select option {
  padding: 8px;
}

/* Location grid - region and city in one row */
.quick-checkout-location-grid {
  display: inline-flex;
  gap: 8px;
}

/* Phone grid - phone number on left, country code on right */
.quick-checkout-phone-grid {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
}

.qc-phone-code-select {
  text-align: center;
  font-weight: 600;
  padding-left: 8px !important;
  padding-right: 28px !important;
}

.qc-phone-input {
  flex: 1;
}

.quick-checkout-form-row input:focus,
.quick-checkout-form-row select:focus,
.quick-checkout-form-row textarea:focus {
  outline: none;
  border-color: var(--nm-primary-color, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.quick-checkout-form-row input.quick-checkout-error,
.quick-checkout-form-row select.quick-checkout-error,
.quick-checkout-form-row textarea.quick-checkout-error {
  border-color: #e53e3e;
  background: #fff5f5;
}

/* Notes textarea */
.quick-checkout-form-row textarea,
.qc-notes-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  color: #333;
  resize: vertical;
  min-height: 50px;
  min-height: 50px;
  max-height: 100px;
}

/* City select - Compact */
.quick-checkout-city-select {
  display: flex;
  gap: 6px;
}

.quick-checkout-city-select select {
  width: 45%;
  flex-shrink: 0;
  font-size: 12px;
  padding: 8px 8px;
}

.quick-checkout-city-select input {
  flex: 1;
  min-width: 0;
}

/* Action Buttons - Match cart page style */
/* ==========================================================================
   ACTION BUTTONS - Extends nm-btn with custom gradient
   ========================================================================== */

.quick-checkout-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 0 !important;
  background: transparent !important;
  border-top: none !important;
}

/* Primary submit button - inherits all styling from nm-modal.css */
.quick-checkout-actions .nm-btn-save,
.quick-checkout-submit {
  flex: 1;
}

/* Cancel button - inherits all styling from nm-modal.css */

/* Legacy classes - inherit from nm-modal.css via .nm-btn classes */
/* Quick checkout buttons use .nm-btn .nm-btn-save and .nm-btn .nm-btn-cancel */

.quick-checkout-reset {
  background: #f5f5f5;
  color: #666;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-checkout-reset:hover {
  background: #e8e8e8;
  color: #333;
}

/* Loading State - Compact */
.quick-checkout-loading {
  padding: 40px 20px;
  text-align: center;
}

.quick-checkout-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top: 3px solid #667eea;
  border-radius: 50%;
  margin: 0 auto 15px;
  animation: quick-checkout-spin 1s linear infinite;
}

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

.quick-checkout-loading p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* Success State - Compact */
.quick-checkout-success {
  padding: 12px 16px;
  text-align: center;
}

.quick-checkout-success-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 8px;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
}

.quick-checkout-success h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #333;
  font-weight: 700;
}

.quick-checkout-close-success {
  margin-top: 6px;
  padding: 8px 28px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-checkout-close-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}

/* Shipping address summary (injected into form column on success) */
.order-shipping-info {
  background: #f8faf8;
  border: 1px solid #e0e8e0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}

.order-shipping-info p {
  margin: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.7;
}

.order-shipping-info p strong {
  font-size: 15px;
  color: #1a1a2e;
}

/* When price breakdown is visible alongside success, make it tighter */
.quick-checkout-success ~ .quick-checkout-product .quick-checkout-price-breakdown,
.quick-checkout-success + .quick-checkout-product .quick-checkout-price-breakdown {
  font-size: 12px;
}

/* Cart Checkout Modal - Cart Info Styling */
.quick-checkout-cart-info {
  width: 100%;
}

/* Cart modal without columns - add padding to sections */
.quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-product {
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-coupon-section {
  margin: 0;
  padding: 10px 20px;
  border-radius: 0;
  border-top: none;
  border-bottom: 1px solid #eee;
}

.quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-form {
  padding: 12px 20px 16px;
}

.quick-checkout-cart-info .quick-checkout-product-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.cart-items-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Tablet Responsive - Stack columns */
@media (max-width: 768px) {
  .quick-checkout-modal {
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .quick-checkout-modal.quick-checkout-modal--wide {
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .quick-checkout-columns {
    grid-template-columns: 1fr;
  }
  
  .quick-checkout-column--product {
    border-left: none;
    border-bottom: 1px solid #eee;
  }
  
  .quick-checkout-column {
    padding: 12px 16px;
  }
  
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-product {
    padding: 12px 14px;
  }
  
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-coupon-section {
    padding: 10px 14px;
  }
  
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-form {
    padding: 12px 14px 16px;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-product {
    padding: 10px 12px;
  }
  
  .quick-checkout-product-title {
    font-size: 12px;
  }
  
  .quick-checkout-price-breakdown {
    font-size: 12px;
  }
  
  .qc-price-row {
    padding: 4px 0;
  }
  
  .qc-total-row .qc-total {
    font-size: 15px;
  }
  
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-coupon-section {
    padding: 8px 12px;
  }
  
  .qc-coupon-checkbox-label {
    font-size: 12px;
  }
  
  .quick-checkout-coupon {
    gap: 6px;
  }
  
  .qc-coupon-input {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .qc-apply-coupon-btn {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .quick-checkout-modal:not(.quick-checkout-modal--wide) .quick-checkout-form {
    padding: 10px 12px 14px;
  }
  
  .quick-checkout-form-row label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  
  .quick-checkout-form-row input,
  .quick-checkout-form-row select,
  .quick-checkout-form-row textarea {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  
  .quick-checkout-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .quick-checkout-location-grid {
    gap: 6px;
  }
  
  .quick-checkout-city-select {
    flex-direction: column;
    gap: 6px;
  }
  
  .quick-checkout-city-select select {
    width: 100%;
  }
  
  .quick-checkout-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  
  .quick-checkout-reset {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
  }
  
  /* Success screen mobile */
  .quick-checkout-success {
    padding: 10px 12px;
  }
  
  .quick-checkout-success-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    margin-bottom: 6px;
  }
  
  .quick-checkout-success h3 {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .order-shipping-info {
    padding: 10px 12px;
  }

  .order-shipping-info p {
    font-size: 13px;
  }
  
  .quick-checkout-close-success {
    padding: 7px 20px;
    font-size: 12px;
  }
  
  /* Loading screen mobile */
  .quick-checkout-loading {
    padding: 20px 16px;
  }
  
  .quick-checkout-spinner {
    width: 35px;
    height: 35px;
    border-width: 3px;
  }
  
  .quick-checkout-loading p {
    font-size: 12px;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .quick-checkout-modal {
    width: 95%;
    max-width: 290px;
    max-height: 80vh;
  }
  
  .quick-checkout-modal.quick-checkout-modal--wide {
    max-width: 290px;
  }
  
  .quick-checkout-form-row label {
    font-size: 10px;
  }
  
  .quick-checkout-form-row input,
  .quick-checkout-form-row select,
  .quick-checkout-form-row textarea {
    padding: 7px 8px;
    font-size: 11px;
  }
}

/* ========================================
   Promotion Badge & Discount Styles
   ======================================== */

/* Promotion Badge */
.qc-promotion-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.qc-promotion-icon {
  font-size: 18px;
}

.qc-promotion-text {
  flex: 1;
  text-align: right;
}

/* Original Price (struck through) */
.qc-original-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.85em;
  margin-left: 8px;
}

[dir="rtl"] .qc-original-price {
  margin-left: 0;
  margin-right: 8px;
}

/* Stock Warning */
.qc-stock-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ffc107;
}

.qc-stock-warning-icon {
  font-size: 16px;
}

.qc-stock-warning-text {
  flex: 1;
  text-align: right;
}

/* Discount row styling */
.qc-discount-row .qc-discount {
  color: #2e7d32;
  font-weight: 700;
}

/* Promo discount row styling */
.qc-promo-discount-row {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.08), rgba(198, 40, 40, 0.08));
  border-radius: 8px;
  padding: 8px 12px !important;
  margin: 8px 0 !important;
}

.qc-promo-discount-row .qc-price-label {
  color: #c62828;
  font-weight: 600;
}

.qc-promo-discount-row .qc-promo-discount {
  color: #c62828;
  font-weight: 700;
  font-size: 12px;
}

/* Mobile adjustments for promotion badge */
@media (max-width: 480px) {
  .qc-promotion-badge {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
  }
  
  .qc-promotion-icon {
    font-size: 16px;
  }
  
  .qc-stock-warning {
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* ==========================================================================
   TWO COLUMN LAYOUT - Cart checkout modal
   ========================================================================== */

.qc-cart-two-columns {
  display: flex;
  gap: 20px;
  padding: 16px;
}

.qc-cart-column {
  flex: 1;
  min-width: 0;
}

.qc-cart-column-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qc-cart-column-right {
  flex: 1;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
}

.qc-shipping-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}

.qc-shipping-icon {
  font-size: 20px;
}

/* Adjust form styles in right column */
.qc-cart-column-right .quick-checkout-form {
  padding: 0;
  margin: 0;
}

.qc-cart-column-right .qc-form-group {
  margin-bottom: 12px;
}

.qc-cart-column-right .qc-form-label {
  font-size: 12px;
  margin-bottom: 4px;
}

.qc-cart-column-right .qc-form-input,
.qc-cart-column-right .qc-form-select,
.qc-cart-column-right .qc-form-textarea {
  padding: 10px 12px;
  font-size: 14px;
}

/* Adjust price breakdown in left column */
.qc-cart-column-left .quick-checkout-product {
  margin: 0;
  padding: 0;
}

.qc-cart-column-left .quick-checkout-product-info {
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.qc-cart-column-left .quick-checkout-price-breakdown {
  padding: 0;
}

/* Adjust coupon section in left column */
.qc-cart-column-left .qc-coupon-section {
  margin: 0;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

/* RTL Support for two columns */
[dir="rtl"] .qc-cart-two-columns {
  flex-direction: row-reverse;
}

/* Mobile: Stack columns */
@media (max-width: 768px) {
  .qc-cart-two-columns {
    flex-direction: column;
    padding: 12px;
    gap: 16px;
  }
  
  .qc-cart-column-left,
  .qc-cart-column-right {
    flex: none;
    width: 100%;
  }
  
  [dir="rtl"] .qc-cart-two-columns {
    flex-direction: column;
  }
}

/* ==========================================================================
   CART ITEMS LIST - Shows products in cart checkout modal
   ========================================================================== */

.qc-cart-items-list {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}

.qc-cart-items-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.qc-cart-items-header .cart-items-badge {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.qc-cart-items-scroll {
  max-height: 210px; /* Approximately 3 items (70px each) */
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for cart items */
.qc-cart-items-scroll::-webkit-scrollbar {
  width: 4px;
}

.qc-cart-items-scroll::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 2px;
}

.qc-cart-items-scroll::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 2px;
}

.qc-cart-items-scroll::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

.qc-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  transition: opacity 0.25s ease;
}

/* Remove item button */
.qc-cart-item-remove {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.qc-cart-item-remove:hover {
  background: #dc3545;
  color: #fff;
  transform: scale(1.15);
}

.qc-cart-item-remove:active {
  transform: scale(0.95);
}

.qc-cart-item-remove.removing {
  opacity: 0.5;
  cursor: wait;
}

[dir="rtl"] .qc-cart-item-remove {
  left: auto;
  right: 4px;
}

.qc-cart-item:last-child {
  margin-bottom: 0;
}

.qc-cart-item-image {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}

.qc-cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qc-cart-item-details {
  flex: 1;
  min-width: 0;
}

.qc-cart-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qc-cart-item-qty {
  font-size: 11px;
  color: #666;
}

.qc-cart-item-price {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.qc-cart-item-original-price {
  font-size: 11px;
  color: #999;
  text-decoration: line-through;
}

.qc-cart-item-final-price {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.qc-cart-item-discount-label {
  font-size: 10px;
  color: white;
  background: linear-gradient(135deg, #e53935, #c62828);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.qc-cart-item-line-total {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

/* RTL Support for cart items */
[dir="rtl"] .qc-cart-items-scroll {
  padding-right: 0;
  padding-left: 4px;
}

[dir="rtl"] .qc-cart-item-price {
  text-align: left;
  align-items: flex-start;
}

/* Mobile adjustments for cart items */
@media (max-width: 480px) {
  .qc-cart-items-list {
    padding: 10px;
  }
  
  .qc-cart-items-scroll {
    max-height: 180px; /* Approximately 3 items on mobile */
  }
  
  .qc-cart-item {
    padding: 8px;
    gap: 8px;
  }
  
  .qc-cart-item-image {
    width: 40px;
    height: 40px;
  }
  
  .qc-cart-item-title {
    font-size: 12px;
  }
  
  .qc-cart-item-final-price {
    font-size: 13px;
  }
}

/* ==========================================================================
   COUPON DISCOUNT DISPLAY ON ELIGIBLE ITEMS
   ========================================================================== */

/* Coupon discounted price display */
.qc-cart-item.has-coupon-discount .qc-item-price .price-discounted {
  color: #28a745;
  font-weight: 600;
}

.qc-cart-item.has-coupon-discount .qc-item-price .price-original {
  color: #999;
  font-size: 0.85em;
  text-decoration: line-through;
  margin-inline-start: 5px;
}

/* Ensure the price elements are properly aligned */
.qc-cart-item .qc-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.qc-cart-item.has-coupon-discount .qc-item-price {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
