/* assets/css/cart.css */
/* Estilos para o novo sistema de carrinho Bliter GPL - Versão Mágica e Profissional */

:root {
    --magic-gold: #fbbf24;
    --magic-gold-dark: #b45309;
    --magic-green: #10b981;
    --magic-green-dark: #047857;
    --neon-blue: #3b82f6;
}

/* ---------------------------------- */
/* Botão "Adicionar ao Carrinho" Global */
/* ---------------------------------- */
.btn-add-to-cart {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}
.btn-add-to-cart i {
    font-size: 18px;
    color: var(--text-dark);
    transition: all 0.3s ease;
}
.btn-add-to-cart:hover {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent-hover);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.4);
}
.btn-add-to-cart:hover i {
    color: var(--background-dark);
}
.btn-add-to-cart.active {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent-hover);
}
.btn-add-to-cart.active i {
    color: var(--background-dark);
}
.btn-add-to-cart.active:hover {
    background-color: var(--primary-accent-hover);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.4);
}
.btn-add-to-cart:active {
    transform: scale(0.95);
}

/* ---------------------------------- */
/* Ícone Global do Carrinho (Floating) */
/* ---------------------------------- */
#global-cart-icon {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    z-index: 999;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#global-cart-icon.visible {
    transform: scale(1);
    opacity: 1;
}
.global-cart-button {
    width: 60px;
    height: 60px;
    background-color: var(--primary-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--background-dark);
    font-size: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 255, 140, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: cart-pulse 2s infinite ease-in-out;
}
.global-cart-button:hover {
    animation-play-state: paused;
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 255, 140, 0.7);
}
.global-cart-button:hover i {
    transform: rotate(-10deg) scale(1.1);
}
@keyframes cart-pulse {
    0% { box-shadow: 0 5px 20px rgba(0, 255, 140, 0.5); }
    50% { box-shadow: 0 5px 30px rgba(0, 255, 140, 0.8); }
    100% { box-shadow: 0 5px 20px rgba(0, 255, 140, 0.5); }
}
#global-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background-dark);
    transform: scale(0.9);
}

/* ---------------------------------- */
/* PÁGINA /carrinho */
/* ---------------------------------- */
#cart-page-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.cart-page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header-buttons {
    display: flex;
    gap: 0.75rem;
}

.cart-page-close-btn, .cart-page-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.cart-page-close-btn {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}
.cart-page-close-btn:hover {
    background-color: #3b82f6;
    color: var(--text-light);
    border-color: #60a5fa;
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.cart-page-clear-btn {
    background-color: #3f1212;
    border: 1px solid #7f1d1d;
    color: #fca5a5;
}
.cart-page-clear-btn:hover, .cart-page-clear-btn.confirming {
    background-color: #ef4444;
    color: white;
    border-color: #f87171;
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}
.cart-page-clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cart-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 1024px) {
    .cart-page-layout {
        grid-template-columns: 3fr 2fr;
    }
    .cart-page-summary-sticky {
        position: sticky;
        top: 2rem;
    }
}

.cart-page-items-column {
    background-color: transparent; 
}

.cart-modal-body {
    padding: 0; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========================================
   CARD DE ITEM (MAGIA VIVA)
   ATUALIZAÇÃO: Grid acomoda dois botões na esquerda
   ========================================= */
.cart-item {
    display: grid;
    /* Layout: Controles Tempo (col1) | Imagem | Detalhes | Ações (Preço/Lixo) */
    grid-template-columns: 60px 100px 1fr auto; 
    gap: 1.5rem;
    align-items: center;
    
    background: rgba(15, 23, 42, 0.6); 
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Borda Mágica Viva */
.cart-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 2px; 
    background: linear-gradient(90deg, transparent, var(--magic-green), var(--magic-gold), transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.4;
    background-size: 200% 100%;
    animation: shimmer-border 4s linear infinite;
    pointer-events: none;
}

.cart-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.8);
}
.cart-item:hover::before {
    opacity: 1;
}

@keyframes shimmer-border {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- WRAPPER PARA BOTÕES + e - --- */
.cart-item-plus-wrapper {
    display: flex;
    flex-direction: column; /* Botões um em cima do outro */
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

/* Estilo Base Botão de Tempo */
.btn-plus-professional, .btn-minus-professional {
    width: 100%;
    height: 30px; /* Altura menor para caber os dois */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border: 1px solid;
}

/* Botão Mais */
.btn-plus-professional {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--magic-green);
}
.btn-plus-professional:hover {
    background: var(--magic-green);
    color: #000;
    box-shadow: 0 0 10px var(--magic-green);
}

/* Botão Menos (Novo) */
.btn-minus-professional {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.btn-minus-professional:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 10px #f59e0b;
}

.btn-plus-professional:active, .btn-minus-professional:active {
    transform: scale(0.95);
}

.cart-item-image-wrapper {
    width: 100px;
    height: 56px; 
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.cart-item:hover .cart-item-image {
    transform: scale(1.1);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-title-link h4 {
    font-size: 1rem; /* Diminuído conforme pedido */
    font-weight: 700;
    color: white;
    letter-spacing: 0.01em;
}
.cart-item-title-link:hover h4 {
    color: var(--magic-gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.cart-item-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
}
.cart-item-type.product { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.cart-item-type.tool { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.3); }

/* Badge de Tempo de Acesso (Real Time) */
.access-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--magic-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}
.access-time-badge.updated {
    background: rgba(16, 185, 129, 0.4);
    color: white;
    box-shadow: 0 0 10px var(--magic-green);
    transform: scale(1.05);
}

/* --- AÇÕES (PREÇO + LIXEIRA) LADO A LADO --- */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem; 
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.cart-item-price-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--magic-gold);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}
.price-icon {
    color: #f59e0b;
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.price-suffix {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
}

.cart-item-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cart-item-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* =========================================
   RODAPÉ E CHECKOUT (MAGIA FINAL)
   ========================================= */
.cart-modal-footer {
    position: relative;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.cart-modal-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(90deg, transparent, var(--magic-gold), var(--magic-green), transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.6;
    background-size: 200% 100%;
    animation: shimmer-border 5s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.cart-modal-footer-total {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    font-weight: 700;
}

.total-amount {
    font-size: 2rem;
    font-weight: 900;
    color: var(--magic-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* --- BOTÃO CHECKOUT PROFISSIONAL & MÁGICO (Estilo Novo) --- */
.btn-checkout {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 1.5rem;
    margin-top: 1.5rem;
    /* Fundo base escuro com gradiente radial de energia */
    background: radial-gradient(circle at center, #059669 0%, #064e3b 100%);
    border: 1px solid #34d399;
    border-radius: 0.75rem;
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), inset 0 0 10px rgba(16, 185, 129, 0.5);
    text-decoration: none;
}

/* Efeito de "Mana" Fluindo */
.btn-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg) translateX(-150%);
    transition: transform 0.5s;
    animation: mana-flow 3s infinite linear;
}

@keyframes mana-flow {
    0% { transform: skewX(-20deg) translateX(-150%); }
    50% { transform: skewX(-20deg) translateX(0%); }
    100% { transform: skewX(-20deg) translateX(150%); }
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.6), inset 0 0 20px rgba(52, 211, 153, 0.4);
    border-color: #6ee7b7;
    background: radial-gradient(circle at center, #059669 30%, #064e3b 100%);
    text-shadow: 0 0 10px #ffffff;
}

.btn-checkout:active {
    transform: scale(0.98);
}

.btn-checkout i {
    font-size: 1.4rem;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0% { transform: scale(1); text-shadow: 0 0 5px white; }
    50% { transform: scale(1.2); text-shadow: 0 0 15px white; }
    100% { transform: scale(1); text-shadow: 0 0 5px white; }
}

.btn-checkout.disabled {
    background: #1e293b;
    border-color: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
}
.btn-checkout.disabled::before { display: none; }
.btn-checkout.disabled i { animation: none; }

/* Notas do rodapé (Typing Effect Container) */
#cart-footer-note {
    position: relative;
    z-index: 2;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--magic-green);
    text-align: center;
    margin-top: 1.5rem;
    background: rgba(0,0,0,0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px dashed rgba(16, 185, 129, 0.4);
    min-height: 3.5rem; /* Altura fixa para evitar pulos */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

/* Cursor piscando para o efeito de digitação */
#cart-footer-note::after {
    content: '|';
    animation: blink-cursor 1s infinite;
    color: white;
    margin-left: 2px;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* MOBILE */
@media (max-width: 640px) {
    .cart-item {
        /* No mobile: Controles (col1) | Imagem (col2) | Detalhes (col3) */
        grid-template-columns: 50px 80px 1fr; 
        gap: 1rem;
    }
    .cart-item-actions {
        grid-column: 1 / -1; 
        justify-content: space-between;
        margin-top: 0.5rem;
    }
}