* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C63FF;
    --secondary: #FF6584;
    --accent: #4ECDC4;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #f5f5f5;
    --success: #00d4aa;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--light);
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(108, 99, 255, 0.2);
    border-bottom: 3px solid var(--primary);
}

header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent);
}

.carrinho-icon {
    position: relative;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
}

.carrinho-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.5);
}

.carrinho-icon::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--secondary) 0%, #ff4757 100%);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 3px 15px rgba(255, 101, 132, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Main */
main.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
}

main h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--light);
    position: relative;
    padding-left: 20px;
}

main h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 30px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
}

/* Grid de Produtos */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .produtos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .produtos-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Card de Produto - MAIS COMPACTO */
.produto-card {
    background: linear-gradient(145deg, rgba(108, 99, 255, 0.1) 0%, rgba(78, 205, 196, 0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(108, 99, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.produto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.produto-card:hover::before {
    transform: scaleX(1);
}

.produto-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(108, 99, 255, 0.3);
}

.produto-img {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(78, 205, 196, 0.2) 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.produto-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.produto-card:hover .produto-img::after {
    transform: translateX(100%);
}

.produto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.img-placeholder::before {
    content: '';
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.produto-nome {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--light);
    font-weight: 600;
    min-height: 2.2rem;
    line-height: 1.2;
}

.produto-preco {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
}

.btn-add {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 170, 0.5);
}

.btn-add:active {
    transform: translateY(0);
}

/* Carrinho Lateral */
.carrinho-lateral {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.7);
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 200;
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--primary);
}

.carrinho-lateral.active {
    right: 0;
}

.carrinho-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.carrinho-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.btn-fechar {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-fechar:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.carrinho-conteudo {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.carrinho-vazio {
    text-align: center;
    color: #888;
    padding: 3rem 0;
}

.carrinho-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(78, 205, 196, 0.05) 100%);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(108, 99, 255, 0.2);
    transition: all 0.3s;
}

.carrinho-item:hover {
    border-color: var(--primary);
    transform: translateX(-5px);
}

.carrinho-total {
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 2px solid var(--primary);
    font-size: 1.4rem;
    text-align: right;
    font-weight: 700;
}

.btn-finalizar {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 212, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-finalizar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 212, 170, 0.5);
}

.btn-limpar {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background: rgba(255, 101, 132, 0.2);
    color: var(--secondary);
    text-align: center;
    text-decoration: none;
    border-radius: 15px;
    margin-top: 0.8rem;
    transition: all 0.3s;
    font-weight: 600;
    border: 2px solid rgba(255, 101, 132, 0.3);
}

.btn-limpar:hover {
    background: rgba(255, 101, 132, 0.3);
    border-color: var(--secondary);
}

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup {
    background: linear-gradient(145deg, var(--darker) 0%, var(--dark) 100%);
    padding: 2.5rem;
    border-radius: 25px;
    border: 3px solid var(--primary);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(108, 99, 255, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup p {
    margin-bottom: 2rem;
    color: #ccc;
    font-size: 1.1rem;
}

.btn-continuar,
.btn-ver-carrinho {
    padding: 1rem 2rem;
    margin: 0.5rem;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-continuar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
}

.btn-ver-carrinho {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-continuar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.5);
}

.btn-ver-carrinho:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

.sem-produtos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: #888;
    font-size: 1.2rem;
}

/* Scrollbar Custom */
.carrinho-conteudo::-webkit-scrollbar {
    width: 8px;
}

.carrinho-conteudo::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.carrinho-conteudo::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
}

/* Otimizações Mobile */
@media (max-width: 768px) {
    /* Header mais compacto */
    header {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .logo::before {
        width: 6px;
        height: 6px;
        left: -10px;
    }
    
    .carrinho-icon {
        width: 45px;
        height: 45px;
    }
    
    .carrinho-icon::before {
        width: 20px;
        height: 20px;
    }
    
    .badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    /* Main mais compacto */
    main.container {
        margin: 1rem auto;
        padding: 0 15px;
    }
    
    main h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        padding-left: 15px;
    }
    
    main h2::before {
        width: 4px;
        height: 25px;
    }
    
    /* Grid produtos - 2 colunas com cards menores */
    .produtos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .produto-card {
        padding: 0.7rem;
        border-radius: 12px;
    }
    
    .produto-img {
        height: 90px;
        margin-bottom: 0.5rem;
        border-radius: 10px;
    }
    
    .img-placeholder {
        width: 50px;
        height: 50px;
        border-radius: 10px;
    }
    
    .img-placeholder::before {
        width: 25px;
        height: 25px;
    }
    
    .produto-nome {
        font-size: 0.8rem;
        min-height: 2rem;
        margin-bottom: 0.3rem;
    }
    
    .produto-preco {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-add {
        padding: 0.6rem;
        font-size: 0.75rem;
        border-radius: 8px;
        letter-spacing: 0.3px;
    }
    
       /* Carrinho lateral adaptado - 85% DA TELA */
    .carrinho-lateral {
        width: 85vw;
        max-width: 85vw;
        right: -85vw;
    }
    
    .carrinho-lateral.active {
        right: 0;
    }
    
    .carrinho-header {
        padding: 1rem;
        flex-shrink: 0;
    }
    
    .carrinho-header h3 {
        font-size: 1.1rem;
    }
    
    .btn-fechar {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .carrinho-conteudo {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 60px);
        overflow: hidden;
    }
    
    .carrinho-vazio-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
        overflow: hidden;
    }
    
    .carrinho-vazio {
        text-align: center;
        color: #888;
        font-size: 1rem;
    }
    
    .carrinho-footer {
        padding: 1rem;
        text-align: center;
        background: rgba(108, 99, 255, 0.1);
        border-top: 2px solid var(--primary);
        color: #aaa;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .carrinho-items-wrapper {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        min-height: 0;
    }
    
    .carrinho-item {
        padding: 0.7rem;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .carrinho-footer-actions {
        padding: 1rem;
        background: rgba(108, 99, 255, 0.05);
        border-top: 2px solid var(--primary);
        flex-shrink: 0;
    }
    
    .carrinho-total {
        padding: 0.5rem 0;
        font-size: 1.1rem;
        text-align: right;
        margin-bottom: 0.8rem;
        border-top: none;
    }
    
    .btn-finalizar {
        width: 100%;
        padding: 0.9rem;
        font-size: 0.9rem;
        border-radius: 12px;
        margin: 0 0 0.5rem 0;
        white-space: nowrap;
        overflow: visible;
    }
    
    .btn-limpar {
        width: 100%;
        display: block;
        padding: 0.7rem;
        font-size: 0.85rem;
        border-radius: 12px;
        margin: 0;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    
    /* Popup mobile */
    .popup {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        max-width: 85vw;
    }
    
    .popup h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .popup p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-continuar,
    .btn-ver-carrinho {
        padding: 0.9rem 1.5rem;
        font-size: 0.85rem;
        border-radius: 12px;
        display: block;
        width: 100%;
        margin: 0.4rem 0;
    }
}

/* Ajuste extra para telas muito pequenas */
@media (max-width: 380px) {
    .logo {
        font-size: 1.3rem;
    }
    
    main h2 {
        font-size: 1.3rem;
    }
    
    .produto-img {
        height: 85px;
    }
    
    .produto-nome {
        font-size: 0.75rem;
        min-height: 1.8rem;
    }
    
    .produto-preco {
        font-size: 1rem;
    }
    
    .btn-add {
        padding: 0.55rem;
        font-size: 0.7rem;
    }
}
