/* ============================================================================
   CARRITO DE COMPRAS
   ============================================================================ */

.cart-icon-wrapper {
    position: relative;
}

.cart-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon-btn:hover {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cart-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.cart-empty svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.cart-item-price {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.cart-qty {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    align-self: flex-start;
}

.cart-item-remove:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-total-amount {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.cart-checkout {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.cart-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   MODAL DE PREVISUALIZACIÓN
   ============================================================================ */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--text-primary);
    color: white;
}

.modal-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.modal-product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-product-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-product-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-product-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-product-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.modal-product-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value.price {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.modal-product-actions {
    margin-top: auto;
}

.modal-product-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================================================
   BOTONES DE PRODUCTO
   ============================================================================ */

.product-actions {
    display: flex;
    gap: 0.525rem;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

.btn-view,
.btn-add-cart {
    flex: 1;
    padding: 0.438rem 0.7rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.613rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: inherit;
}

.btn-view {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.btn-view:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(42, 116, 255, 0.05);
}

.btn-add-cart {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-add-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   NOTIFICACIONES
   ============================================================================ */

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .cart-sidebar {
        width: 90%;
        max-width: 400px;
    }
}

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

    .cart-header h2 {
        font-size: 1.25rem;
    }

    .cart-items {
        max-height: calc(100vh - 350px);
    }

    .cart-item {
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .cart-item-info {
        flex: 1;
        min-width: 0;
    }

    .cart-item-name {
        font-size: 0.9375rem;
    }

    .cart-item-price {
        font-size: 1rem;
    }

    .cart-item-controls {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .quantity-control {
        gap: 0.375rem;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
        min-height: 32px;
        font-size: 1rem;
    }

    .qty-input {
        width: 40px;
        padding: 0.375rem;
        font-size: 0.875rem;
    }

    .remove-item-btn {
        padding: 0.5rem;
        min-height: 32px;
        width: 32px;
        height: 32px;
    }

    .cart-footer {
        padding: 1rem;
    }

    .cart-total {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .btn-checkout {
        padding: 1rem;
        font-size: 1rem;
        min-height: 50px;
    }

    .modal-product {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .modal-product-name {
        font-size: 1.375rem;
    }

    .modal-product-price {
        font-size: 1.5rem;
    }

    .product-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-view,
    .btn-add-cart {
        width: 100%;
        padding: 1rem;
        min-height: 48px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cart-header {
        padding: 1rem;
    }

    .cart-header h2 {
        font-size: 1.125rem;
    }

    .cart-items {
        max-height: calc(100vh - 320px);
        padding: 0.75rem;
    }

    .cart-item {
        flex-direction: row;
        padding: 0.75rem;
        gap: 0.625rem;
    }

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

    .cart-item-info {
        gap: 0.25rem;
    }

    .cart-item-name {
        font-size: 0.875rem;
        line-height: 1.3;
    }

    .cart-item-price {
        font-size: 0.9375rem;
    }

    .cart-item-controls {
        flex-direction: column;
        gap: 0.375rem;
    }

    .qty-btn {
        width: 28px;
        height: 28px;
        min-height: 28px;
        font-size: 0.875rem;
    }

    .qty-input {
        width: 36px;
        padding: 0.25rem;
        font-size: 0.8125rem;
    }

    .remove-item-btn {
        padding: 0.4375rem;
        min-height: 28px;
        width: 28px;
        height: 28px;
    }

    .cart-footer {
        padding: 0.875rem;
    }

    .cart-total {
        font-size: 1.125rem;
    }

    .btn-checkout {
        padding: 0.875rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    .modal-product {
        padding: 1rem;
    }

    .modal-product-name {
        font-size: 1.25rem;
    }

    .modal-product-price {
        font-size: 1.375rem;
    }

    .notification {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        padding: 0.875rem;
        font-size: 0.875rem;
    }
}


