/**
 * Diver Cart Slider - Frontend Styles
 * Version: 1.1.0
 */

.diver-cart-slider-wrapper {
    position: relative;
    display: inline-block;
}

.diver-cart-trigger {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    outline: none;
}

.diver-cart-trigger:hover {
    transform: translateY(-3px);
    background: #F1F5F9;
}

.diver-cart-icon {
    display: block;
    transition: all 0.3s ease;
}

.diver-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 20px;
    height: 20px;
    background: #EF4444;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transition: all 0.3s ease;
    transform: translate(-80%, -20%);
}

.diver-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

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

.diver-cart-sidebar {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.diver-cart-sidebar.diver-position-left {
    left: 0;
    transform: translateX(-100%);
}

.diver-cart-sidebar.diver-position-left.active {
    transform: translateX(0);
}

.diver-cart-sidebar.diver-position-right {
    right: 0;
    transform: translateX(100%);
}

.diver-cart-sidebar.diver-position-right.active {
    transform: translateX(0);
}

.diver-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 2px solid #F1F5F9;
    background: linear-gradient(135deg, #4054B2, #5468C8);
    color: white;
    flex-shrink: 0;
}

.diver-cart-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.diver-cart-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diver-cart-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.diver-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    overflow-x: hidden;
}

.diver-cart-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748B;
}

.diver-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #F1F5F9;
    border-top-color: #4054B2;
    border-radius: 50%;
    animation: diver-spin 1s linear infinite;
}

@keyframes diver-spin {
    to { transform: rotate(360deg); }
}

.diver-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748B;
}

.diver-cart-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    opacity: 0.3;
}

.diver-cart-empty h3 {
    font-size: 22px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 12px 0;
}

.diver-cart-empty p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.diver-cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.diver-cart-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #F1F5F9;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.diver-cart-item:hover {
    background: #E2E8F0;
    transform: translateX(-4px);
}

.diver-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
}

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

.diver-cart-item-details {
    flex: 1;
}

.diver-cart-item-name {
    font-size: 16px;
    font-weight: 700;
    color: #1C1F2A;
    margin: 0 0 8px 0;
}

.diver-cart-item-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.diver-cart-item-quantity {
    font-size: 14px;
    color: #64748B;
}

.diver-cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #4054B2;
}

.diver-cart-item-subtotal {
    font-size: 18px;
    font-weight: 700;
    color: #4054B2;
    margin-bottom: 12px;
}

.diver-cart-item-remove {
    padding: 8px 16px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.diver-cart-item-remove:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.diver-cart-footer {
    padding: 24px;
    border-top: 2px solid #F1F5F9;
    background: #F8FAFC;
    flex-shrink: 0;
}

.diver-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.diver-cart-total-label {
    color: #334155;
}

.diver-cart-total-value {
    color: #4054B2;
    font-size: 24px;
}

/* زر إتمام الشراء - أخضر */
.diver-cart-checkout {
    width: 100%;
    height: 56px;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.diver-checkout-btn {
    background: linear-gradient(135deg, #10B981, #059669);
}

.diver-checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    color: white;
}

/* زر ابدأ التسوق - برتقالي/أصفر */
.diver-shop-btn {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.diver-shop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    color: white;
}

/* تأثير الانتقال بين الأزرار */
.diver-cart-checkout {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .diver-cart-sidebar {
        max-width: 100% !important;
    }

    .diver-cart-header {
        padding: 20px;
    }

    .diver-cart-content {
        padding: 16px;
    }

    .diver-cart-footer {
        padding: 20px;
    }
}
