/* ============================================================
   QUICK CHECKOUT MODAL — Design System & Custom Overlays
   ============================================================ */

.quick-co-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.quick-co-overlay.show {
    opacity: 1;
}

.quick-co-modal {
    background: #ffffff;
    width: 95%;
    max-width: 680px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    font-family: 'Inter', 'Tajawal', sans-serif;
}
.quick-co-overlay.show .quick-co-modal {
    transform: scale(1);
}

/* Header */
.quick-co-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}
.quick-co-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.quick-co-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.quick-co-close:hover {
    color: #0f172a;
}

/* Stepper */
.quick-co-stepper {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.quick-co-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 14px;
}
.quick-co-step.active {
    color: #004c91;
}
.quick-co-step-bubble {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.quick-co-step.active .quick-co-step-bubble {
    background: #004c91;
    color: #ffffff;
    box-shadow: 0 0 0 4px #e8f1fb;
}
.quick-co-step.completed .quick-co-step-bubble {
    background: #ecfdf5;
    color: #059669;
}
.quick-co-stepper-line {
    flex: 1;
    height: 2px;
    background: #f1f5f9;
    margin: 0 16px;
}
.quick-co-step.completed + .quick-co-stepper-line {
    background: #059669;
}

/* Body / Container */
.quick-co-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Address grid cards */
.quick-co-addr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.quick-co-addr-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}
.quick-co-addr-card:hover {
    border-color: #cbd5e1;
}
.quick-co-addr-card.selected {
    border-color: #004c91;
    background: #e8f1fb;
    box-shadow: 0 0 0 2px #004c91;
}

.quick-co-addr-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}
.quick-co-addr-card.selected .quick-co-addr-radio {
    border-color: #004c91;
    background: #004c91;
}
.quick-co-addr-card.selected .quick-co-addr-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.quick-co-addr-details {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}
.quick-co-addr-zip {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

/* Form Styles */
.quick-co-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}
.quick-co-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
    color: #0f172a;
}
.quick-co-input:focus {
    border-color: #004c91;
    box-shadow: 0 0 0 3px #e8f1fb;
}

/* Map Canvas */
.quick-co-map-wrapper {
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    margin-bottom: 16px;
}
#quick-co-map-canvas {
    height: 100%;
}

/* Footer Action Buttons */
.quick-co-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}
.quick-co-btn {
    border-radius: 12px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.quick-co-btn-primary {
    background: #004c91;
    color: #ffffff;
}
.quick-co-btn-primary:hover {
    background: #003668;
}
.quick-co-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.quick-co-btn-secondary:hover {
    background: #e2e8f0;
}

/* Spinner */
.quick-co-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: quick-co-spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes quick-co-spin {
    to { transform: rotate(360deg); }
}

/* Payment Layout */
.quick-co-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.quick-co-payment-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.quick-co-payment-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.quick-co-payment-card.active {
    border-color: #004c91;
    background: #e8f1fb;
    border-width: 2px;
}
.quick-co-payment-icon {
    width: 60px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-co-payment-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.quick-co-payment-title {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
}

/* Inline Paymob container inside modal */
#quick-co-inline-paymob-container {
    margin-top: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
}

/* Order Summary Box inside Modal */
.quick-co-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}
.quick-co-summary-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}
.quick-co-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}
.quick-co-summary-row.total {
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 700;
    color: #0f172a;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .quick-co-modal {
        border-radius: 16px;
    }
    .quick-co-body {
        padding: 16px;
    }
    .quick-co-addr-grid {
        grid-template-columns: 1fr;
    }
    .quick-co-payment-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Utility & Layout helper */
.hidden {
    display: none !important;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Phone input styling */
.phone-field {
    direction: ltr !important;
    text-align: left !important;
}
.phone-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 12px;
    direction: ltr !important;
}
.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 12px 0 0 12px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}
.quick-co-input.phone-field {
    border-radius: 0 12px 12px 0;
    margin-bottom: 0 !important;
    flex: 1;
    direction: ltr;
    text-align: left;
}
.phone-group:focus-within .phone-prefix {
    border-color: #004c91;
    color: #004c91;
}

/* Smart Search & Auto Locate Buttons */
.smart-search-box {
    margin-bottom: 16px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}
.smart-search-row {
    display: flex;
    gap: 10px;
}
.smart-search-btn {
    background: #004c91;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.2s;
}
.smart-search-btn:hover {
    background: #003668;
}
.btn-auto-locate {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-auto-locate:hover {
    background: #f8fafc;
    border-color: #004c91;
    color: #004c91;
}
.btn-auto-locate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.search-status {
    font-size: 13px;
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 8px;
}
.search-status.loading {
    display: flex;
    background: #f1f5f9;
    color: #475569;
}
.search-status.success {
    display: flex;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.search-status.error {
    display: flex;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Alternate Receiver Component */
.quick-co-alt-receiver {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
}
.quick-co-alt-receiver-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.quick-co-alt-receiver-desc {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 0 0;
}
.custom-receiver-toggle {
    width: 36px;
    height: 20px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.2s;
}
.custom-receiver-toggle:checked {
    background: #004c91;
}
.custom-receiver-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}
.custom-receiver-toggle:checked::before {
    transform: translateX(16px);
}

.btn-add-new-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    color: #004c91;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-top: 16px;
    box-sizing: border-box;
}
.btn-add-new-address:hover {
    border-color: #004c91;
    background: #e8f1fb;
}

/* Payment Methods Grid matching Checkout page */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-items: stretch;
    margin-bottom: 20px;
}
@media (max-width: 576px) {
    .payment-methods-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.payment-option {
    height: 100%;
}
.payment-card-premium {
    height: 100%;
    border: 1px solid #cbd5e1 !important;
    border-radius: 16px !important;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: start;
    padding: 16px;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}
.payment-card-premium:hover {
    border-color: #004c91 !important;
    background: #f8fafc;
}
.payment-card-premium.active {
    border-color: #004c91 !important;
    background: #e8f1fb;
    box-shadow: 0 0 0 1px #004c91;
}
.payment-icon-wrapper {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.payment-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.gateway-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

/* Coupon Row elements */
.quick-coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: stretch;
}
.quick-coupon-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    height: 44px;
    box-sizing: border-box;
}
.quick-coupon-input:focus {
    border-color: #004c91;
    box-shadow: 0 0 0 3px #e8f1fb;
}
.quick-coupon-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    box-sizing: border-box;
}
.quick-coupon-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.auto-filled-highlight {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px #dcfce7 !important;
    transition: all 0.3s ease;
}

/* ============================================================
   RESPONSIVE — Coupon Row Stacking on Small Screens
   ============================================================ */
@media (max-width: 480px) {
    .quick-coupon-row {
        flex-direction: column;
        gap: 10px;
    }
    .quick-coupon-input {
        width: 100%;
        min-width: 0;
    }
    .quick-coupon-btn {
        width: 100%;
        min-width: 0;
        padding: 12px 16px;
        height: 46px;
        font-size: 15px;
    }
}

@media (min-width: 481px) and (max-width: 600px) {
    .quick-coupon-btn {
        min-width: 90px;
        padding: 0 14px;
        font-size: 13px;
    }
}

