/**
 * ==============================================================================
 * NISSEI E-COMMERCE - COMPONENTS & MODALS STYLESHEET
 * ==============================================================================
 */

/* ==============================================================================
   CART DRAWER (OFF-CANVAS SLIDE-OVER)
   ============================================================================== */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: -460px;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: #FFFFFF;
    z-index: 9999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active {
    right: 0;
}

.cart-drawer-header {
    padding: 18px 20px;
    background: var(--nis-navy);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-drawer-title {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-drawer-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #FFF;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}

.cart-drawer-close:hover {
    background: var(--nis-orange);
}

/* Free shipping progress */
.free-shipping-box {
    background: #EFF6FF;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.free-shipping-text {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--nis-navy);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.free-shipping-bar {
    height: 6px;
    background: #CBD5E1;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.free-shipping-fill {
    height: 100%;
    background: var(--nis-green);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.cart-item {
    display: flex;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    background: #FFF;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--nis-navy);
    margin-bottom: 8px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
    overflow: hidden;
}

.qty-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-main);
    transition: background 0.15s ease;
}

.qty-btn:hover {
    background: #E2E8F0;
}

.qty-input {
    width: 32px;
    height: 28px;
    border: none;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    background: transparent;
    outline: none;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.15s ease;
}

.cart-item-remove:hover {
    color: var(--nis-red);
}

.cart-drawer-footer {
    padding: 18px 20px;
    background: #F8FAFC;
    border-top: 1px solid var(--border-color);
}

.cart-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.cart-totals-row.total {
    font-size: 18px;
    font-weight: 900;
    color: var(--nis-navy);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 6px;
}

.cart-drawer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.btn-checkout {
    background: var(--nis-orange);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 14px;
    padding: 13px;
    border-radius: var(--radius-md);
    border: none;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color var(--transition-fast);
}

.btn-checkout:hover {
    background-color: var(--nis-orange-hover);
}

/* ==============================================================================
   QUICK VIEW MODAL
   ============================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #F1F5F9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: var(--nis-red);
    color: #FFFFFF;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

/* ==============================================================================
   TOAST NOTIFICATIONS
   ============================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #FFFFFF;
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--nis-orange);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 600;
    min-width: 300px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease forwards;
    transition: all 0.3s ease;
}

.toast.toast-success { border-left-color: var(--nis-green); }
.toast.toast-error { border-left-color: var(--nis-red); }
.toast.toast-warning { border-left-color: var(--nis-yellow); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==============================================================================
   COUNTDOWN TIMER (NISSEI FLASH DEALS)
   ============================================================================== */
.countdown-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.countdown-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--nis-red);
    text-transform: uppercase;
    margin-right: 4px;
}

.countdown-unit {
    background: var(--nis-red);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
}

/* ==============================================================================
   CHECKOUT & FORM STYLES
   ============================================================================== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.checkout-step {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.step-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--nis-navy);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--nis-navy);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--nis-orange);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.payment-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.payment-option-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.payment-option-card:hover, .payment-option-card.selected {
    border-color: var(--nis-orange);
    background: #FFF9F5;
}

@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
}
