/* pos-cart.css - Estilos específicos para la interfaz del carrito de compras */

/* Panel lateral del carrito */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--surface-color);
    border-left: 2px solid var(--primary-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

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

/* Header del carrito */
.cart-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.cart-header h3 {
    margin: 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-header .btn-close-cart {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.cart-header .btn-close-cart:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Contenido del carrito */
.cart-content {
    padding: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Estado vacío del carrito */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-color-light);
}

.cart-empty i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cart-empty p {
    margin: 10px 0;
    font-size: 1.1em;
}

.cart-empty small {
    opacity: 0.7;
}

/* Items del carrito */
.cart-items {
    padding: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.cart-item:hover {
    background: var(--hover-color);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    background: var(--hover-color);
}

.cart-item-info {
    flex: 1;
    margin-right: 15px;
}

.cart-item-name {
    font-weight: 600;
    margin: 0 0 5px 0;
    font-size: 0.95em;
    color: var(--text-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9em;
    margin: 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hover-color);
    border-radius: 20px;
    padding: 5px 12px;
}

.cart-quantity-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s;
}

.cart-quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.cart-quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cart-item-quantity-value {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--error-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cart-item-remove:hover {
    background: var(--error-color);
    color: white;
}

/* Resumen del carrito */
.cart-summary {
    background: var(--background-color);
    border-top: 2px solid var(--primary-color);
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.summary-row.total {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.summary-label {
    color: var(--text-color);
}

.summary-amount {
    font-weight: 600;
}

/* Botón de checkout */
.cart-checkout {
    margin-top: 20px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkout:hover:not(:disabled) {
    background: var(--success-color-dark);
}

.btn-checkout:disabled {
    background: var(--text-color-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Animaciones y estados de carga */
.cart-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item-updating {
    position: relative;
    overflow: hidden;
}

.cart-item-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }

    .cart-item {
        padding: 12px 15px;
    }

    .cart-item-image {
        width: 50px;
        height: 50px;
    }
}

/* Tema oscuro */
[data-theme="dark-professional"] .cart-sidebar {
    background: #2d2d2d;
    border-left-color: #3498db;
}

[data-theme="dark-professional"] .cart-header {
    background: #3498db;
}

/* Tema azul corporativo */
[data-theme="blue-corporate"] .cart-sidebar {
    background: #f8f9fa;
    border-left-color: #2980b9;
}

[data-theme="blue-corporate"] .cart-header {
    background: #2980b9;
}

/* Variables CSS para colores del carrito */
:root {
    --cart-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --cart-border-radius: 8px;
    --cart-transition: all 0.3s ease;
}
