/* ========================================
   CARRINHO LATERAL (SIDEBAR)
   ======================================== */

#cart-popup {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    transition: background 0.4s ease;
    opacity: 0;
}

#cart-popup.show {
    display: flex !important;
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}

/* Sidebar do carrinho */
#cart-popup .popup-content {
    position: absolute;
    right: 0;
    top: 0;
    width: 450px;
    max-width: 90%;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

#cart-popup.show .popup-content {
    transform: translateX(0);
}

/* Header do carrinho */
.cart-sidebar-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cart-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cart-sidebar-header .close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-sidebar-header .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Conteúdo do carrinho */
#cart-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Item do carrinho */
.cart-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Imagem do produto no carrinho */
.cart-item-image {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}
/* Informações do produto */
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-item-details {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.cart-item-quantity {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.cart-item-price {
    color: #28a745;
    font-weight: 600;
}

.cart-remove-button {
    background: #dc3545;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-remove-button:hover {
    background: #c82333;
    transform: scale(1.1);
}

.cart-remove-button img {
    filter: brightness(0) invert(1);
}

/* Mensagem de carrinho vazio */
#cart-popup-content > div {
    text-align: center;
    padding: 20px 20px;
    color: #999;
}

#cart-popup-content i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Footer do carrinho */
.cart-sidebar-footer {
    background: white;
    border-top: 2px solid #e9ecef;
    padding: 20px;
}

#cart-total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Notificação de valor mínimo */
#minimum-value-notification {
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Botões de ação */
.cart-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

#choose-more-button,
#send-order-button {
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#choose-more-button {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

#choose-more-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#send-order-button {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#send-order-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1aa179);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

#send-order-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6c757d;
    box-shadow: none;
}

/* Responsivo - Mobile */
/* Responsivo - Mobile */
@media (max-width: 768px) {
    #cart-popup .popup-content {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        left: 0 !important;
    }
    
    #cart-popup {
        display: none !important;
    }
    
    #cart-popup.show {
        display: flex !important;
        opacity: 1 !important;
        background: rgba(0, 0, 0, 0.5) !important;
    }
    
    .cart-sidebar-header h2 {
        font-size: 18px;
    }
    
    .cart-item {
        padding: 12px;
    }
    
    .cart-item p {
        font-size: 13px;
    }
    
    #cart-total {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    #choose-more-button,
    #send-order-button {
        font-size: 14px;
        padding: 12px;
    }
}

/* Scrollbar personalizada */
#cart-popup-content::-webkit-scrollbar {
    width: 8px;
}

#cart-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#cart-popup-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

#cart-popup-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}
/* ========================================
   FIX MOBILE - FORÇAR EXIBIÇÃO
   ======================================== */

@media (max-width: 1024px) {
    #cart-popup {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        z-index: 99999 !important;
    }
    
    #cart-popup.show {
        display: flex !important;
        opacity: 1 !important;
    }
    
    #cart-popup .popup-content {
        width: 100% !important;
        max-width: 100% !important;
        transform: translateX(0) !important;
    }
    
    /* Garantir que o botão do carrinho apareça */
    .cart-button {
        display: flex !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9998 !important;
    }
}