/* Reset e Estilos Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #F5F5F5; /* Creme claro */
    color: #6B7280; /* Cinza escuro */
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tipografia */
h1, h2, h3 {
    color: #10764c; /* Verde principal */
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    font-size: 1rem;
}

/* Contêiner Principal */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cabeçalho */
header {
    background: linear-gradient(135deg, #10764c, #219653); /* Gradiente verde */
    color: #FFFFFF;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.search-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    width: 100%;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #10764c;
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background-color: #8B4513; /* Marrom acento */
    color: #FFFFFF;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    will-change: transform, background-color;
}

.search-bar button:hover {
    background-color: #A0522D;
    transform: scale(1.05);
}

.search-bar button:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Efeito Ripple */
@keyframes ripple {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Abas de Categoria */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background-color: #FFFFFF;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    will-change: background-color, color;
}

.tab-button:hover {
    background-color: #10764c;
    color: #FFFFFF;
}

.tab-button.tab-active {
    background-color: #10764c;
    color: #FFFFFF;
    border-color: #10764c;
}

/* Container de Produtos */
#products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Cartão de Produto */
.product-card {
    background-color: #FFFFFF;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform, box-shadow;
    opacity: 0;
    transform: translateY(20px);
    animation: cardSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.product-card:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card .p-6 {
    padding: 1.5rem;
}

.product-card .bg-green-100 {
    background-color: #E6F0EA; /* Verde claro */
    color: #10764c;
}

.product-card .bg-gray-50 {
    background-color: #F9FAFB;
    border-radius: 0.75rem;
}

.product-card .text-green-700 {
    color: #10764c;
}

.product-card .view-details {
    background-color: #10764c;
    color: #FFFFFF;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    will-change: transform, background-color;
}

.product-card .view-details:hover {
    background-color: #219653;
    transform: scale(1.05);
}

.product-card .view-details:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Animação de Entrada dos Cartões */
@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensagem de Nenhum Produto */
#no-products {
    text-align: center;
    padding: 2rem;
    color: #6B7280;
    font-size: 1.25rem;
}

/* Modal */
#product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
}

#product-modal.active {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #FFFFFF;
    border-radius: 1rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    will-change: transform, opacity;
}

#product-modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content header {
    background: linear-gradient(135deg, #10764c, #219653);
    padding: 1.5rem;
    border-radius: 1rem 1rem 0 0;
}

.modal-content header h2 {
    color: #FFFFFF;
}

#close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #FFFFFF;
    cursor: pointer;
    transition: color 0.3s ease;
}

#close-modal:hover {
    color: #F5F5F5;
}

.modal-body {
    padding: 2rem;
}

.modal-body .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.modal-body img, .modal-body svg {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.modal-body img:hover, .modal-body svg:hover {
    transform: scale(1.05);
}

.modal-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

#modal-quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.quick-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #E6F0EA;
    color: #10764c;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    transform: translateX(-20px);
    opacity: 0;
    will-change: transform, opacity;
}

#product-modal.active .quick-link {
    animation: linkSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#product-modal.active .quick-link:nth-child(2) { animation-delay: 0.1s; }
#product-modal.active .quick-link:nth-child(3) { animation-delay: 0.2s; }
#product-modal.active .quick-link:nth-child(4) { animation-delay: 0.3s; }

.quick-link:hover {
    background-color: #10764c;
    color: #FFFFFF;
    transform: translateX(0) scale(1.05);
}

/* Animação de Entrada dos Links */
@keyframes linkSlideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#modal-nutritional-info {
    margin-top: 1rem;
}

.nutritional-info {
    font-size: 10px;
    color: #035533;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
}

#product-modal.active .nutritional-info {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

/* Tabela Nutricional */
.nutrition-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.nutrition-table th,
.nutrition-table td {
    padding: 0.75rem 0.75rem;
    border: 1px solid #E5E7EB;
    text-align: left;
    min-width: 80px;
    max-width: 150px;
}

.nutrition-table th {
    background-color: #10764c;
    color: #FFFFFF;
    font-weight: 600;
}

.nutrition-table td {
    background-color: #F9FAFB;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #products-container {
        grid-template-columns: 1fr;
    }

    .modal-body .grid {
        grid-template-columns: 1fr;
    }

    #modal-quick-links {
        grid-template-columns: 1fr;
    }

    .nutrition-table th,
    .nutrition-table td {
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem;
        min-width: 60px;
    }
}