/* Cart Sidebar Styles - Clean Minimal Design (Option 1) */

/* Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -460px;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    background-color: #f8f9fa;
    z-index: 999999;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.open {
    right: 0;
}

/* Header */
.cart-sidebar-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    color: white;
    flex-shrink: 0;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-sidebar-header h3::before {
    content: "\f07a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 16px;
}

.cart-sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    opacity: 0.8;
}

.cart-sidebar-close:hover {
    opacity: 1;
}

/* Body */
.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 0;
}

/* Custom scrollbar */
.cart-sidebar-body::-webkit-scrollbar {
    width: 6px;
}

.cart-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.cart-sidebar-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.cart-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Cart Items Container */
#cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cart-item-compact {
    padding: 12px 16px;
    gap: 10px;
}

.cart-item-compact .cart-item-details {
    gap: 4px;
}

.cart-item-compact .cart-item-details h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.cart-item-compact .cart-item-info {
    margin-top: 4px;
}

.cart-item-compact .cart-item-type {
    font-size: 9px;
    letter-spacing: 0.6px;
}

/* Cart Item Image */
.cart-item-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

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

/* Cart Item Details */
.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Item Type Label */
.cart-item-type {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    margin-bottom: 4px;
    display: inline-block;
}

/* Item Info Row */
.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.cart-item-quantity {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.cart-item-price {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Cart item without image (packages, services, other charges) */
.cart-item-no-image {
    display: block;
}

.cart-item-no-image .cart-item-details {
    width: 100%;
}

/* Loading, Error, Empty States */
.cart-loading,
.cart-error,
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 30px;
    min-height: 400px;
}

.cart-loading {
    color: #6c757d;
    font-size: 16px;
}

.cart-loading::before {
    content: "";
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cart-loading::after {
    content: "Loading your cart...";
    display: block;
    font-size: 15px;
    color: #666;
    margin-top: 12px;
}

.cart-empty {
    color: #6c757d;
}

.cart-empty::before {
    content: "\f07a";
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
    display: block;
}

.cart-empty::after {
    content: "Your cart is empty";
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-top: 12px;
}

.cart-error {
    color: #dc3545;
}

.cart-error::before {
    content: "\f071";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 64px;
    color: #f8d7da;
    margin-bottom: 20px;
    display: block;
}

.cart-error::after {
    content: "Failed to load cart";
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #dc3545;
    margin-top: 12px;
}

/* Footer */
.cart-sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Summary Breakdown */
.cart-summary {
    margin-bottom: 16px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.cart-summary-row:last-child {
    margin-bottom: 0;
}

.cart-summary-row.subtotal,
.cart-summary-row.tax {
    color: #666;
}

.cart-summary-row.total {
    border-top: 2px solid #e0e0e0;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 700;
}

.cart-summary-row.total .label {
    color: #1a1a1a;
}

.cart-summary-row.total .value {
    color: #1a1a1a;
}

/* Hide old cart-total div */
.cart-total {
    display: none;
}

/* Checkout Button */
.cart-sidebar-footer .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    display: block;
    text-align: center;
}

.cart-sidebar-footer .btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-sidebar-footer .btn:active {
    transform: translateY(0);
}

/* Cart trigger in header */
.cart-trigger {
    position: relative;
}

.cart-trigger i {
    font-size: 18px;
}

/* Cart item count badge */
.cart-item-count {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    background-color: #dc3545 !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    min-width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px 4px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.2s ease !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Animation for badge update */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.cart-item-count.pulse {
    animation: badgePulse 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
        max-width: 100%;
    }

    .cart-sidebar-header {
        padding: 16px 20px;
    }

    .cart-sidebar-header h3 {
        font-size: 16px;
    }

    .cart-sidebar-body {
        padding: 16px;
    }

    .cart-item {
        padding: 14px;
        gap: 12px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
        padding: 3px;
    }

    .cart-item-details h4 {
        font-size: 14px;
    }

    .cart-item-quantity {
        font-size: 12px;
    }

    .cart-item-price {
        font-size: 15px;
    }

    .cart-sidebar-footer {
        padding: 16px 20px;
    }

    .cart-summary-row {
        font-size: 13px;
    }

    .cart-summary-row.total {
        font-size: 16px;
    }

    .cart-sidebar-footer .btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .cart-loading,
    .cart-error,
    .cart-empty {
        padding: 60px 20px;
        min-height: 300px;
    }

    .cart-empty::before,
    .cart-error::before {
        font-size: 48px;
    }

    .cart-empty::after,
    .cart-error::after {
        font-size: 16px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .cart-sidebar {
        width: 400px;
        right: -400px;
    }
}

/* Smooth animations */
#cart-items-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
