/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --header-bg: #aba397; /* cor de fundo do header reverted to previous #aba397 */
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000000;
    --footer-bg: #2b2b2b; /* cor de fundo do footer alterada para cinza mais escuro */
    --footer-text: #f7f7f7; /* tom claro para textos do footer (um pouco mais claro) */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    /* Solid header color with subtle shadow */
    background: var(--header-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 180px; /* espaço vertical para a logo */
    position: relative; /* permite centralizar a logo com posicionamento absoluto */
}

.logo {
    display: inline-block;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    position: absolute; /* centraliza a logo no header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    background: var(--header-bg);
    padding: 0.45rem 0.65rem;
    border-radius: 0.75rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    overflow: hidden; /* recorta a imagem para esconder bordas quadradas */
}

.logo-img {
    height: 11rem; /* aumentada para mais presença visual */
    width: auto;
    max-width: 420px;
    display: block;
    /* imagem é recortada pelo container .logo (overflow:hidden) — manter borda neutra */
    border-radius: 0; 
    background-color: transparent;
}

/* Styling específico para a Logo Final: ajuda a "disfarçar" o fundo do header
   de forma que o destaque fique nas palavras (dependendo da imagem, mix-blend-mode
   reduz a percepção do fundo). Ajuste conforme necessário. */
/* .logo-img.logo-final left intentionally without forced blending to preserve
    the original image rendering. Keep class available for future tweaks. */

/* Ajuste responsivo: reduz um pouco a logo em telas pequenas */
@media (max-width: 640px) {
    .logo-img {
        height: 7.5rem; /* maior em mobile para melhor visibilidade */
        max-width: 320px;
    }
    .logo {
        padding: 0.375rem 0.5rem;
        border-radius: 0.5rem;
    }
    /* Garante que a logo não sobreponha botões móveis (leve redução de z-index) */
    .logo {
        z-index: 50;
    }
    .header-content {
        height: 140px; /* ajustar a altura no mobile para acomodar a logo maior */
    }
}

@media (min-width: 1024px) {
    /* em telas maiores, garantir que o espaçamento continue confortável */
    .header-content {
        height: 220px; /* mais espaço para a logo grande em desktops */
    }
    .logo-img {
        height: 12.5rem;
        max-width: 620px;
    }
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 1.25rem; /* reduzido para caber melhor próximo à logo */
}

@media (min-width: 768px) {
    /* Em telas de tablet/desktop mantemos a nav no fluxo normal (lado esquerdo)
       para garantir que todos os itens fiquem visíveis. A logo segue centralizada
       via posicionamento absoluto. */
    .nav-desktop {
        display: flex;
        justify-content: space-between; /* separa grupos left / right */
        gap: 1.5rem;
        align-items: center;
        position: static; /* manter no fluxo para ser exibida no lado esquerdo */
        z-index: 80; /* acima da logo (60) para evitar sobreposição */
        width: 100%;
    }

    /* Containers para agrupar os itens à esquerda e à direita da logo */
    .nav-left, .nav-right {
        display: flex;
        gap: 1rem; /* reduzido para aproximar visualmente os itens */
        align-items: center;
    }
    .nav-right {
        /* garante que o grupo direito fique alinhado à direita do nav */
        justify-content: flex-end;
        /* desloca levemente o grupo direito para a esquerda, aproximando-o da logo central */
        transform: translateX(-0.9rem);
    }
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem; /* aumenta a área clicável */
    font-size: 1rem; /* maior legibilidade */
    border-radius: 0.375rem;
}

.nav-link:hover {
    color: var(--primary);
}

/* Botão do dropdown 'Produtos' deve parecer com os demais links */
.nav-dropdown .nav-dropdown-btn {
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    font: inherit;
    cursor: pointer;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.375rem;
}

.nav-dropdown .nav-dropdown-btn:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.02);
}

@media (min-width: 1024px) {
    .nav-link {
        padding: 0.6rem 0.9rem;
        font-size: 1.0625rem;
    }
    .nav-desktop {
        right: calc(50% + 1.25rem); /* empurra um pouco mais para a esquerda em telas grandes */
    }
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    width: 12rem;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Tecidos dropdown/card (click-to-toggle) */
.tecidos-dropdown {
    position: relative;
}
.tecidos-card {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 36rem;
    max-width: calc(100vw - 2rem);
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.18s ease;
    z-index: 120; /* acima do logo */
}
.tecidos-dropdown.open .tecidos-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.tecidos-card h3 { margin: 0; }
.tecidos-grid, #tecidosGrid, #mobileTecidosGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.tecidos-grid img, #tecidosGrid img, #mobileTecidosGrid img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Responsividade do grid de Tecidos */
@media (max-width: 1024px) {
    #tecidosGrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tecidos-card { right: 0; left: 0; margin-left: auto; margin-right: auto; width: calc(100% - 2rem); }
    #tecidosGrid { grid-template-columns: repeat(2, 1fr); }
    #mobileTecidosGrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    #tecidosGrid, #mobileTecidosGrid { grid-template-columns: 1fr; }
    .tecidos-card { width: calc(100% - 1.5rem); }
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.dropdown-link:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.dropdown-icon {
    width: 1rem;
    height: 1rem;
}

.mobile-menu-btn {
    display: block;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    position: relative; /* permite z-index funcionar no botão móvel */
    z-index: 80; /* garante que o botão móvel fique acima da logo centralizada */
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.menu-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gray-700);
}

.nav-mobile {
    display: none;
    padding: 1rem 0;
    border-top: 1px solid var(--gray-200);
}

.nav-mobile.active {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.mobile-nav-link:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.mobile-nav-section {
    padding: 0.75rem 1rem;
}

.mobile-nav-title {
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.mobile-category-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-category-link:hover {
    color: var(--primary);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 400px);
}

/* Banner */
.banner-section {
    padding: 2rem 0;
}

.main-banner {
    position: relative;
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .main-banner {
        height: 500px;
    }
}

.banner-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.banner-link:hover .banner-image {
    transform: scale(1.05);
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.banner-content {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    color: var(--white);
}

@media (min-width: 768px) {
    .banner-content {
        padding: 4rem;
    }
}

.banner-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .banner-title {
        font-size: 3rem;
    }
}

.banner-subtitle {
    font-size: 1.125rem;
    color: var(--gray-200);
    margin-bottom: 1.5rem;
    max-width: 32rem;
}

@media (min-width: 768px) {
    .banner-subtitle {
        font-size: 1.25rem;
    }
}

.banner-cta {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background 0.2s;
}

.banner-cta:hover {
    background: var(--primary-hover);
}

/* Grid Banners */
.grid-banner {
    position: relative;
    height: 12rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .grid-banner {
        height: 16rem;
    }
}

.grid-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4), transparent);
    z-index: 10;
}

.grid-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 1rem;
    color: var(--white);
}

@media (min-width: 768px) {
    .grid-banner-content {
        padding: 1.5rem;
    }
}

.grid-banner-title {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .grid-banner-title {
        font-size: 1.25rem;
    }
}

.grid-banner-subtitle {
    font-size: 0.875rem;
    color: var(--gray-200);
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .grid-banner-subtitle {
        font-size: 1rem;
    }
}

.grid-banners {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .grid-banners {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-banners {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Featured Section */
.featured-section {
    background: var(--gray-50);
    padding: 3rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Garantir que os cards ocupem a altura total da célula do grid e que o
   footer do card seja empurrado para a base, alinhando os botões */
.products-grid .product-card,
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-card-link {
    text-decoration: none;
    color: inherit;
}

.product-image-container {
    position: relative;
    height: 16rem;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* permite que a área de info cresça e empurre o footer */
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.product-card:hover .product-name {
    color: var(--primary);
}

.product-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    /* compat: definir propriedade padrão antes do prefixado */
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem; /* garante espaçamento consistente entre categoria e botão */
    margin-top: auto; /* empurra o footer para o final do card */
}

.product-category {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.product-btn {
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center; /* centraliza o texto/ícone do botão */
    min-width: 160px; /* largura mínima para alinhamento consistente */
}

.product-btn:hover {
    background: var(--primary-hover);
}

/* Footer */
.footer {
    background: var(--footer-bg); /* usar cor de footer separada */
    color: var(--footer-text);
    padding: 3rem 0;
    margin-top: 4rem;
}

/* Footer inline SVG logo sizing */
.footer-logo {
    width: 230px;
    height: auto;
    display: block;
}

/* Make inline SVG logo inherit footer text color (so it appears light on dark bg) */
.footer .footer-logo text {
    fill: currentColor;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--footer-text);
}

.footer-title-blue {
    color: #60a5fa;
}

    .footer-title-white {
    color: var(--white);
}

.footer-description {
    color: rgba(255,255,255,0.92);
    margin-bottom: 1rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--gray-400);
    transition: color 0.2s;
}

.social-link:hover {
    color: #60a5fa;
}

.social-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.footer-subtitle {
    color: var(--footer-text);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact {
    list-style: none;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.contact-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.contact-item span,
.contact-item a {
    color: var(--footer-text);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--primary);
}

.footer-hours {
    list-style: none;
    color: var(--gray-400);
}

.footer-hours li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.75);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--gray-600);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-900);
}

/* Utilitários */
.hidden {
    display: none !important;
}

