/* ============================================
   CART SIDEBAR STYLES
   ============================================ */

/* Overlay */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.active {
    transform: translateX(0);
}

/* Header del carrito */
.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-header h2 {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #15158B;
}

.cart-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    color: #111827;
}

/* Contenido del carrito */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.cart-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Lista de productos */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: background 0.2s;
}

.cart-item:hover {
    background: #f3f4f6;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-weight: 600;
    color: #16193B;
    margin-bottom: 0.25rem;
    font-size: 0.875rem !important;
    line-height: 1.25rem;
}

.cart-item-price {
    color: #111827;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem;
}

.quantity-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.quantity-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #111827;
}

.cart-item-remove {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #ef4444;
    transition: color 0.2s;
    margin-left: auto;
}

.cart-item-remove:hover {
    color: #dc2626;
}

/* Footer del carrito */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
}

.cart-summary {
    margin-bottom: 1rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.cart-summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.cart-checkout {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-checkout:hover {
    background: #1e40af;
}

.cart-checkout:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Badge contador */
.cart-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: #B94EB5 !important;
    background-color: #B94EB5 !important;
    color: #ffffff !important;
    font-size: 0.75rem;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.cart-badge * {
    color: #ffffff !important;
}

.cart-badge.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .cart-sidebar {
        max-width: 100%;
    }
}

