/* ============================================
   Checkout Page – Clean Minimalist (Figma ref)
   All classes prefixed co- to avoid collisions
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* === Layout === */
.co-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 20px 140px;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.co-container *, .co-container *::before, .co-container *::after {
    box-sizing: border-box;
}

/* === Page Title === */
.co-page-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 24px 0 20px;
    letter-spacing: -0.5px;
}

/* === Summary Cards (Address & Contact) === */
.co-summary-card {
    background: #f9fafb;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #2563eb;
}
.co-summary-body {
    flex: 1;
    padding-right: 12px;
    min-width: 0;
}
.co-summary-label {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.co-summary-value {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
}
.co-edit-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s;
}
.co-edit-btn:active { transform: scale(.92); }

/* === Section Heading === */
.co-sect-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 14px;
}
.co-sect-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}
.co-sect-title::after { display: none !important; content: none !important; }
.co-badge-count {
    background: #e5e7eb;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* === Promo / Discount Pill === */
.co-promo-pill {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.co-promo-pill:hover { background: #1d4ed8; }

/* === Item Row === */
.co-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.co-item-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}
.co-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #f3f4f6;
}
.co-item-qty {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e5e7eb;
    color: #111827;
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.co-item-info {
    flex: 1;
    min-width: 0;
}
.co-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.co-item-variant {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}
.co-item-price-col {
    text-align: right;
    margin-left: auto;
    flex-shrink: 0;
}
.co-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}
.co-item-qty-breakdown {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
}

/* === Shipping / Payment Option Pill === */
.co-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    transition: all .25s ease;
}
.co-option:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
.co-option.selected {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(37,99,235,0.05);
}
.co-option-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.co-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}
.co-radio i {
    display: none !important;
}
.co-option.selected .co-radio {
    border: 6px solid #2563eb;
    background: #fff;
}
.co-option-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all .25s ease;
}
.co-option.selected .co-option-icon-wrapper {
    background: #dbeafe;
    color: #2563eb;
}
.co-option-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.co-option-tag {
    background: #dbeafe;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
    white-space: nowrap;
}
.co-option-price {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
}
.co-option-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.co-option-static {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1.5px solid #e2e8f0;
}
.co-option-static .co-option-icon-wrapper {
    background: #dbeafe;
    color: #2563eb;
}

/* === Truck Driving Animation === */
.animate-truck {
    display: inline-block;
    animation: driveTruck 3.5s ease-in-out infinite;
}
@keyframes driveTruck {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(3px) scaleY(0.96); }
    30% { transform: translateX(-1px) scaleY(1.02); }
    45% { transform: translateX(2px) scaleY(0.98); }
    60% { transform: translateX(0) scaleY(1); }
    75% { transform: translateX(2px) translateY(-1px); }
    90% { transform: translateX(-0.5px) translateY(1px); }
}

.animate-pickup {
    display: inline-block;
    animation: smoothPickup 3s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}
@keyframes smoothPickup {
    0%, 100% { transform: translateX(-3px) scaleX(1); opacity: 0.95; }
    40% { transform: translateX(3px) scaleX(1.04); opacity: 1; }
    50% { transform: translateX(0) scaleX(1); }
    90% { transform: translateX(0) scaleX(1); }
}

/* === Bottom Bar === */
.co-bottom-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 480px !important;
    background: #fff !important;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    border-top: 1px solid #e5e7eb !important;
    z-index: 999999 !important;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.06) !important;
}
.co-bottom-total {
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
    min-width: 0;
}
.co-bottom-total-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.co-bottom-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.co-btn-pay {
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s, background .15s;
}
.co-btn-pay:active { transform: scale(.96); }
.co-btn-pay:hover { background: #111827; }

/* === Modal / Bottom-Sheet === */
.co-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000000 !important;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.co-modal.active {
    opacity: 1;
    visibility: visible;
}
.co-modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    display: flex;
    flex-direction: column;
}
.co-modal.active .co-modal-sheet { transform: translateY(0); }
.co-modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.co-modal-heading {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.co-modal-x {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    color: #4b5563;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.co-modal-body {
    overflow-y: auto;
    padding-top: 15px;
    padding-bottom: 20px;
}
.co-modal-body::-webkit-scrollbar { width: 5px; }
.co-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* === Form Styles inside modal === */
.co-fg {
    margin-bottom: 14px;
}
.co-fg label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 5px;
}
.co-fg input,
.co-fg textarea,
.co-fg select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    color: #111827;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border .2s, box-shadow .2s;
}
.co-fg input:focus,
.co-fg textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.co-btn-save {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.co-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* === Map === */
#map {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    width: 100%;
    height: 280px;
    margin: 8px 0 14px;
}
.co-btn-loc, .co-btn-search {
    background: #e5e7eb;
    color: #374151;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
}
.co-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.co-search-row input { flex: 1; }
.co-search-row button { width: auto; padding: 10px 18px; }

/* === Promo input inside modal === */
.co-promo-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.co-promo-row input {
    flex: 1;
    text-transform: uppercase;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.co-promo-row input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.co-promo-row button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}


/* === SweetAlert Premium Styling === */
.premium-alert-ok-btn {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    padding: 12px 30px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
}

/* Ensure SweetAlert popups float above the checkout modals */
.swal2-container, .swal-container, .sweet-alert, .swal-overlay {
    z-index: 2000000000 !important;
}

/* Compact Free Shipping Badge */
.co-free-ongkir-badge {
    background: #dcfce7 !important;
    color: #15803d !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
}

/* === Payment Processing Modals === */
.co-payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4); /* Modern slate dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200000000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.co-payment-modal.active {
    display: flex;
}
.co-payment-card {
    background: rgba(20, 24, 38, 0.95);
    border: 1px solid rgba(212, 168, 83, 0.25);
    width: 100%;
    max-width: 360px;
    border-radius: 28px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.co-payment-modal.active .co-payment-card {
    transform: scale(1);
    opacity: 1;
}

/* Icons */
.co-pay-icon-bubble {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.co-pay-icon-bubble.loading {
    border: 4px solid rgba(212, 168, 83, 0.15);
    border-top-color: #d4a853;
    animation: paySpinner 1s linear infinite;
    box-shadow: 0 0 15px rgba(212, 168, 83, 0.2);
}
.co-pay-icon-bubble.success {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    color: #10b981;
    font-size: 32px;
}
.co-pay-icon-bubble.error {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #ef4444;
    color: #ef4444;
    font-size: 32px;
}

@keyframes paySpinner {
    to { transform: rotate(360deg); }
}

/* Typography */
.co-pay-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffe082;
    margin: 0 0 8px;
    font-family: 'Outfit', sans-serif;
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.2);
}
.co-pay-sub {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 24px;
    font-family: 'Inter', sans-serif;
}

/* Buttons */
.co-pay-btn-primary {
    background: linear-gradient(135deg, #d4a853, #b8860b);
    color: #000000;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.25);
}
.co-pay-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 168, 83, 0.35);
}
.co-pay-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #ffe082;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.co-pay-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}
