/*--------------------------------------------------------------
# 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
--------------------------------------------------------------*/
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 350px;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: slideInRight 0.4s ease-out;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.notification-toast.success {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    border-color: #4CAF50;
}

.notification-toast.error {
    background: linear-gradient(135deg, #C62828, #B71C1C);
    border-color: #F44336;
}

.notification-toast.warning {
    background: linear-gradient(135deg, #F57C00, #E65100);
    border-color: #FF9800;
}

.notification-toast.info {
    background: linear-gradient(135deg, #1976D2, #0D47A1);
    border-color: #2196F3;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon.success { color: #4CAF50; }
.toast-icon.error { color: #F44336; }
.toast-icon.warning { color: #FF9800; }
.toast-icon.info { color: #2196F3; }

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: white;
}

.toast-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.3;
}

/*--------------------------------------------------------------
# Bloco 16 - Animações
--------------------------------------------------------------*/
@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 slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/*--------------------------------------------------------------
# Bloco 17 - Responsivo Mobile
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .sidebar-header {
        padding: 12px 15px;
    }
    
    .sidebar-title {
        font-size: 1rem;
    }
    
    .cart-items {
        padding: 12px;
    }
    
    .cart-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .cart-item-image {
        width: 45px;
        height: 45px;
    }
    
    .sidebar-footer {
        padding: 12px;
    }
    
    .order-summary {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .sidebar-btn {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

/*--------------------------------------------------------------
# Bloco 18 - Responsivo Mobile Pequeno
--------------------------------------------------------------*/
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100vw;
    }
    
    .sidebar-header {
        padding: 10px 12px;
    }
    
    .sidebar-title {
        font-size: 0.95rem;
    }
    
    .cart-items {
        padding: 10px;
    }
    
    .cart-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .cart-item-image {
        width: 40px;
        height: 40px;
    }
    
    .cart-item-name {
        font-size: 0.85rem;
    }
    
    .sidebar-footer {
        padding: 10px;
    }
    
    .order-summary {
        padding: 8px;
    }
    
    .summary-line {
        font-size: 0.8rem;
    }
    
    .summary-total .summary-label,
    .summary-total .summary-value {
        font-size: 0.9rem;
    }
    
    .notification-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: unset;
        max-width: unset;
    }
}



/* ============================================
   ADICIONAR ao arquivo assets/css/sidebar.css
   (ou criar se não existir)
   ============================================ */

/* Estilo para notificações toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 350px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 10001;
    animation: slideInRight 0.4s ease-out;
    overflow: hidden;
}

.notification-toast.success {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    border-left: 4px solid #4CAF50;
}

.notification-toast.error {
    background: linear-gradient(135deg, #C62828, #B71C1C);
    border-left: 4px solid #F44336;
}

.notification-toast.warning {
    background: linear-gradient(135deg, #F57C00, #E65100);
    border-left: 4px solid #FF9800;
}

.notification-toast.info {
    background: linear-gradient(135deg, #1976D2, #0D47A1);
    border-left: 4px solid #2196F3;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    gap: 12px;
}

.toast-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}

.toast-icon.success { color: #A5D6A7; }
.toast-icon.error { color: #FFCDD2; }
.toast-icon.warning { color: #FFCC02; }
.toast-icon.info { color: #BBDEFB; }

.toast-message {
    flex: 1;
    color: white;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.toast-text {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.3;
}

/* Animações para toast */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading state para botão finalizar */
#finalizarPedido:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#finalizarPedido:disabled:hover {
    background: var(--primary-green) !important;
    transform: none !important;
}

/* Melhorias para o sidebar em mobile */
@media (max-width: 768px) {
    .notification-toast {
        right: 15px;
        left: 15px;
        min-width: auto;
    }
    
    .toast-content {
        padding: 12px 15px;
    }
    
    .toast-title {
        font-size: 0.95rem;
    }
    
    .toast-text {
        font-size: 0.85rem;
    }
}

/* Estilo para items destacados no carrinho */
.cart-item.new-item {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), transparent);
    border-left: 3px solid var(--accent-green);
    animation: highlightItem 1s ease-out;
}

@keyframes highlightItem {
    0% { 
        background: linear-gradient(90deg, rgba(76, 175, 80, 0.3), transparent);
    }
    100% { 
        background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), transparent);
    }
}

/* Melhorias no modal de confirmação */
.modal-content {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--primary-green);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-green), var(--accent-green));
    border-bottom: none;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    color: white;
    font-weight: 600;
}

.btn-close-white {
    filter: invert(1);
}

.modal-body p {
    color: var(--soft-white);
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal-footer .btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
}

.modal-footer .btn-secondary {
    background: var(--warm-gray);
    border: none;
}

.modal-footer .btn-primary {
    background: var(--primary-green);
    border: none;
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
}

/* Estados de loading melhorados */
.sidebar-loading {
    position: relative;
    overflow: hidden;
}

.sidebar-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255,255,255,0.2), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}