/* ================================================
   CARRITO FLOTANTE MODERNO
   ================================================ */

:root {
    --cart-primary: #a101ff;
    --cart-secondary: #764ba2;
    --cart-success: #00ff7f;
    --cart-danger: #ff3b3b;
    --cart-dark: #1a1a2e;
    --cart-light: #ffffff;
}

/* Botón flotante del carrito */
.floating-cart-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--cart-primary), var(--cart-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(161, 1, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9998;
    animation: pulse-cart 2s infinite;
}

@keyframes pulse-cart {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(161, 1, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 40px rgba(161, 1, 255, 0.6);
    }
}

.floating-cart-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 48px rgba(161, 1, 255, 0.6);
}

.floating-cart-button.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.floating-cart-button i {
    font-size: 1.5rem;
    color: white;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--cart-danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 3px solid var(--cart-dark);
    animation: bounce-badge 0.6s ease;
}

@keyframes bounce-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Panel del carrito */
.floating-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100vh;
    background: var(--cart-dark);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

.floating-cart-panel.active {
    transform: translateX(0);
}

/* Header del panel */
.cart-panel-header {
    background: linear-gradient(135deg, var(--cart-primary), var(--cart-secondary));
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.cart-panel-header h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Contenido del panel */
.cart-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Scroll personalizado */
.cart-panel-content::-webkit-scrollbar {
    width: 8px;
}

.cart-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.cart-panel-content::-webkit-scrollbar-thumb {
    background: var(--cart-primary);
    border-radius: 4px;
}

/* Carrito vacío */
.empty-cart-message {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-cart-icon {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
}

.empty-cart-message h4 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.empty-cart-message p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
}

.btn-browse-products {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--cart-primary), var(--cart-secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-browse-products:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(161, 1, 255, 0.3);
}

/* Items del carrito */
.cart-items-list {
    flex: 1;
    margin-bottom: 1.5rem;
}

.cart-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideInCart 0.4s ease;
}

@keyframes slideInCart {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(161, 1, 255, 0.3);
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: rgba(161, 1, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cart-primary);
    font-size: 1.5rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    color: white;
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.cart-item-price {
    color: var(--cart-success);
    font-weight: 700;
    font-size: 1.1rem;
}

.quantity-multiplier {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.cart-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove-item {
    width: 36px;
    height: 36px;
    background: rgba(255, 59, 59, 0.1);
    border: 1px solid rgba(255, 59, 59, 0.3);
    border-radius: 8px;
    color: var(--cart-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-item:hover {
    background: rgba(255, 59, 59, 0.2);
    transform: scale(1.1);
}

/* Sección de cupón */
.cart-coupon-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.coupon-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.coupon-input-floating {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.coupon-input-floating:focus {
    outline: none;
    border-color: var(--cart-primary);
    background: rgba(255, 255, 255, 0.08);
}

.coupon-input-floating::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn-apply-coupon {
    padding: 0.75rem 1.25rem;
    background: var(--cart-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-apply-coupon:hover {
    background: var(--cart-secondary);
    transform: translateY(-2px);
}

.coupon-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}

.coupon-message.success {
    background: rgba(0, 255, 127, 0.1);
    border: 1px solid rgba(0, 255, 127, 0.3);
    color: var(--cart-success);
}

.coupon-message.error {
    background: rgba(255, 59, 59, 0.1);
    border: 1px solid rgba(255, 59, 59, 0.3);
    color: var(--cart-danger);
}

.coupon-applied {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 255, 127, 0.1);
    border: 1px solid rgba(0, 255, 127, 0.3);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coupon-applied-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cart-success);
    font-size: 0.9rem;
}

.btn-remove-coupon {
    width: 28px;
    height: 28px;
    background: rgba(255, 59, 59, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--cart-danger);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-coupon:hover {
    background: rgba(255, 59, 59, 0.3);
    transform: rotate(90deg);
}

/* Resumen */
.cart-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.discount-row {
    color: var(--cart-success);
}

.discount-amount {
    font-weight: 700;
}

.total-row {
    padding-top: 0.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.total-amount {
    color: var(--cart-success);
    font-size: 1.3rem;
}

/* Acciones del carrito */
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-continue-shopping,
.btn-checkout {
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-continue-shopping {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-continue-shopping:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--cart-primary);
}

.btn-checkout {
    background: linear-gradient(135deg, var(--cart-primary), var(--cart-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(161, 1, 255, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(161, 1, 255, 0.4);
}

/* Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Notificaciones del carrito */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cart-notification.success {
    border-left: 4px solid var(--cart-success);
    color: var(--cart-success);
}

.cart-notification.error {
    border-left: 4px solid var(--cart-danger);
    color: var(--cart-danger);
}

.cart-notification.info {
    border-left: 4px solid var(--cart-primary);
    color: var(--cart-primary);
}

.cart-notification i {
    font-size: 1.25rem;
}

.cart-notification span {
    color: white;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .floating-cart-panel {
        width: 100%;
    }

    .floating-cart-button {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
}
