/* --- Reset Básico e Globais --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}
h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #555;
}
/* --- Cabeçalho --- */
.site-header {
    background-color: #FFF159;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.site-header h1 {
    color: #002D6C;
    margin-bottom: 10px;
}
.search-bar-mock {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}
.search-bar-mock input {
    width: 80%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    border-right: none;
}
.search-bar-mock button {
    padding: 10px 15px;
    border: none;
    background-color: #3483FA;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}
/* --- Grade de Produtos --- */
.product-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}
.product-info {
    padding: 20px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 10px;
}
.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00a650;
    margin-bottom: 15px;
}
/* --- Rodapé --- */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #fff;
    border-top: 1px solid #eee;
    color: #888;
}
/* ============================================
   ESTILOS DO MODAL (POP-UP)
============================================
*/
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fff;
    margin: auto;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.9);}
    to {opacity: 1; transform: scale(1);}
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
}
.modal-close:hover {
    color: #333;
}
.modal-body {
    display: flex;
    padding: 30px;
    gap: 30px;
}
.modal-gallery {
    flex: 1;
}
#modal-main-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
}
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.thumbnail:hover, .thumbnail.active {
    border-color: #3483FA;
}
.modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#modal-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* --- ESTA É A CORREÇÃO DA DESCRIÇÃO --- */
#modal-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    /* flex-grow: 1; (REMOVIDO) */
    margin-bottom: 20px;
    white-space: pre-wrap;

    /* Define uma altura máxima */
    max-height: 250px;
    /* Adiciona uma barra de rolagem SÓ SE a descrição for maior */
    overflow-y: auto;
    /* Adiciona um espaço para a barra de rolagem */
    padding-right: 10px; 
}
/* --- FIM DA CORREÇÃO --- */

.modal-price-box {
    border-top: 1px solid #eee;
    padding-top: 20px;
}
.price-wrapper {
    margin-bottom: 15px;
}
.modal-price-old {
    font-size: 1.2rem;
    color: #888;
    text-decoration: line-through;
    display: none; /* Começa escondido */
}
.modal-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00a650;
    display: block;
    margin-bottom: 0;
}
.affiliate-button {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: #3483FA;
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}
.affiliate-button:hover {
    background-color: #2968C8;
}
@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
        padding: 20px;
    }
    .modal-content {
        width: 95%;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    #modal-title {
        font-size: 1.5rem;
    }
    .modal-price {
        font-size: 1.8rem;
    }
}