/* ═══════════════════════════════════════════
   SIDE CART DRAWER — Research ROI v2.1
   No black — uses #215387 primary, greys
   ═══════════════════════════════════════════ */

/* Overlay */
.roi-side-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.roi-side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Drawer */
.roi-side-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
}

.roi-side-cart.active {
    transform: translateX(0);
}

/* Header */
.roi-sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}

.roi-sc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.roi-sc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #215387;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0 4px;
}

.roi-sc-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    color: #6b7280;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.roi-sc-close:hover {
    background: #e2e8f0;
    color: #374151;
}

/* Free Shipping Bar */
.roi-sc-shipping-bar {
    padding: 12px 20px;
    background: #f0fdf4;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.roi-sc-shipping-text {
    font-size: 0.8125rem;
    color: #374151;
    margin-bottom: 8px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.roi-sc-shipping-free {
    color: #059669;
}

.roi-sc-shipping-track {
    height: 6px;
    background: #dcfce7;
    border-radius: 999px;
    overflow: hidden;
}

.roi-sc-shipping-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

/* Cart Items */
.roi-sc-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.roi-sc-items::-webkit-scrollbar { width: 4px; }
.roi-sc-items::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* Single Item */
.roi-sc-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    transition: background 0.2s ease;
    background: #fff;
}

.roi-sc-item:hover {
    background: #f8fafc;
}

.roi-sc-item-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

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

.roi-sc-item-details {
    flex: 1;
    min-width: 0;
}

.roi-sc-item-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.roi-sc-item-name:hover {
    color: #215387;
}

.roi-sc-item-price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #215387;
    margin-bottom: 6px;
}

/* Quantity */
.roi-sc-item-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.roi-sc-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.roi-sc-qty-btn:hover {
    background: #f1f5f9;
    color: #215387;
}

.roi-sc-qty-value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2c3e50;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    background: #fff;
}

/* Remove */
.roi-sc-item-remove {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.roi-sc-item-remove:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Empty Cart */
.roi-sc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #fff;
}

.roi-sc-empty p {
    color: #9ca3af;
    font-size: 0.9375rem;
    margin-top: 12px;
    font-family: 'Inter', sans-serif;
}

/* Coupon */
.roi-sc-coupon {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}

.roi-sc-coupon-form {
    display: flex;
    gap: 8px;
}

.roi-sc-coupon-input {
    flex: 1;
    padding: 8px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 0.8125rem !important;
    background: #f8fafc !important;
    width: auto !important;
    font-family: 'Inter', sans-serif !important;
}

.roi-sc-coupon-input:focus {
    border-color: #215387 !important;
    box-shadow: 0 0 0 3px rgba(33, 83, 135, 0.1) !important;
}

.roi-sc-coupon-btn {
    padding: 8px 16px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    background: #215387 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif !important;
}

.roi-sc-coupon-btn:hover {
    background: #1a4370 !important;
    color: #fff !important;
}

.roi-sc-coupon-msg { font-size: 0.75rem; margin-top: 6px; padding: 0 2px; }
.roi-sc-coupon-msg.success { color: #059669; }
.roi-sc-coupon-msg.error { color: #dc2626; }

/* Footer / Totals */
.roi-sc-footer {
    padding: 16px 20px 20px;
    border-top: 2px solid #e2e8f0;
    flex-shrink: 0;
    background: #f8fafc;
}

.roi-sc-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.roi-sc-subtotal span:first-child {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.roi-sc-subtotal-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Inter', sans-serif;
}

.roi-sc-checkout-btn {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: #215387;
    color: #fff !important;
    font-size: 0.9375rem;
    font-weight: 700;
    text-align: center;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.roi-sc-checkout-btn:hover {
    background: #1a4370;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(33, 83, 135, 0.3);
    transform: translateY(-1px);
}

.roi-sc-continue-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: #fff;
    color: #6b7280 !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    border-radius: 9999px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.roi-sc-continue-btn:hover {
    border-color: #215387;
    color: #215387 !important;
    background: #e8f0f8;
}

/* Loading */
.roi-sc-loading .roi-sc-items {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    .roi-side-cart {
        width: 100vw;
        max-width: 100vw;
    }
}
