/* ==========================================
   4. MODAIS, ALERTAS E DETALHES DO PRODUTO
========================================== */

/* Modais Genéricos e Alertas */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--card-bg); padding: 30px; border-radius: 8px; text-align: center; max-width: 300px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); }
.modal-btn { background: var(--primary-green); color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; margin-top: 15px; cursor: pointer; width: 100%; transition: background-color 0.2s;}
.modal-btn:hover { filter: brightness(0.9); }

/* Modal de Informações da Loja */
.info-modal-content { background: var(--card-bg); width: 100%; max-width: 480px; max-height: 90vh; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.info-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.info-modal-header h2 { font-size: 18px; font-weight: 700; color: var(--text-main);}
.close-btn { background: none; border: none; font-size: 20px; font-weight: bold; cursor: pointer; color: var(--text-main); }
.info-modal-body { padding: 20px; overflow-y: auto; }
.info-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.info-title-row h3 { font-size: 20px; font-weight: 700; max-width: 85%; color: var(--text-main);}
.info-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.info-icons { display: flex; gap: 10px; margin-bottom: 25px; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.icon-btn { background: transparent; border: 1px solid var(--border-color); border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; color: var(--text-main);}
.rating-badge { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; }
.info-section { margin-bottom: 25px; }
.info-section h4 { font-size: 16px; font-weight: 700; margin-bottom: 15px; color: var(--text-main);}
.address-text { font-size: 14px; color: var(--text-main); line-height: 1.5; }
.service-box { border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 15px; overflow: hidden; }
.service-box-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: transparent; }
.service-title { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-main);}
.service-details { padding: 15px; background: var(--bg-color); border-top: 1px solid var(--border-color); font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; transition: 0.3s;}
.service-details strong { color: var(--text-main); }
.warning-text { color: #ef4444; }
.hours-list { list-style: none; }
.hours-list li { display: flex; justify-content: space-between; padding: 10px 15px; font-size: 14px; color: var(--text-main); border-radius: 6px; }
.hours-list li.closed-day { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }

/* Modal de Detalhes do Produto (Montagem da Pizza) */
.product-detail-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--card-bg); z-index: 2000; display: flex; flex-direction: column; overflow: hidden; }
.product-detail-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); background: transparent; z-index: 10; }
.product-detail-header h2 { font-size: 18px; font-weight: 700; flex-grow: 1; text-align: center; color: var(--text-main);}
.back-btn { background: transparent; border: none; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; padding: 5px; }

.product-detail-layout { display: flex; flex-direction: row; flex-grow: 1; overflow: hidden; }
.product-detail-image-box { width: 45%; background-color: var(--bg-color); display: flex; justify-content: center; align-items: flex-start; padding: 30px; overflow-y: auto; transition: 0.3s;}
.product-detail-image-box img { width: 100%; max-width: 400px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.product-detail-options-box { width: 55%; padding: 30px; overflow-y: auto; background: transparent; }
.product-modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.product-modal-price { font-size: 18px; font-weight: 700; color: var(--text-main); margin-bottom: 30px; }

.option-group { margin-bottom: 30px; border-top: 1px solid var(--border-color); padding-top: 20px; transition: all 0.3s ease;}
.option-group-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.option-group-header h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text-main);}
.option-group-subtitle { font-size: 12px; color: var(--text-muted); }
.required-badge { background-color: var(--bg-color); color: var(--text-muted); font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 12px; border: 1px solid var(--border-color); transition: 0.3s;}
.required-badge.concluido { background-color: var(--primary-green); color: white; border-color: var(--primary-green); }

.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.option-label { display: flex; align-items: flex-start; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; cursor: pointer; transition: all 0.2s; user-select: none; }
.option-label.selected { border-color: var(--primary-green); background-color: rgba(16, 185, 129, 0.05); }
.option-label input { display: none; }
.custom-checkbox { width: 18px; height: 18px; border: 2px solid var(--border-color); border-radius: 4px; margin-right: 12px; margin-top: 2px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: 0.2s;}
.option-label input[type="radio"] + .custom-checkbox { border-radius: 50%; }
.option-label.selected .custom-checkbox { border-color: var(--primary-green); background-color: var(--primary-green); }
.option-label.selected .custom-checkbox::after { content: "✓"; color: white; font-size: 12px; font-weight: bold; }

.option-details { flex-grow: 1; }
.option-name { font-size: 14px; font-weight: 600; color: var(--text-main); display: block; }
.option-price { font-size: 12px; color: var(--text-muted); font-weight: 600; display: block; margin-top: 4px; }

.product-comments-area { width: 100%; min-height: 80px; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; font-size: 14px; resize: vertical; outline: none; background-color: transparent; color: var(--text-main); transition: 0.3s;}
.product-comments-area:focus { border-color: var(--primary-green); }

.product-detail-footer { position: absolute; bottom: 0; left: 0; right: 0; background: var(--card-bg); border-top: 1px solid var(--border-color); padding: 15px 30px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; box-shadow: 0 -5px 15px rgba(0,0,0,0.05); transition: 0.3s;}
.quantity-selector { display: flex; align-items: center; gap: 15px; border: 1px solid var(--border-color); border-radius: 8px; padding: 5px 15px; }
.qty-btn { background: transparent; border: none; font-size: 20px; font-weight: 600; color: var(--primary-green); cursor: pointer; padding: 0 10px; }
#product-qty { font-size: 16px; font-weight: 700; min-width: 20px; text-align: center; color: var(--text-main);}
.add-to-cart-btn { background: var(--primary-green); color: white; border: none; padding: 15px 30px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; transition: filter 0.2s; }
.add-to-cart-btn:hover { filter: brightness(0.9); }

/* Regras de Modo Escuro para Modais */
 .service-box-header,  .icon-btn { background-color: transparent; color: #f8fafc; border-color: #334155; }
 .service-box { border-color: #334155; }
 .service-details { background-color: #0f172a; border-top-color: #334155; }
 .product-detail-image-box { background-color: #0f172a; }
 .product-comments-area { background-color: #0f172a; color: #f8fafc; border-color: #334155; }
 .required-badge { background-color: #334155; color: #cbd5e1; border-color: #475569;}
 .required-badge.concluido { background-color: var(--primary-green); color: white; border-color: var(--primary-green); }
 .add-to-cart-btn { color: #fff; } 
 .rating-badge { background: rgba(217, 119, 6, 0.2); border-color: rgba(253, 230, 138, 0.3); color: #fbbf24;}
 .custom-checkbox { border-color: #475569; }
 .option-label.selected .custom-checkbox { border-color: var(--primary-green); }
 .option-label.selected { background-color: #334155; }

/* ==========================================
   CORREÇÃO: FUNDO SÓLIDO PARA OS MODAIS
========================================== */
/* Força os modais a terem um fundo branco 100% sólido no modo claro */
.modal-content, 
.info-modal-content, 
.product-detail-modal {
    background-color: #ffffff !important; 
}

/* Força os modais a terem um fundo escuro 100% sólido no modo escuro */
 .modal-content, 
 .info-modal-content, 
 .product-detail-modal {
    background-color: #1e293b !important; /* Um azul/cinza escuro bem elegante */
}

/* ==========================================
   BARRA DE ROLAGEM ELEGANTE PARA OS MODAIS
========================================== */
/* Afina a barra em qualquer área que tenha rolagem nos modais */
.info-modal-content::-webkit-scrollbar,
.info-modal-body::-webkit-scrollbar,
.product-detail-options-box::-webkit-scrollbar,
.product-detail-image-box::-webkit-scrollbar,
.modal-overlay::-webkit-scrollbar {
    width: 6px;
}

/* Fundo da barra invisível */
.info-modal-content::-webkit-scrollbar-track,
.info-modal-body::-webkit-scrollbar-track,
.product-detail-options-box::-webkit-scrollbar-track,
.product-detail-image-box::-webkit-scrollbar-track,
.modal-overlay::-webkit-scrollbar-track {
    background: transparent;
}

/* A "mola" da barra verde e semi-transparente */
.info-modal-content::-webkit-scrollbar-thumb,
.info-modal-body::-webkit-scrollbar-thumb,
.product-detail-options-box::-webkit-scrollbar-thumb,
.product-detail-image-box::-webkit-scrollbar-thumb,
.modal-overlay::-webkit-scrollbar-thumb {
    background-color: rgba(16, 185, 129, 0.4); /* Verde ET Pizzaria */
    border-radius: 10px;
}

/* Fica mais forte quando passa o mouse */
.info-modal-content::-webkit-scrollbar-thumb:hover,
.info-modal-body::-webkit-scrollbar-thumb:hover,
.product-detail-options-box::-webkit-scrollbar-thumb:hover,
.product-detail-image-box::-webkit-scrollbar-thumb:hover,
.modal-overlay::-webkit-scrollbar-thumb:hover {
    background-color: rgba(16, 185, 129, 0.8);
}
