/* -----------------------------------------------------------
   1. Definições Base e Reset
----------------------------------------------------------- */
:root {
    --primary-color: #3498db; /* Azul inspirado no toldo */
    --primary-dark: #2980b9;
    --text-color: #333;
    --bg-color: #fff;
    --light-bg: #f9f9f9;
    --border-color: #eee;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    color: #222;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* -----------------------------------------------------------
   2. Componentes Comuns
----------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: center;
}

section {
    padding: 60px 0;
}

/* -----------------------------------------------------------
   3. Cabeçalho (Header)
----------------------------------------------------------- */
header {
    background-color: var(--bg-color);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 800;
}

.tagline {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav a {
    font-weight: 600;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--primary-color);
}

/* -----------------------------------------------------------
   4. Secção Hero (Corrigida para ocupar espaço total)
----------------------------------------------------------- */
.hero {
    background-color: var(--light-bg);
    padding: 0; /* Remove padding lateral para a imagem encostar se necessário */
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: stretch; /* Estica os itens para terem a mesma altura */
    min-height: 500px;
    padding: 0 20px;
}

.hero-content {
    flex: 1;
    padding: 60px 40px 60px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content h2 {
    font-size: 2.8rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 30px;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Preenche todo o espaço sem distorcer */
    object-position: center;
    border-radius: 0 0 10px 10px;
}

/* -----------------------------------------------------------
   5. Secção Sobre
----------------------------------------------------------- */
.sobre .sobre-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.sobre .sobre-images img {
    border-radius: 8px;
    height: 250px;
    object-fit: cover;
}

.sobre .destaque {
    background-color: #e3f2fd;
    padding: 20px;
    border-left: 5px solid var(--primary-color);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.destaque .anos {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.destaque .desc {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
}

/* -----------------------------------------------------------
   6. Secção Produtos
----------------------------------------------------------- */
.produtos {
    background-color: var(--light-bg);
}

.produtos h2, .produtos p.intro-text {
    text-align: center;
}

.produtos p.intro-text {
    max-width: 700px;
    margin: 0 auto 50px auto;
    color: #666;
}

.produtos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.produto-cat {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.produto-cat h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.produto-cat ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.produto-cat ul li:last-child {
    border-bottom: none;
}

.galeria {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.galeria img {
    border-radius: 8px;
    height: 300px;
    width: 100%;
    object-fit: cover;
}

/* -----------------------------------------------------------
   7. Secção Contactos
----------------------------------------------------------- */
.contactos h2 {
    text-align: center;
    margin-bottom: 50px;
}

.contacts-horario {
    align-items: start;
    grid-template-columns: 1fr 1fr;
}

.info-bloco {
    padding: 20px;
}

.info-bloco h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.info-bloco p, .horario ul li {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.horario ul li {
    margin-bottom: 12px;
}

.horario strong {
    display: inline-block;
    width: 140px;
}

.horario .sep {
    color: #ccc;
    margin: 0 5px;
}

.fone a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* -----------------------------------------------------------
   8. Rodapé (Footer)
----------------------------------------------------------- */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 5px;
}

/* ===========================================================
   9. Media Queries (Adaptabilidade Móvel)
=========================================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    header .container {
        flex-direction: column;
        text-align: center;
    }

    .logo-area {
        margin-bottom: 15px;
    }

    nav ul {
        justify-content: center;
    }

    /* Ajuste Hero Mobile */
    .hero .container {
        flex-direction: column;
        min-height: auto;
        padding: 0;
    }

    .hero-content {
        order: 2;
        padding: 40px 20px;
        text-align: center;
        align-items: center;
    }

    .hero-image {
        order: 1;
        width: 100%;
        height: 250px; /* Altura fixa para a imagem no mobile */
    }

    .hero-image img {
        position: relative;
        border-radius: 0;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .grid-2, .produtos-grid, .galeria, .contacts-horario {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sobre .sobre-images img {
        height: 150px;
    }

    .horario strong {
        display: block;
        width: auto;
        margin-bottom: 3px;
    }
}

/* Container Principal */
.chatwidget_A_container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* Botão Flutuante */
.chatwidget_A_launcher {
    width: 60px;
    height: 60px;
    background-color: #3498db;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

.chatwidget_A_launcher:hover { transform: scale(1.1); }

/* Janela de Chat */
.chatwidget_A_window {
    display: none;
    width: 320px;
    height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
}

.chatwidget_A_header {
    background: #3498db;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.chatwidget_A_messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chatwidget_A_msg_row { margin-bottom: 10px; display: flex; }
.chatwidget_A_msg_user { justify-content: flex-end; }

.chatwidget_A_bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 14px;
}

.chatwidget_A_bubble_bot { background: #eee; color: #333; }
.chatwidget_A_bubble_user { background: #3498db; color: white; }

.chatwidget_A_input_area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
}

.chatwidget_A_input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

/* -----------------------------------------------------------
   10. Banner de Cookies (RGPD PT)
----------------------------------------------------------- */
.cookie_container_A {
    display: none; /* Escondido por padrão, mostrado via JS */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    z-index: 11000; /* Acima do chatwidget */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.cookie_content_A {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie_content_A p {
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.cookie_buttons_A {
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

.cookie_btn_A {
    padding: 8px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: 0.3s;
}

.cookie_accept_A {
    background-color: var(--primary-color);
    color: white;
}

.cookie_accept_A:hover {
    background-color: var(--primary-dark);
}

.cookie_link_A {
    color: #bdc3c7;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* Ajuste Mobile para Cookies */
@media (max-width: 768px) {
    .cookie_content_A {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie_buttons_A {
        width: 100%;
        justify-content: center;
    }
    
    .cookie_container_A {
        padding: 15px;
    }
}

/* --- Estilos do Menu Hambúrguer --- */
.mobile-menu-btn {
    display: none; /* Escondido no Desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    transition: 0.3s;
}

/* Animação para transformar em "X" quando ativo */
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* --- Ajustes Mobile (Media Query) --- */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex; /* Mostra o botão no Mobile */
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%; /* Escondido à direita */
        width: 70%;
        height: 100vh;
        background-color: #fff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: 0.4s;
        z-index: 1000;
        padding-top: 80px;
    }

    nav.active {
        right: 0; /* Desliza para dentro do ecrã */
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    nav ul li a {
        font-size: 1.2rem;
    }

    header .container {
        justify-content: space-between;
        flex-direction: row; /* Mantém logo e botão lado a lado */
        text-align: left;
    }
}

/* Estilos específicos para a página de termos legais */

.legal-page {
    padding: 60px 20px;
    max-width: 800px; /* Texto mais estreito para facilitar a leitura */
    margin: 0 auto;
    line-height: 1.8;
}

.legal-page h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.legal-page h2 {
    font-size: 1.5rem;
    margin-top: 40px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.legal-page p {
    margin-bottom: 20px;
    color: #555;
}

.legal-page ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.legal-page ul li {
    list-style-type: disc;
    margin-bottom: 10px;
    color: #555;
}

/* Destaque para o Disclaimer do Chat */
.disclaimer-box {
    background-color: #fff9e6; /* Amarelo muito suave para alertar o utilizador */
    padding: 30px;
    border-radius: 8px;
    border-left: 5px solid #f1c40f; /* Cor de atenção */
    margin: 40px 0;
}

.disclaimer-box h2 {
    margin-top: 0;
    border-bottom-color: #fbeebc;
    color: #856404;
}

.disclaimer-box ul li {
    color: #856404;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

/* Adaptabilidade Mobile */
@media (max-width: 768px) {
    .legal-page {
        padding: 40px 15px;
    }
    
    .legal-page h1 {
        font-size: 1.8rem;
    }
    
    .disclaimer-box {
        padding: 20px;
    }
}

/* --- Estilos da Página de Produtos --- */

.produtos-intro {
    text-align: center;
    padding: 60px 0 40px;
}

.produtos-intro h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* Secção de Produtos Especiais (Destaque) */
.produtos-especiais {
    background-color: #f0f7ff;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 50px;
    border: 1px solid #d0e4f7;
}

.destaque-header {
    text-align: center;
    margin-bottom: 30px;
}

.badge {
    background: #e67e22;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.especiais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.especial-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.especial-card:hover {
    transform: translateY(-5px);
}

.especial-card img {
    margin: 0 auto 15px;
    opacity: 0.8;
}

.especial-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

/* Categorias Gerais */
.categorias-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.categoria-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.cat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.marcas-tags {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marcas-tags span {
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

.categoria-box ul {
    margin-top: 20px;
    padding-left: 20px;
}

.categoria-box ul li {
    list-style: disc;
    margin-bottom: 8px;
    color: #444;
}

/* Call to Action */
.ajuda-produtos {
    text-align: center;
    padding-bottom: 60px;
}

.ajuda-card {
    background: var(--primary-color);
    color: white;
    padding: 40px;
    border-radius: 15px;
}

.ajuda-card h3 { color: white; }
.ajuda-card .btn {
    background: white;
    color: var(--primary-color);
    margin-top: 20px;
}

/* Mobile */
@media (max-width: 768px) {
    .categorias-grid {
        grid-template-columns: 1fr;
    }
    
    .produtos-especiais {
        padding: 20px;
    }
}

/* --- Estilos da Página Sobre Nós --- */

.sobre-nos-page {
    line-height: 1.8;
    color: #444;
}

.text-center { text-align: center; }

/* Legado / Antiguidade */
.sobre-heranca {
    padding: 80px 0;
    background: #fff;
}

.superior-tag {
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.sobre-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.sobre-info h1 {
    font-size: 2.8rem;
    margin-top: 10px;
}

.stat-item {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 4px solid var(--primary-color);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 1rem;
    color: #777;
    font-weight: 600;
}

/* Atendimento */
.sobre-atendimento {
    padding: 60px 0;
    background: var(--primary-color);
    color: white;
}

.atendimento-card {
    max-width: 900px;
    margin: 0 auto;
}

.atendimento-content h2 { color: white; font-size: 2.2rem; }
.atendimento-content p { font-size: 1.2rem; opacity: 0.9; }

.check-list {
    margin-top: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.check-list li {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Inventário / Produtos */
.sobre-inventario {
    padding: 80px 0;
    background: #fdfdfd;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.inventario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.inventario-col {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.icon-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.icon-header h3 {
    margin-bottom: 0;
    color: var(--primary-dark);
}

.marcas-banner {
    margin-top: 50px;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    font-style: italic;
    color: #888;
}

/* Compromisso Final */
.sobre-compromisso {
    padding: 80px 0;
    background: var(--light-bg);
}

.sobre-compromisso h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

/* Responsividade */
@media (max-width: 768px) {
    .sobre-grid, .inventario-grid, .check-list {
        grid-template-columns: 1fr;
    }
    
    .sobre-info h1 {
        font-size: 2rem;
    }
    
    .atendimento-content h2 {
        font-size: 1.8rem;
    }
}

/* Animação de Digitação (Loading) */
.chatwidget_A_typing {
    display: none; /* Escondido por padrão */
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #eee;
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 10px;
}

.chatwidget_A_dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: chatwidget_A_bounce 1.4s infinite ease-in-out both;
}

.chatwidget_A_dot:nth-child(1) { animation-delay: -0.32s; }
.chatwidget_A_dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatwidget_A_bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Estilo adaptado para Afonso e Tomaz Lda. */
.produtos_container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.produtos_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.produtos_card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    transition: transform 0.2s ease;
}

.produtos_card:hover {
    transform: scale(1.02);
}

.produtos_imagem {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.produtos_info {
    padding: 15px;
}

.produtos_categoria {
    font-size: 0.7rem;
    font-weight: bold;
    color: #007bff;
    text-transform: uppercase;
}

.produtos_nome {
    margin: 8px 0;
    font-size: 1.1rem;
    color: #333;
}

.produtos_descricao {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Mobile */
@media (max-width: 600px) {
    .produtos_grid {
        grid-template-columns: 1fr;
    }
}