/* PREMIUM CHECKOUT & CART STYLES - PHASE 4 */

/* --- CART REFINEMENTS --- */
.cart-screen {
    background: #f8fafc;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-header {
    background: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.5px;
}

.cart-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-items {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.cart-item {
    background: white;
    border-radius: 0 !important;
    padding: 16px;
    display: flex;
    gap: 16px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.cart-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    max-width: 140px;
}

.cart-remove {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 5px;
    margin: -5px -5px 0 0;
    cursor: pointer;
}

.cart-item-variants {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.cart-item-footer .price {
    font-weight: 800;
    color: var(--app-primary, #6366f1);
    font-size: 1rem;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0;
    padding: 4px;
    border: 1px solid #f1f5f9;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: white;
    border-radius: 0;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-val {
    font-size: 0.9rem;
    font-weight: 800;
    min-width: 20px;
    text-align: center;
    color: #0f172a;
}

.cart-footer {
    background: white;
    padding: 24px;
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

.cart-summary {
    margin-bottom: 15px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 12px;
}

.summary-line.total {
    font-size: 1.25rem;
    font-weight: 950;
    color: #0f172a;
    border-top: 1px dashed #e2e8f0;
    padding-top: 16px;
    margin-top: 16px;
}

.checkout-btn {
    width: 100%;
    background: var(--app-primary, #6366f1);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    transition: transform 0.1s;
}

.checkout-btn:active {
    transform: scale(0.96);
}

/* --- CHECKOUT FLOW (PHASE 4) --- */
.checkout-screen {
    background: #f8fafc;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.checkout-header {
    background: white;
    padding: 20px 20px 10px;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 20;
}

.checkout-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
    margin-bottom: 15px;
}

.step-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 15px;
    margin-bottom: 10px;
}

.step-progress-bar::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
}

.progress-step {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step.active .step-dot {
    background: var(--app-primary, #6366f1);
    border-color: var(--app-primary, #6366f1);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    transform: scale(1.1);
}

.progress-step.completed .step-dot {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active .step-label {
    color: var(--app-primary, #6366f1);
}

.checkout-body {
    padding: 20px;
    padding-bottom: 120px;
    flex: 1;
    overflow-y: auto;
}

.form-section {
    background: white;
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
    animation: slideUpFade 0.4s ease-out;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #1e293b;
    font-weight: 800;
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.input-field:focus {
    background: white;
    border-color: var(--app-primary, #6366f1);
    outline: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.input-field::placeholder {
    color: #94a3b8;
}

.shipping-method-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 0;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.shipping-method-option.selected {
    border-color: var(--app-primary, #6366f1);
    background: #f5f3ff;
}

.radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    margin-right: 15px;
    position: relative;
}

.shipping-method-option.selected .radio-circle {
    border-color: var(--app-primary, #6366f1);
    background: var(--app-primary, #6366f1);
}

.radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    opacity: 0;
}

.shipping-method-option.selected .radio-circle::after {
    opacity: 1;
}

.checkout-fixed-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.summary-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.summary-total-label {
    font-size: 0.9rem;
    color: #64748b;
}

.summary-total-val {
    font-size: 1.2rem;
    font-weight: 900;
    color: #0f172a;
}

/* SUCCESS ANIMATION */
.success-view {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    margin-bottom: 25px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.order-badge-pill {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 0 !important;
    font-family: monospace;
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

/* --- PREMIUM FILTER DRAWER (Phase 4 Refinement) --- */
.filter-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.filter-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.filter-dropdown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 4px 4px 0 0;
    padding: 20px 20px 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85%;
    overflow-y: auto;
}

.filter-menu-overlay.active .filter-dropdown {
    transform: translateY(0);
}

.filter-header-main {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    color: #1e293b;
    position: relative;
}

.filter-header-main::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 10px auto 0;
}

.filter-accordion-item {
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 5px;
}

.filter-accordion-header {
    padding: 15px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.filter-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-accordion-item.active .filter-accordion-content {
    max-height: 300px;
    /* Approximate max height */
}

.pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 15px;
}

.filter-btn-pill {
    padding: 8px 16px;
    border-radius: 0 !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn-pill.active {
    background: #e0e7ff;
    /* light indigo - fallback */
    color: #4f46e5;
    border-color: #4f46e5;
}

.btn-apply-minimal {
    width: 100%;
    margin-top: 25px;
    padding: 15px;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 0;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

/* POLLING INDICATOR (v9.8.8) */
.wi-polling-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
}

.wi-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: wi-pulse 1.5s infinite;
}

@keyframes wi-pulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.wi-status-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* DEBUG CONSOLE (v9.8.9) */
.wi-debug-console {
    background: #0f172a;
    color: #10b981;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 10px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: left;
    width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #1e293b;
}

.wi-debug-console span {
    color: #94a3b8;
}