/* ===================================
   MODAL DE PIZZA - Estilos Completos
   =================================== */

/* Modal Overlay */
.modal-pizza {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-pizza-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* Modal Content */
.modal-pizza-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Header */
.modal-pizza-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-pizza-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.btn-fechar-pizza {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-fechar-pizza:hover {
    color: #333;
}

/* Body */
.modal-pizza-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Seções */
.pizza-secao {
    margin-bottom: 30px;
}

.pizza-secao h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    border-left: 4px solid #8B5CF6;
    padding-left: 12px;
}

/* TAMANHOS */
.tamanhos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.tamanho-opcao {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.tamanho-opcao:hover {
    border-color: #8B5CF6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.tamanho-opcao.selected {
    border-color: #8B5CF6;
    background: #F3F0FF;
}

.tamanho-nome {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.tamanho-sigla {
    font-size: 24px;
    font-weight: bold;
    color: #8B5CF6;
    margin: 10px 0;
}

.tamanho-preco {
    font-size: 16px;
    color: #666;
    font-weight: 600;
}

/* QUANTIDADE DE SABORES */
.qtd-sabores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.qtd-sabor-opcao {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #666;
}

.qtd-sabor-opcao:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.qtd-sabor-opcao.selected {
    border-color: #8B5CF6;
    background: #F3F0FF;
    color: #8B5CF6;
}

/* CONTADOR DE SABORES */
.sabores-contador {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sabores-contador strong {
    color: #8B5CF6;
}

.limite-atingido {
    color: #EF4444;
    font-weight: 600;
    font-size: 14px;
}

/* SABORES GRID */
.sabores-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sabor-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: white;
    display: flex;            /* horizontal: imagem | texto */
    align-items: center;
    gap: 12px;
}
.sabor-imagem-container { flex-shrink: 0; }

.sabor-card:hover:not(.desabilitado) {
    border-color: #8B5CF6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.sabor-card.selecionado {
    border-color: #8B5CF6;
    background: #F3F0FF;
}

.sabor-card.desabilitado {
    opacity: 0.4;
    cursor: not-allowed;
}

.sabor-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;      /* tamanho fixo, sem distorcer */
    background: #f7f7f9;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.sabor-info { flex: 1; min-width: 0; text-align: left; }

.sabor-nome {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-align: left;
    line-height: 1.3;
}

.sabor-preco {
    font-size: 14px;
    font-weight: 700;
    color: #8B5CF6;
    margin-top: 4px;
}

.sabor-check {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8B5CF6;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* RESUMO */
.resumo-pizza {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.resumo-pizza p {
    margin: 8px 0;
    font-size: 14px;
}

.resumo-pizza ul {
    margin: 8px 0;
    padding-left: 20px;
}

.resumo-pizza li {
    font-size: 14px;
    margin: 4px 0;
}

/* Footer */
.modal-pizza-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancelar-pizza,
.btn-adicionar-pizza {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancelar-pizza {
    background: #f5f5f5;
    color: #666;
}

.btn-cancelar-pizza:hover {
    background: #e0e0e0;
}

.btn-adicionar-pizza {
    background: #8B5CF6;
    color: white;
}

.btn-adicionar-pizza:hover:not(:disabled) {
    background: #7C3AED;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-adicionar-pizza:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* MOBILE */
@media (max-width: 768px) {
    .modal-pizza-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-pizza-header h2 {
        font-size: 20px;
    }
    
    .tamanhos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qtd-sabores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sabores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-pizza-footer {
        flex-direction: column;
    }
    
    .btn-cancelar-pizza,
    .btn-adicionar-pizza {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sabores-grid {
        grid-template-columns: 1fr;
    }
}
