/*--------------------------------------------------------------
# Bloco 1 - Overlay do Sidebar
--------------------------------------------------------------*/
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/*--------------------------------------------------------------
# Bloco 2 - Sidebar Principal
--------------------------------------------------------------*/
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    height: 100%;
    background: linear-gradient(180deg, #1B2631 0%, #0F1419 100%);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-sidebar.active {
    right: 0;
}

/*--------------------------------------------------------------
# Bloco 3 - Header do Sidebar
--------------------------------------------------------------*/
.sidebar-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #2C3E50 0%, #1B2631 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    min-height: 60px;
}

.sidebar-title {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--primary-green);
    font-size: 1rem;
}

.cart-count-sidebar {
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 6px;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-close:hover {
    background: #F44336;
    border-color: #F44336;
    transform: scale(1.1);
}

/*--------------------------------------------------------------
# Bloco 4 - Conteúdo do Sidebar
--------------------------------------------------------------*/
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 3px;
}

/*--------------------------------------------------------------
# Bloco 5 - Lista de Itens do Carrinho
--------------------------------------------------------------*/
.cart-items {
    padding: 15px;
}

.cart-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(76, 175, 80, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-item:hover::before {
    opacity: 1;
}

/*--------------------------------------------------------------
# Bloco 6 - Header dos Itens
--------------------------------------------------------------*/
.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-item-name {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    margin-right: 8px;
}

.cart-item-remove {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #F44336;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.cart-item-remove:hover {
    background: #F44336;
    color: white;
    transform: scale(1.1);
}

/*--------------------------------------------------------------
# Bloco 7 - Conteúdo dos Itens
--------------------------------------------------------------*/
.cart-item-content {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cart-item-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-image img {
    transform: scale(1.05);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

/*--------------------------------------------------------------
# Bloco 8 - Detalhes dos Itens
--------------------------------------------------------------*/
.cart-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.cart-item-weight {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    white-space: nowrap;
}

.cart-item-weight i {
    font-size: 0.7rem;
    color: var(--primary-green);
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.8rem;
    white-space: nowrap;
    font-family: var(--font-primary);
}

/*--------------------------------------------------------------
# Bloco 9 - Controles de Quantidade
--------------------------------------------------------------*/
.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 2px;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.quantity-btn:hover {
    background: var(--primary-green);
    transform: scale(1.1);
}

.quantity-minus:hover {
    background: #F44336;
}

.quantity-display {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    color: white;
    font-size: 0.8rem;
}

.cart-item-subtotal {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 0.85rem;
    white-space: nowrap;
    font-family: var(--font-primary);
}

/*--------------------------------------------------------------
# Bloco 10 - Observações dos Itens
--------------------------------------------------------------*/
.cart-item-observations {
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    border-left: 2px solid var(--primary-green);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cart-item-observations i {
    color: var(--primary-green);
    font-size: 0.7rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.cart-item-observations span {
    color: rgba(255,255,255,0.9);
    font-size: 0.75rem;
    line-height: 1.3;
}

/*--------------------------------------------------------------
# Bloco 11 - Carrinho Vazio
--------------------------------------------------------------*/
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.cart-empty i {
    font-size: 3rem;
    color: rgba(76, 175, 80, 0.3);
    margin-bottom: 15px;
    display: block;
}

.cart-empty h4 {
    color: var(--primary-green);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-empty p {
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/*--------------------------------------------------------------
# Bloco 12 - Footer do Sidebar
--------------------------------------------------------------*/
.sidebar-footer {
    background: linear-gradient(135deg, #1B2631 0%, #0F1419 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/*--------------------------------------------------------------
# Bloco 13 - Resumo do Pedido
--------------------------------------------------------------*/
.order-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.summary-line:last-child {
    margin-bottom: 0;
}

.summary-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.summary-value {
    color: white;
    font-weight: 600;
    font-family: var(--font-primary);
}

.summary-total {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-total .summary-label,
.summary-total .summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-green);
    font-family: var(--font-primary);
}

/*--------------------------------------------------------------
# Bloco 14 - Botões de Ação Horizontais
--------------------------------------------------------------*/
.sidebar-actions-horizontal {
    display: flex;
    gap: 12px;
}

.sidebar-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.sidebar-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
}

.sidebar-btn:hover::before {
    width: 300px;
    height: 300px;
}

.sidebar-btn-primary {
    background: linear-gradient(135deg, var(--primary-green), #2E7D32);
    color: white;
    border: 2px solid transparent;
}

.sidebar-btn-primary:hover {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    color: white;
}

.sidebar-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-btn-secondary:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #F44336;
    color: #F44336;
}

.sidebar-btn:disabled {
    background: var(--gray-dark);
    color: var(--gray-medium);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sidebar-btn i {
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.sidebar-btn span {
    position: relative;
    z-index: 1;
}

/*--------------------------------------------------------------
# BLOCO 15 - NOTIFICAÇÕES TOAST COMPACTAS (CANTO INFERIOR ESQUERDO)
--------------------------------------------------------------*/
.notification-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    min-width: 280px;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.notification-toast.success {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    border-left: 3px solid #4CAF50;
}

.notification-toast.error {
    background: linear-gradient(135deg, #C62828, #B71C1C);
    border-left: 3px solid #F44336;
}

.notification-toast.warning {
    background: linear-gradient(135deg, #F57C00, #E65100);
    border-left: 3px solid #FF9800;
}

.notification-toast.info {
    background: linear-gradient(135deg, #1976D2, #0D47A1);
    border-left: 3px solid #2196F3;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 10px;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon.success { color: #A5D6A7; }
.toast-icon.error { color: #FFCDD2; }
.toast-icon.warning { color: #FFCC02; }
.toast-icon.info { color: #BBDEFB; }

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: white;
    letter-spacing: 0.3px;
}

.toast-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

/* Empilhamento de notificações */
.notification-toast:not(:last-child) {
    margin-bottom: 10px;
}

/* Animações */
@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/*--------------------------------------------------------------
# Bloco 16 - Animações do Carrinho
--------------------------------------------------------------*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: fadeInUp 0.3s ease-out;
}

.cart-item.new-item {
    animation: newItemPulse 1s ease-out;
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

@keyframes newItemPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
    }
}

@keyframes itemRemove {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 200px;
        margin-bottom: 12px;
    }
    50% {
        opacity: 0.5;
        transform: translateX(50px) scale(0.9);
        max-height: 200px;
    }
    100% {
        opacity: 0;
        transform: translateX(100px) scale(0.7);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.cart-item.removing {
    animation: itemRemove 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/*--------------------------------------------------------------
# Bloco 17 - Modal de Confirmação sobre Sidebar
--------------------------------------------------------------*/
#confirmModal {
    z-index: 10002 !important;
}

#confirmModal .modal-backdrop {
    z-index: 10001 !important;
    background: rgba(0, 0, 0, 0.85) !important;
}

#confirmModal .modal-dialog {
    z-index: 10003 !important;
}

body.modal-open #confirmModal {
    z-index: 10005 !important;
}

body.modal-open #confirmModal .modal-backdrop {
    z-index: 10004 !important;
}

/*--------------------------------------------------------------
# Bloco 18 - Responsivo Mobile
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .notification-toast {
        bottom: 90px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: calc(100% - 20px);
    }
    
    .toast-content {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .toast-icon {
        font-size: 1rem;
    }
    
    .toast-title {
        font-size: 0.8rem;
    }
    
    .toast-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .notification-toast {
        bottom: 85px;
    }
}
/*--------------------------------------------------------------
# CORREÇÃO: NOTIFICAÇÕES ACIMA DO SIDEBAR
--------------------------------------------------------------*/
.notification-toast {
    z-index: 10006 !important; /* Acima de tudo */
}

/* Garantir que notificações fiquem visíveis sempre */
body.modal-open .notification-toast {
    z-index: 10006 !important;
}

/* Quando sidebar estiver aberto */
.cart-sidebar.active ~ .notification-toast,
body:has(.cart-sidebar.active) .notification-toast {
    z-index: 10006 !important;
}
