/* Importação de fontes (se usar Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Playfair+Display:wght@700&display=swap');

/* Variáveis CSS para cores e fontes */
:root {
    --primary-color: #A0522D; /* Marrom para destaque */
    --secondary-color: #D2B48C; /* Marrom claro para detalhes */
    --text-color: #333;
    --light-bg: #F8F8F8;
    --white: #FFFFFF;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* Reset básico e estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Botões */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* --- Cabeçalho --- */
.main-header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2em;
    color: var(--primary-color);
    margin: 0;
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--text-color);
    font-weight: 700;
    padding: 5px 0;
    position: relative;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none; /* Esconde o botão em telas grandes */
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--primary-color);
}

/* --- Seções Gerais --- */
section {
    padding: 60px 0;
    text-align: center;
}

section:nth-of-type(even) {
    background-color: var(--light-bg);
}

/* --- Hero Section --- */
.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('/img/hero-bg.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-blend-mode: multiply; /* Aplica o efeito de escurecimento */
    background-attachment: fixed; /* Efeito paralaxe */
    color: var(--white);
    padding: 100px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    min-height: 500px;
}

.hero-section h2 {
    font-size: 3.5em; /* Aumenta para telas maiores */
    margin-bottom: 20px;
    color: var(--white);
    text-transform: uppercase;
}

.hero-section p {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- About Section --- */
.about-section {
    background-color: var(--white);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
    flex-wrap: wrap; /* Permite que o conteúdo quebre linha em telas menores */
}

.artisan-photo {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    flex-shrink: 0; /* Impede que a imagem encolha */
    margin: 0 auto; /* Centraliza a imagem em telas pequenas */
}

.about-text {
    flex-grow: 1;
    max-width: 700px;
}

.about-text h3 {
    font-size: 2.2em;
}

.about-text p {
    margin-bottom: 15px; /* Espaçamento entre parágrafos, sem precisar de <br> */
}

.about-text .btn-primary{
    margin-top: 20px;
}

/* --- Products Section --- */
.product-filters {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transform: translateY(-2px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    transition: opacity 0.3s ease-out; /* Para o fade-out/in do filtro */
}

/* Animação para o grid durante a troca de filtro */
.product-grid.fading-out {
    opacity: 0;
}

.product-grid.fading-in {
    opacity: 1;
}

.product-item {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease-out, max-height 0.3s ease-out, margin 0.3s ease-out; /* Adicionado para animação de filtro */
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.product-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.product-item h4 {
    margin: 15px 15px 5px;
    font-size: 1.4em;
    color: var(--primary-color);
}

.product-item p {
    margin: 0 15px 10px;
    font-size: 0.9em;
    flex-grow: 1; /* Permite que o parágrafo ocupe o espaço restante */
}

.product-price {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 15px 15px;
}

.product-item .btn-secondary {
    display: block; /* Ocupa a largura total */
    margin: 0 15px 15px;
    padding: 8px 15px;
}

/* Esconde itens de produto para filtro e animação */
.product-item.hidden {
    opacity: 0;
    pointer-events: none; /* Desabilita cliques em itens escondidos */
    max-height: 0; /* Colapsa o espaço */
    margin: 0; /* Remove margem para não ocupar espaço */
    padding: 0; /* Remove padding para não ocupar espaço */
    border: none; /* Remove bordas para não ocupar espaço */
    box-shadow: none; /* Remove sombra */
    /* Garante que o item não ocupe espaço */
    flex-basis: 0;
    flex-shrink: 1;
}


/* --- Contact Section --- */
.contact-section {
    background-color: var(--white);
    padding-bottom: 80px;
}

.contact-info {
    margin-top: 30px;
    text-align: center;
}

.contact-info p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.contact-info a {
    font-weight: 700;
}

.social-links {
    margin-top: 20px;
    display: flex; /* Para centralizar os ícones */
    justify-content: center; /* Centraliza os ícones */
    gap: 20px; /* Espaço entre os ícones */
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    overflow: hidden;
}

.social-links img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.social-links a:hover img {
    transform: scale(1.1);
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 10px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-track img {
  width: 100%;
  flex-shrink: 0;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255,255,255,0.8);
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 1;
}

.carousel-button.prev {
  left: 10px;
}

.carousel-button.next {
  right: 10px;
}

/* --- Rodapé --- */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-nav ul {
    display: flex;
    gap: 20px;
}

.footer-nav ul li a {
    color: var(--white);
}

.footer-nav ul li a:hover {
    color: var(--secondary-color);
}

/* --- Animações para Rolagem (Intersection Observer) --- */
.hidden-initial {
    opacity: 0;
    transform: translateY(20px); /* Começa um pouco abaixo */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; /* Transição suave */
}

.fade-in-up {
    opacity: 1;
    transform: translateY(0); /* Desliza para a posição original */
}

/* --- Botão "Scroll to Top" --- */
.scroll-to-top {
    display: none; /* Escondido por padrão, JS controla a visibilidade */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2em;
    line-height: 50px; /* Centraliza o texto verticalmente */
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 999;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    opacity: 0; /* Inicia com opacidade 0 para transição suave */
    transform: translateY(10px); /* Começa ligeiramente abaixo */
}

.scroll-to-top.show {
    opacity: 1; /* Aparece */
    transform: translateY(0); /* Move para a posição final */
}

.scroll-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px); /* Pequeno efeito ao passar o mouse */
}


/* --- Responsividade --- */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Esconde o menu de navegação em telas menores */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; /* Ajuste se o header tiver altura diferente */
        left: 0;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 20px 0;
    }

    .main-nav.active {
        display: flex; /* Mostra o menu quando ativo */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .main-nav ul li {
        margin: 10px 0;
    }

    .menu-toggle {
        display: block; /* Mostra o botão do menu */
    }

    /* Ajuste para telas menores */
    .hero-section h2 {
        font-size: 2.5em; /* Volta para o tamanho menor em telas médias */
    }

    .hero-section p {
        font-size: 1em;
    }

    .about-content {
        flex-direction: column;
    }

    .artisan-photo {
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0;
        min-height: 400px;
    }

    .hero-section h2 {
        font-size: 2em;
    }

    h3 {
        font-size: 1.8em;
    }

    .main-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav ul {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5em;
    }

    .hero-section h2 {
        font-size: 1.8em;
    }

    .btn-primary, .btn-secondary {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .social-links {
        flex-direction: column; /* Coloca ícones sociais em coluna em telas muito pequenas */
        gap: 10px;
    }
}