:root {
    --primary: #dc3545;
    --secondary: #6c757d;
    --dark: #212529;
    --light: #f8f9fa;
}

.btn.btn-primary {
    width: 150px !important;
}

/* Seletores mais específicos e várias propriedades para cobrir casos */
form input[type="submit"].btn.btn-primary,
input[type="submit"].btn.btn-primary,
.btn.btn-primary[type="submit"],
.btn.btn-primary.btn-block,
.btn.btn-primary {
  display: inline-block !important;        /* evita comportamento estranho de flex/block */
  box-sizing: border-box !important;       /* inclui padding na largura */
  width: 150px !important;                 /* largura desejada */
  min-width: 150px !important;             /* impede override por min-width */
  max-width: 150px !important;             /* impede override por max-width */
  flex: 0 0 150px !important;              /* cobre casos em que o botão está num container flex */
  -webkit-flex: 0 0 150px !important;
  -ms-flex: 0 0 150px !important;
  padding-left: 12px !important;           /* ajusta padding se necessário (opcional) */
  padding-right: 12px !important;
  background-color: #40c7c5 !important;

}

.btn-confirmar {
    padding: 0.1rem 0.1rem !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #40c7c575 0%, #40c7c5 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px #33aeac85 !important;
    margin-bottom: 0.5rem !important;
}


/* Navbar container spacing on mobile */
@media (max-width: 576px) {
  .navbar .container,
  .navbar .container-fluid,
  .navbar.menu .container {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
  }
}

/* Mobile navbar layout adjustments */
@media (max-width: 991.98px) {
  /* Header container */
  .header .container {
    padding: 0.5rem 1rem;
  }
  
  /* Logo styling */
  .header .navbar-brand {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
  }
  
  .header .navbar-brand img {
    max-height: 40px;
    width: auto;
  }
  
  /* Mobile cart button */
  #mobileCartButton {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #333;
    padding: 0.5rem;
    position: relative;
  }
  
  /* Cart badge styling */
  .cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
  }
  
  /* Mobile menu toggle button */
  .navbar-toggler {
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    color: #333;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }
  
  .navbar-toggler:hover {
    color: var(--primary);
  }
  
  .navbar-toggler:focus {
    outline: none;
    box-shadow: none;
  }
  
  /* Mobile menu */
  #mobileNavbar {
    position: fixed;
    top: 0;
    left: -280px; /* Escondido à esquerda */
    width: 280px;
    height: 100vh;
    background: #fff;
    margin: 0;
    padding: 1rem 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
  }
  
  #mobileNavbar.show {
    left: 0; /* Mostra o menu deslizando da esquerda */
  }
  
  /* Cabeçalho do menu móvel */
  .mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .close-menu {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
  }
  
  .close-menu:hover {
    color: #333;
  }
  
  /* Overlay para escurecer o fundo quando o menu estiver aberto */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }
  
  .menu-overlay.show {
    display: block;
  }
  
  #mobileNavbar .navbar-nav {
    width: 100%;
  }
  
  #mobileNavbar .nav-item {
    width: 100%;
  }
  
  #mobileNavbar .nav-link {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333 !important;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  
  #mobileNavbar .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--primary);
    padding-left: 2rem;
  }
  
  #mobileNavbar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1em;
  }
  
  /* Hide desktop navigation on mobile */
  .d-none.d-lg-block {
    display: none !important;
  }
}

/* Desktop styles */
@media (min-width: 992px) {
  /* Hide mobile elements on desktop */
  .d-lg-none {
    display: none !important;
  }
  
  /* Ensure desktop navigation is visible */
  .d-none.d-lg-block {
    display: block !important;
  }
  
  /* Cart button styling for desktop */
  #cartButton {
    white-space: nowrap;
  }
  
  #cartCountText {
    margin-left: 0.25rem;
  }
}
  /* Custom container to stack elements vertically */
  .navbarNav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
  }

  /* Bootstrap nav list stays horizontal on mobile */
  .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .navbar-nav .nav-item {
    flex: 0 0 auto;
  }


/* FINAL OVERRIDE: enforce two-per-row squares on small phones */
@media (max-width: 576px) {
  .links-module .links-square .links-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    grid-template-columns: unset !important;
    width: 100% !important;
    margin: 0 !important;
    column-gap: 0 !important;
    row-gap: 8px !important;
  }
  .links-module .links-square .links-item {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  .links-module .links-square .links-item > a,
  .links-module .links-square .links-item > a > img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  .links-module .links-square .links-item > a > img {
    object-fit: cover !important;
    object-position: center center !important;
  }
}

/* Harden small-phone behavior: always two squares per row at <=576px */
@media (max-width: 576px) {
  .links-module .links-square .links-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    column-gap: 0 !important;
    row-gap: 8px !important;
  }
  .links-module .links-square .links-item {
    position: relative !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    height: 0 !important;           /* padding-top square for robust support */
    padding: 0 !important;
    padding-top: 100% !important;   /* enforce 1:1 */
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  .links-module .links-square .links-item > a,
  .links-module .links-square .links-item > a > img {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  .links-module .links-square .links-item > a > img {
    object-fit: cover !important;
    object-position: center center !important;
  }
  /* Ultra-specific fallback to ensure two-per-row */
  #fotolinks .links-item {
    display: block !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
  }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.main-content {
    min-height: calc(100vh - 160px);
    padding: 20px 0;
    display: flex;
    justify-content: flex-start;
    /* justify-content: center; */
    align-items: flex-start !important;
}

/* Mobile: o min-height de 100vh e a centragem vertical deixavam metade do
   ecrã em branco quando o conteúdo era curto. Seletores propositadamente
   mais específicos para ganharem às regras equivalentes mais abaixo. */
@media (max-width: 768px) {
    .main-content { min-height: 0 !important; padding: 2px 0 6px !important; }
    body .main-content .container {
        justify-content: flex-start !important;
        margin-top: 0 !important;
    }
    body .main-content .text-center.py-5 {
        justify-content: flex-start !important;
        padding-top: 2px !important;
        padding-bottom: 2px !important;
    }
}

.header {
    background-color: rgb(255, 255, 255) !important;
}

.header-btn {
    --bs-btn-color: #40c7c5 !important; 
    --bs-btn-border-color: #40c7c5 !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #40c7c5 !important;
    --bs-btn-hover-border-color: #40c7c5 !important;
}

.menu {
    background-color: rgb(51, 174, 172) !important;
}

.nav-link {
    color: white !important;
}

.footer {
    color: white !important;
    background-color: rgb(51, 174, 172) !important;
    padding-top: 20px;
}

/* Chevron das secções do rodapé: escondido em desktop/tablet, só aparece
   no acordeão de telemóvel (abaixo). Especificidade ".footer .footer-chevron"
   (em vez de só ".footer-chevron") de propósito: o header.php volta a incluir
   o FontAwesome dentro do <body>, por isso o CSS dele carrega DEPOIS do
   style.css - a regra dele ".fa-solid { display:inline-block }" tinha a
   mesma especificidade e, por vir depois, ganhava sempre (chevron visível
   também em desktop). Com 2 classes aqui, esta regra vence independentemente
   da ordem de carregamento. */
.footer .footer-chevron { display: none; }

/* ===== Área de cliente: A minha conta (profile.php) e páginas customer* (engine.php) ===== */
/* No profile.php o próprio .container é a grelha: anula o
   ".main-content .container { display: flex !important; flex-direction: column }" global */
.main-content .container.conta-layout {
    display: grid !important;
    align-items: start !important;
    justify-content: stretch !important;
}
.conta-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    padding-top: 24px;
    padding-bottom: 32px;
    color: #1e2b37;
}
/* O conteúdo das páginas herda text-align:center do site */
.conta-layout .conta-menu,
.conta-layout .conta-menu *,
.conta .conta-principal:not(.conta-principal-pagina),
.conta .conta-principal:not(.conta-principal-pagina) * {
    text-align: left !important;
}
/* Páginas da área de cliente (engine.php): sem o espaço extra das secções */
.conta-principal-pagina > [id^="section-"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.conta-menu {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.conta-menu-grupo {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(32, 32, 35, 0.05);
}
.conta-menu-grupo a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 2px;
    border-bottom: 1px solid #eef0f3;
    color: #1e2b37;
    font-size: 0.78rem;
    text-decoration: none;
    text-transform: uppercase;
}
.conta-menu-grupo a:last-child {
    border-bottom: 0;
}
.conta-menu-grupo a i {
    width: 16px;
    color: #1e2b37;
    text-align: center;
}
.conta-menu-grupo a:hover,
.conta-menu-grupo a.ativo {
    color: #33aeac;
}
.conta-menu-grupo a.ativo {
    font-weight: 700;
}
.conta-menu-grupo a:hover i,
.conta-menu-grupo a.ativo i {
    color: #33aeac;
}
.conta-principal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.conta-bloco {
    padding: 20px 22px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(32, 32, 35, 0.05);
}
.conta-bloco h2 {
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.conta-topo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.conta-boas-vindas {
    display: flex;
    flex-direction: column;
}
.conta-boas-vindas p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.conta-boas-vindas-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    color: #6c757d;
    font-size: 0.8rem !important;
}
.conta-btn-sair {
    display: block;
    margin-top: auto;
    padding: 10px;
    border-radius: 4px;
    background: #ececec;
    color: #1e2b37;
    font-size: 0.82rem;
    text-align: center !important;
    text-decoration: none;
}
.conta-btn-sair:hover {
    background: #dc3545;
    color: #fff;
}
.conta-btn-sair i {
    margin-right: 6px;
}
.conta-destaque {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
}
.conta-destaque:hover {
    background: #23963e;
    color: #fff;
}
.conta-destaque-titulo {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}
.conta-destaque-valor {
    font-size: 1.6rem;
    font-weight: 700;
}
.conta-destaque-valor i {
    margin-right: 8px;
    font-size: 1.2rem;
}
.conta-destaque-info {
    font-size: 0.8rem;
    opacity: 0.9;
}
.conta-bloco-cabecalho {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.conta-bloco-cabecalho h2 {
    margin: 0;
}
.conta-btn-secundario {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #1e2b37;
    font-size: 0.78rem;
    text-decoration: none;
}
.conta-btn-secundario:hover {
    border-color: #33aeac;
    color: #33aeac;
}
.conta-encomenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid #eef0f3;
}
.conta-encomenda-titulo {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
    font-size: 0.88rem;
}
.conta-encomenda-estado {
    font-size: 0.8rem;
}
.estado-pendente { color: #e0a800; }
.estado-concluido { color: #33aeac; }
.estado-anulado { color: #dc3545; }
.conta-encomenda-info {
    color: #555;
    font-size: 0.8rem;
}
.conta-link {
    color: #1e2b37;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}
.conta-link:hover {
    color: #33aeac;
}
.conta-link i {
    margin-left: 6px;
    font-size: 0.7rem;
}
.conta-vazio {
    margin: 8px 0 0;
    color: #6c757d;
    font-size: 0.85rem;
}
.conta-fundo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.conta-fundo .conta-bloco {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.conta-fundo .conta-btn-secundario {
    margin-top: auto !important;
}
.conta-moradas {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 16px;
}
.conta-dados-linha {
    margin: 0 0 2px;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}
@media (max-width: 991.98px) {
    .conta-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    /* Em tablet/telemóvel o menu passa a uma faixa de atalhos com scroll horizontal */
    .conta-menu {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    .conta-menu-grupo {
        flex-direction: row;
        flex: 0 0 auto;
        gap: 4px;
        padding: 4px 8px;
    }
    .conta-menu-grupo a {
        border-bottom: 0;
        padding: 6px 8px;
        white-space: nowrap;
    }
}
@media (max-width: 767.98px) {
    .conta-topo,
    .conta-fundo,
    .conta-moradas {
        grid-template-columns: minmax(0, 1fr);
    }
    .conta-layout {
        padding-top: 12px;
    }
}

/* ===== Filtro de preço da listagem (modules/get_products.php) ===== */
.filtro-preco {
    text-align: left;
}
.filtro-preco-campos {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.filtro-preco-campos label {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.filtro-preco-campos span {
    display: block;
    margin-bottom: 2px;
    color: #888;
    font-size: 0.72rem;
}
.filtro-preco-campos input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}
.filtro-preco-btn {
    width: 100%;
    padding: 6px;
    border: 0;
    border-radius: 4px;
    background: #40c7c5;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}
.filtro-preco-btn:hover {
    background: #33aeac;
}
.filtro-preco-limpar {
    display: block;
    margin-top: 6px;
    color: #40c7c5;
    font-size: 0.8rem;
    font-style: italic;
    text-decoration: none;
}

/* ===== Grelha de grupos do menu (modules/grupos_menu.php) ===== */
.grupos-menu {
    /* O #section-productslist é um flex em coluna centrado (.text-center.py-5):
       sem isto a grelha encolhe à largura do conteúdo e fica numa só coluna */
    align-self: stretch;
    width: 100%;
    text-align: left;
}
.grupos-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}
.grupos-breadcrumb a {
    color: #1e2b37;
    text-decoration: none;
}
.grupos-breadcrumb a:hover {
    color: #33aeac;
}
.grupos-breadcrumb .fa-chevron-right {
    font-size: 9px;
}
.grupos-titulo {
    width: fit-content;
    margin: 32px auto 28px;
    padding-left: 10px;
    border-left: 4px solid #40c7c5;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}
.grupos-grelha {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.grupos-cartao {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 12px 22px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(32, 32, 35, 0.06);
    color: #1e2b37;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}
.grupos-cartao:hover {
    color: #1e2b37;
    box-shadow: 0 4px 14px rgba(32, 32, 35, 0.12);
    transform: translateY(-2px);
}
.grupos-imagem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
}
.grupos-imagem img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}
.grupos-imagem .fa-solid {
    font-size: 48px;
    color: #40c7c5;
}
.grupos-nome {
    font-size: 14px;
    line-height: 1.35;
}
.grupos-ver-todos {
    margin-top: 24px;
    text-align: center;
}
.grupos-ver-todos a {
    color: #33aeac;
    font-weight: 600;
    text-decoration: none;
}
@media (max-width: 767.98px) {
    .grupos-grelha {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .grupos-imagem,
    .grupos-imagem img {
        height: 80px;
        max-height: 80px;
    }
    .grupos-nome {
        font-size: 13px;
    }
}

/* ===== Páginas institucionais (Quem somos, Marcas, Recrutamento, Contactos) ===== */
.page-institucional {
    text-align: left;
    color: #2e3033;
}
.page-institucional .card {
    border: 1px solid #e6e8ec;
    border-radius: 8px;
}
.page-institucional .card-body {
    padding: 24px;
}
.page-institucional h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #33aeac;
    margin-top: 28px;
}
.page-institucional h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 12px 0 8px;
}
.page-institucional .form-secao {
    margin-top: 28px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e6e8ec;
}
.page-institucional .form-label {
    font-weight: 600;
    font-size: 0.9rem;
}
.page-institucional .form-check-inline {
    margin-right: 20px;
}
.page-institucional .btn-primary {
    background: #33aeac;
    border-color: #33aeac;
    padding: 8px 32px;
}
/* Páginas de apoio ao cliente importadas do aquario.pt */
.page-apoio img {
    max-width: 100%;
    height: auto;
}
.page-apoio table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.page-apoio td,
.page-apoio th {
    padding: 6px 8px;
    border: 1px solid #e6e8ec;
    vertical-align: top;
}
.page-apoio .card-text {
    overflow-x: auto;
}
.apoio-opcoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.apoio-opcoes a {
    display: block;
    padding: 24px 16px;
    border-radius: 8px;
    background: #2e3033;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.apoio-opcoes a:hover {
    background: #33aeac;
    color: #fff;
}
.apoio-opcoes a span {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
}
.faq-item {
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}
.faq-item summary {
    padding: 14px 44px 14px 16px;
    position: relative;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #33aeac;
    font-size: 1.3rem;
    font-weight: 400;
}
.faq-item[open] summary::after {
    content: '\2212';
}
.faq-item[open] summary {
    color: #33aeac;
}
.faq-resposta {
    padding: 0 16px 14px;
}
.form-armadilha {
    position: absolute !important;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.marcas-grelha {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.marcas-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.marcas-item:hover {
    border-color: #33aeac;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.marcas-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}
.contacto-local {
    height: 100%;
    padding: 18px;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
}
.contacto-recuo {
    margin-left: 22px;
}
.contacto-mapa iframe {
    display: block;
    width: 100%;
    height: 320px;
    border: 0;
    border-radius: 8px;
}
@media (max-width: 767.98px) {
    .page-institucional .card-body {
        padding: 16px;
    }
    .marcas-grelha {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

/* Faixa branca com informação, pagamentos e selos (ao estilo do aquario.pt) */
.footer .footer-info-band {
    background: #fff;
    color: #2e3033;
    border-radius: 8px;
    margin: 24px 0 8px;
    padding: 20px 16px;
    text-align: center;
}
.footer .footer-info-texto {
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 16px;
}
.footer .footer-info-titulo {
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0 6px;
}
.footer .footer-pagamentos {
    max-width: 520px;
    width: 100%;
    margin-bottom: 8px;
}
.footer .footer-selos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.footer .footer-selos img {
    max-height: 48px;
    width: auto;
}

/* ===== Rodapé condensado com secções rebatíveis — APENAS telemóvel (< 768px) ===== */
@media (max-width: 767.98px) {
    .footer {
        padding-top: 6px !important;
    }
    .footer > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .footer .row.text-center {
        text-align: left !important;
        margin: 0 !important;
    }

    .footer .footer-col {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
    }
    .footer .row > .footer-col:first-child {
        border-top: none;
    }

    /* Cabeçalho de secção = linha rebatível.
       width/align-self forçados porque as colunas 2 e 3 têm .d-flex (com
       align-items:flex-start global), o que encolhia o <h5> ao texto e
       deixava o chevron colado às letras em vez de à direita. */
    .footer .footer-h5 {
        display: flex !important;
        width: 100% !important;
        align-self: stretch !important;
        box-sizing: border-box;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 0 !important;
        padding: 13px 2px !important;
        font-size: 0.9rem !important;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0.3px;
        color: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .footer .footer-chevron {
        display: inline-block;
        flex: 0 0 auto;
        font-size: 0.78rem;
        opacity: 0.75;
        transition: transform 0.2s ease;
    }
    .footer .footer-col.is-open .footer-chevron {
        transform: rotate(180deg);
    }

    /* Conteúdo: fechado por omissão */
    .footer .footer-collapse {
        display: none;
    }
    .footer .footer-col.is-open .footer-collapse {
        display: block;
        width: 100%;
        align-self: stretch;
        padding: 0 2px 14px 2px;
    }

    /* Compacta o interior */
    .footer .footer-collapse br { display: none; }
    .footer .footer-collapse p {
        margin-bottom: 7px !important;
        font-size: 0.85rem;
        line-height: 1.35;
    }
    .footer .footer-collapse .text-white-50 {
        font-size: 0.72rem !important;
        margin-top: 0 !important;
    }
    .footer .footer-collapse .mb-3 { margin-bottom: 7px !important; }
    .footer .footer-collapse .social-icons {
        justify-content: flex-start !important;
        margin-bottom: 10px !important;
    }

    /* Copyright: sempre visível, discreto */
    .footer hr {
        margin: 0 !important;
        border: 0 !important;
        height: 1px;
    }
    .footer .footer-copy {
        text-align: center !important;
        padding: 12px 0 4px 0;
    }
    .footer .footer-copy p {
        margin: 0 !important;
        font-size: 0.72rem;
        line-height: 1.4;
        opacity: 0.75;
    }
}

/* O <div class="footer-collapse"> (para o acordeão de mobile) passou a ser,
   em desktop, o único item flex das colunas ".d-flex.flex-column" do rodapé
   - antes, cada <p> era o seu próprio item, encolhido e à esquerda (por
   causa do "align-items:flex-start" global do .d-flex). Com o wrapper a
   ocupar a largura da linha mais comprida, o "text-align:center" herdado da
   ".row.text-center" passava a centrar visivelmente as linhas mais curtas.
   "display:contents" faz o wrapper desaparecer da caixa (fica só para
   JS/CSS do acordeão) e devolve ao desktop o comportamento original -
   cada linha volta a ser o seu próprio item flex. Só >=768px: em mobile a
   regra ".footer .footer-collapse" (mais específica) continua a mandar. */
@media (min-width: 768px) {
    .footer-col .footer-collapse { display: contents; }
}

/* Rodapé: ícones das redes sociais em linha (o ".d-flex" global deste
   ficheiro força flex-direction:column) e letra mais pequena */
.footer .social-icons {
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px;
}
.footer .social-icons li { margin: 0 !important; }
.footer .social-icons li a { font-size: 1.15rem !important; }

@media (min-width: 768px) {
    .footer .footer-h5 {
        font-size: 0.9rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    .footer .footer-col p {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    .footer .footer-col .text-white-50 {
        font-size: 0.7rem !important;
    }
    .footer .footer-copy p {
        font-size: 0.75rem;
    }
}
@media (max-width: 767.98px) {
    .footer .footer-collapse p { font-size: 0.8rem; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
}

.body-login {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #33aeac !important;
}

.login-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.login-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.logo h1 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}


.link-hover-effect {
    text-decoration: none; /* Remove o sublinhado padrão */
    transition: 0.3s;
}

.link-hover-effect:hover {
    text-decoration: underline; /* Adiciona o sublinhado no hover */
}

.item-row {
  border-bottom: 1px solid #cfcfcf !important;
  align-items: center;
  display: grid;
  grid-template-columns: 60px 220px 1fr 100px 60px 120px 60px;
  font-size: 0.85rem;
  background: white;
}


/* Remove Bootstrap row behavior from form-group */
.form-group.row {
    display: flex !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: auto !important;
    margin-bottom: 8px !important;
    padding: 4px 0 !important;
}

/* Ensure form controls take full width */
.form-group.row > [class*="col-"] {
    width: 100% !important;
    display: flex;
    padding-right: 0 !important;
    align-items: center !important;
    min-height: auto !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 0 !important;
    padding-top: 1rem !important;
    justify-content: center;
    flex-direction: row !important;

}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px !important;
    position: relative;
    width: 100%;
}

.navbar {
    position: relative;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-small {
    font-size: small !important;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

/* Alvo: O botão de rádio específico */
input[type="radio"]:focus {
    outline: none !important;
    box-shadow: none !important; /* Alguns frameworks usam box-shadow em vez de outline */
}

.form-group input {
    width: 100% !important;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control {
    min-height: 38px; /* Altura mínima para manter a usabilidade */
    height: auto !important;
}

.form-group.focused label {
    color: #667eea;
}

.page.subtitle {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}


/* Estilo para o formulário de pesquisa */
.page-content.card.card-block.search-form,
.page-content.card.card-block.search-form * {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    margin: 0 !important;
    text-align: center;
}

.desenho-titulo {
    text-align: center;
    font-size: 0.85rem;
    color: #40c7c5;
    display: -webkit-box;
    -webkit-line-clamp: 2;      /* No máximo 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px !important;           /* Igual ou menor que o container */
    margin-top: 8px;
}


.thumb-wrapper {
    width: 300px;
    aspect-ratio: 16 / 9;      /* quadrado perfeito */
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
}

.thumb-img {
    width: 100%;
    height: 100%;
    /*object-fit: cover;        /* corta a imagem para caber sem distorcer */
}




.page-content.card.card-block.search-form {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    margin: 20px 0 !important;
    gap: 0px !important
}


/* Estilo para os resultados da pesquisa */
.page-content.card.card-block.search-results,
.page-content.card.card-block.search-results * {
    padding: 0 !important;
}

.page-content.card.card-block.search-results {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap;
    width: 100%;
    margin: 20px 0;
}

/* Ajustes para os itens dentro do formulário */
.search-form .form-group {
    width: 100%;
    margin-bottom: 0;
}

/* Ajustes para os itens de resultado */
.search-results .form-group {
    flex: 1 1 30%;
    min-width: 200px;
    padding: 10px;
    border: 0px !important;
    border-radius: 8px;
}

/* Ajustes para telas menores */
@media (max-width: 768px) {
    .search-results .form-group {
        flex: 1 1 100%;
    }
}


/* Estilos para o formulário de login */
.login-form,
.login-form * {
    padding: 0 !important;
    margin: 0 !important;
}

.login-form {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.login-form .form-group {
    margin-bottom: 0 !important;
}

.login-form .form-group input {
    width: 100% !important;
    border: 2px solid #e1e1e1; 
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 0 !important;
    margin: 0 !important;
}

.login-form .btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form .btn-login:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Esta regra só afeta o título quando ele tiver a classe 'titulo-lowercase' */
.catalogo-titulo.titulo-lowercase {
    text-transform: none !important;
}

/* Opcional: Ajuste específico para o subtítulo dentro deste caso */
.titulo-lowercase .catalogo-subtitulo {
    display: block;
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: none !important;
    margin-top: 5px;
}

/* Estilo para o título do catálogo (O Retângulo) */
.catalogo-titulo {
    display: inline-block;
    background-color: #40c7c5 !important;
    color: white;
    padding: 12px 24px !important;
    border-radius: 0.25rem;
    margin-bottom: 1rem !important; /* Unificado */
    letter-spacing: 0.5px;
    font-size: 1.25rem;
    line-height: 1.4; /* Reduzi o line-height para o subtítulo não ficar longe */
    text-align: center;
    min-width: 15vw;
    box-sizing: border-box;
    text-transform: uppercase; /* Mantém apenas o título principal em maiúsculas */
}

/* Estilo para o subtítulo dentro do retângulo */
.catalogo-subtitulo {
    display: block; /* Garante que fique na linha de baixo */
    text-transform: none; /* Remove o uppercase */
    font-size: 0.85rem; /* Diminui o tamanho da letra */
    font-weight: normal; /* Deixa a letra menos grossa que o título */
    margin-top: 5px; /* Pequeno ajuste de espaço entre as linhas */
}

/* Estilo para os grupos de formulário - Sobrescrevendo qualquer estilo anterior */
#sync_form .form-group.row, 
.login-form .form-group.row,
.search-form .form-group.row,
.page-content .form-group.row {
    min-height: auto !important;
    height: auto !important;
    margin-bottom: 15px !important;
    padding: 4px 0 !important;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px !important;
}

/* Remove a borda do último item */
#sync_form .form-group.row:last-child,
.login-form .form-group.row:last-child,
.search-form .form-group.row:last-child,
.page-content .form-group.row:last-child {
    border-bottom: none;
    padding-bottom: 4px !important;
}

.login-form .form-group.row .form-control {
    height: 38px !important;
    padding: 6px 12px !important;
}

/* Estilo específico para o subtítulo do catálogo */
.login-form .page-content.card.search-form .page.subtitle {
    padding-bottom: 20px !important;
    margin-bottom: 0 !important;
    display: block !important;
}

.login-form .page-content.card.search-form .page.subtitle h6 {
    margin: 0 !important;
    padding: 0 !important;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

/* Ajustes para o formulário de login e resultados em desktop */
@media (min-width: 992px) {
    .login-form {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto;
        padding: 0 15px;
    }

    .login-form .card-block {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Estilos para a seção de resultados da pesquisa */
    .page-content.card-block.search-results {
        width: 100% !important;
        max-width: 100% !important;
        margin: 1.5rem auto !important;
        padding: 1.5rem !important;
        float: none !important;
        display: block !important;
        border-radius: 0.25rem;
        background-color: #fff;
        
    }
    
    /* Apenas a row dentro de search-results terá 50% */
    .page-content.card-block.search-results > .row {
        width: 50% !important;
        max-width: 800px !important;
        margin: 0 auto !important;
        float: none !important;
    }

/* Estilo para o conteúdo dentro da row */
.page-content.card-block.search-results > .row > div {
    padding: 0 15px;
}

/* Ajuste para dispositivos móveis */
@media (max-width: 768px) {
    .page-content.card-block.search-results > .row {
        width: 95% !important;
        max-width: 95% !important;
    }
}

.search-results .form-group {
    margin-bottom: 1.5rem;
}

.search-results .form-control-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.search-results .btn-primary {
    min-width: 200px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Ajusta o container principal */
    .container {
        max-width: 1200px !important;
        width: 100% !important;
        padding-right: 15px !important;
        padding-left: 15px !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }

    /* Ajusta as colunas do formulário */
    #sync_form .form-group.row,
    .login-form .form-group.row,
    .search-form .form-group.row,
    .page-content .form-group.row {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-height: auto !important;
        height: auto !important;
        padding: 4px 0 !important;
        margin-bottom: 8px !important;
    }

    /* Estilo para os grupos de formulário - com maior especificidade */
    #sync_form .form-group.row,
    .login-form .form-group.row,
    .search-form .form-group.row,
    .page-content .form-group.row {
        min-height: auto !important;
        height: auto !important;
        margin-bottom: 15px !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    #sync_form .form-group.row:last-child,
    .login-form .form-group.row:last-child,
    .search-form .form-group.row:last-child,
    .page-content .form-group.row:last-child {
        border-bottom: none !important;
        margin-bottom: 5px !important;
    }
    
    /* Garante que os inputs ocupem a largura total */
    .form-control {
        max-width: 100% !important;
        width: 100% !important;
    }
}


/* Se precisar de um ícone ao lado */
.catalogo-titulo i {
    margin-right: 0.5rem;
}

/* Estilo para as opções de rádio em linhas separadas */
.radio-option {
    margin-bottom: 5px;
    padding: 5px;
}

.radio-option input[type="radio"] {
    margin-right: 5px;
}

.radio-option label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    font-weight: bold !important;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox input {
    margin-right: 8px;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #33aeac;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-login i {
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.login-footer p {
    color: #666;
    font-size: 14px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.alert-login {
    padding: 12px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
}


.alert {
    padding: 12px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-size: 24px !important;
}

.alert-error {
    background: #fee !important;
    border: 1px solid #f5c6cb !important;
    color: #f30018 !important;
}

.alert-error i {
    margin-right: 8px;
}

/* Adicione ao final do seu style.css existente */
.alert-success {
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #00c42e !important !important;
}

.alert-success i {
    margin-right: 8px;
}

/* Responsivo */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* ===== Página de autenticação (login + pedido de conta) ===== */
.login-container.auth-container {
    max-width: 900px;
}

.login-box.auth-box {
    padding: 40px 50px;
}

.auth-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #333;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e1e1e1;
}

.auth-columns {
    display: flex;
    gap: 40px;
}

.auth-col {
    flex: 1;
    min-width: 0;
}

.auth-col + .auth-col {
    border-left: 1px solid #e1e1e1;
    padding-left: 40px;
}

.auth-col h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.auth-col .auth-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 20px;
}

.auth-or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 13px;
    margin: 18px 0;
}

.auth-or-divider::before,
.auth-or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e1e1e1;
}

.auth-or-divider::before { margin-right: 10px; }
.auth-or-divider::after { margin-left: 10px; }

.btn-social {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-social:last-child { margin-bottom: 0; }

.btn-facebook { background: #3b5998; }
.btn-facebook:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(59,89,152,0.4); }

.btn-google { background: #4285f4; }
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(66,133,244,0.4); }

.auth-benefits {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.auth-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.auth-benefits li i {
    color: #33aeac;
    margin-top: 2px;
}

.auth-footer-note {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

.auth-footer-note a {
    color: #33aeac;
}

@media (max-width: 767px) {
    .login-container.auth-container {
        max-width: 400px;
    }
    .auth-columns {
        flex-direction: column;
    }
    .auth-col + .auth-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e1e1e1;
        padding-top: 30px;
        margin-top: 30px;
    }
    .login-box.auth-box {
        padding: 30px 20px;
    }
}

.navbar-brand {
    font-weight: 700;
}

.cart-line {
    height: auto !important;
    min-height: 24px;
}
.cart-title {
    background-color: #40c7c5 !important;
    --bs-bg-opacity: 1;
}

/* Links sem sublinhado ao passar o rato, em todo o site */
html body a:hover,
html body a:hover * {
    text-decoration: none !important;
}

/* Tipo de letra do carrinho - definido só no contentor para os restantes
   elementos herdarem; os ícones Font Awesome mantêm a sua própria fonte */
@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito-latin-wght-normal.woff2') format('woff2');
    font-weight: 200 1000;
    font-style: normal;
    font-display: swap;
}

#cartModal {
    font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Tamanhos do carrinho em desktop; em mobile mantêm-se os do bloco próprio */
@media (min-width: 769px) {
    #cartModal {
        font-size: 13px;
    }
    #cartModal .modal-title {
        font-size: 16px;
        font-weight: 700;
    }
    #cartModalBody th {
        font-size: 13px;
        font-weight: 700;
    }
    #cartModalBody .small,
    #cartModalBody .form-control-sm {
        font-size: 12px;
    }
    /* Referência do artigo - sobrepõe o x-small inline de header.php */
    #cartModalBody .cart-item-row .fw-bold.text-dark {
        font-size: 12px !important;
    }
    #cartModal .btn:not(.btn-sm) {
        font-size: 13px;
        font-weight: 700;
    }
}

/* Estilos específicos para o carrinho */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

.cart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    /* Cabeçalho e rodapé ficam fixos - só o corpo (#cartModalBody) faz
       scroll, em vez do modal inteiro (incl. o título) como acontecia com
       overflow-y:auto aqui diretamente. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-modal-content .modal-header,
.cart-modal-content .modal-footer {
    flex-shrink: 0;
}

.cart-modal-content #cartModalBody {
    flex: 1 1 auto;
    min-height: 0; /* permite ao filho fazer scroll em vez de esticar o flex pai */
    overflow-y: auto;
}

/* Limpar o "piso" de 81px da linha do carrinho */
.cart-item-row, 
.cart-item-row td {
    height: auto !important;
    min-height: 0 !important;
    padding-top: 4px !important;    /* Reduz o padding que está a esticar a linha */
    padding-bottom: 4px !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;    /* Reduz o espaço entre linhas do texto */
}

/* Remove a linha (borda) que separa o artigo da linha do ecovalor, */
/* mantendo a barra acima do artigo e abaixo do ecovalor */
.cart-item-row.no-border-bottom td {
    border-bottom: none !important;
}
.cart-item-ecovalor-row td,
.cart-item-extra-row td {
    border-top: none !important;
}
/* Remove a linha entre linhas extra consecutivas (ecovalor/encargos);
   só a última linha extra de cada artigo mantém o separador */
.cart-item-ecovalor-row.no-border-bottom td,
.cart-item-extra-row.no-border-bottom td {
    border-bottom: none !important;
}

/* Ajustar os botões dentro da tabela para não esticarem a linha */
.cart-item-row .btn {
    padding: 2px 8px !important;
    width: auto !important;         /* Cancela os 150px que definiu no topo */
    min-width: 0 !important;
    height: auto !important;
}

/* Garante que a imagem (agora 16:9) não force a linha para cima */
img.cartproductimg {
    height: 5vh !important; /* Teste com um valor fixo em vez de 5vh para validar */
    display: block;
}

input.cart-line.text-center {
    height: 3vh !important;
}


p.cart-item-description {
    margin-bottom: 0;
}

.modal-header.bg-primary.text-white {
    padding: 1vh;
    background-color: rgb(51, 174, 172) !important;
}

.modal-footer {
    padding: 2vh !important;
}

button.btn.btn-secondary {
    margin-right: 0.5vh !important
}

button.btn.btn-success {
    margin-left: 0.5vh !important;
    background-color: #40c7c5 !important;
}


.status-stock {
    color: #28a745;
}

.status-encomenda {
    color: #dc3545;
}

/* Acordeão do carrinho: uma linha por marca de veículo+condição de pagamento,
   ou por condição de pagamento no carrinho geral de peças/pneus/acessórios.
   Ver construirLinhaFolhaCarrinho()/atualizarModalCarrinho() em header.php. */
.cart-accordion-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 2px;
    background-color: #40c7c5;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
}

.cart-accordion-row:hover {
    background-color: #0d4a87;
}

/* Linha-folha de sub-carrinho, indentada dentro de uma linha-pai de marca
   (só existe quando a marca tem artigos em mais que uma condição de pagamento) */
.cart-accordion-row.cart-accordion-child {
    margin-left: 24px;
}

/* Estado aberto - o Bootstrap Collapse remove a classe .collapsed do
   elemento com data-bs-toggle quando o respetivo .collapse fica visível */
.cart-accordion-row:not(.collapsed) {
    background-color: #cfe2f3;
    color: #0d3f7a;
}

.cart-accordion-chevron {
    transition: transform 0.2s ease-in-out;
    font-size: 0.85em;
}

.cart-accordion-row:not(.collapsed) .cart-accordion-chevron {
    transform: rotate(90deg);
}

.cart-accordion-body {
    padding: 16px 4px;
}

/* ============================================================
   MODAL DO CARRINHO — APENAS MOBILE (< 768px).
   Ecrã quase inteiro + tabela de 10 colunas -> cartão por artigo.
   Desktop fica exatamente como estava.
   ============================================================ */
@media (max-width: 768px) {
    /* --- Modal quase full-screen --- */
    .cart-modal-content {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    .cart-modal-content .modal-header {
        padding: 12px 14px !important;
    }
    .cart-modal-content .modal-header .modal-title { font-size: 1rem !important; }
    .cart-modal-content #cartModalBody { padding: 10px !important; }
    .cart-modal-content .modal-footer { padding: 10px !important; }
    .cart-modal-content .modal-footer .btn { width: 100%; }

    /* --- Acordeão dos sub-carrinhos --- */
    #cartModalBody .cart-accordion-row {
        padding: 11px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    #cartModalBody .cart-accordion-row.cart-accordion-child { margin-left: 10px !important; }
    #cartModalBody .cart-accordion-body { padding: 8px 0 !important; }

    /* --- Tabela de artigos -> cartões --- */
    #cartModalBody .table-responsive { overflow: visible !important; border: 0 !important; }
    #cartModalBody table.table { display: block !important; width: 100% !important; margin: 0 !important; }
    #cartModalBody table.table thead { display: none !important; }
    #cartModalBody table.table tbody { display: block !important; }

    #cartModalBody .cart-item-row {
        display: grid !important;
        grid-template-columns: 42px 1fr auto;
        grid-template-areas:
            'img  name  del'
            'qty  qty   qty'
            'sta  sta   sta'
            'desc desc  desc'
            'unit unit  unit'
            'sub  sub   sub';
        column-gap: 10px;
        row-gap: 4px;
        align-items: center;
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        background: #fff !important;
        line-height: 1.25 !important;
    }
    #cartModalBody .cart-item-row.no-border-bottom {
        margin-bottom: 0 !important;
        border-bottom: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
    #cartModalBody .cart-item-row > td {
        display: block !important;
        border: 0 !important;
        padding: 0 !important;
        height: auto !important;
        text-align: left !important;
        font-size: 0.8rem !important;
        line-height: 1.25 !important;
    }

    #cartModalBody .cart-item-row > td:nth-child(1) { grid-area: img; }
    #cartModalBody .cart-item-row > td:nth-child(1) img.cartproductimg {
        height: 40px !important;
        width: 40px;
        object-fit: contain;
    }

    #cartModalBody .cart-item-row > td:nth-child(2) { grid-area: name; min-width: 0; }
    #cartModalBody .cart-item-row > td:nth-child(2) .fw-bold {
        font-size: 0.8rem !important;
        color: #40c7c5 !important;
        line-height: 1.2;
    }
    #cartModalBody .cart-item-row > td:nth-child(2) .small {
        font-size: 0.74rem !important;
        color: #6b7280 !important;
        max-height: none !important;
        -webkit-line-clamp: 2;
    }

    #cartModalBody .cart-item-row > td:nth-child(3) {
        grid-area: qty;
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding-top: 6px !important;
        border-top: 1px solid #eef0f2 !important;
    }
    #cartModalBody .cart-item-row > td:nth-child(3)::before {
        content: 'Qtd';
        color: #6b7280;
        font-size: 0.76rem;
    }
    #cartModalBody .cart-item-row .quantidade-input {
        width: 62px !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 7px 6px !important;
        font-size: 0.9rem !important;
        text-align: center;
    }

    #cartModalBody .cart-item-row > td:nth-child(4) {
        grid-area: sta;
        font-size: 0.74rem !important;
    }

    /* Esconde IVA % e PVP s/IVA bruto (o detalhe fiscal fica no total em baixo) */
    #cartModalBody .cart-item-row > td:nth-child(5),
    #cartModalBody .cart-item-row > td:nth-child(6) { display: none !important; }

    /* Desconto */
    #cartModalBody .cart-item-row > td:nth-child(7) {
        grid-area: desc;
        display: flex !important;
        align-items: center;
        gap: 6px;
    }
    #cartModalBody .cart-item-row > td:nth-child(7)::before {
        content: 'Desconto';
        color: #6b7280;
        font-size: 0.76rem;
    }
    #cartModalBody .cart-item-row > td:nth-child(7) .box-desconto { margin: 0 !important; }
    #cartModalBody .cart-item-row > td:nth-child(7) .desconto { color: #6b7280 !important; }

    /* Preço unitário */
    #cartModalBody .cart-item-row > td:nth-child(8) {
        grid-area: unit;
        font-weight: 600;
        white-space: nowrap;
        padding-top: 6px;
        border-top: 1px solid #eef0f2;
    }
    #cartModalBody .cart-item-row > td:nth-child(8)::before {
        content: 'Preço un. ';
        font-weight: 400;
        color: #6b7280;
    }

    /* Subtotal */
    #cartModalBody .cart-item-row > td:nth-child(9) {
        grid-area: sub;
        text-align: right !important;
        white-space: nowrap;
        font-weight: 700 !important;
        color: #40c7c5 !important;
        font-size: 0.92rem !important;
    }
    #cartModalBody .cart-item-row > td:nth-child(9)::before {
        content: 'Subtotal ';
        font-weight: 400;
        font-size: 0.72rem;
        color: #6b7280;
    }

    /* Botão remover */
    #cartModalBody .cart-item-row > td:nth-child(10) { grid-area: del; justify-self: end; }
    #cartModalBody .cart-item-row > td:nth-child(10) .btn {
        padding: 7px 10px !important;
    }

    /* Linhas de ecovalor / encargos: continuação do cartão do artigo */
    #cartModalBody .cart-item-ecovalor-row,
    #cartModalBody .cart-item-extra-row {
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
        gap: 8px;
        margin: 0 !important;
        padding: 5px 12px !important;
        font-size: 0.73rem;
        color: #6b7280;
        background: #fafbfc;
        border-left: 1px solid #e6e8ec;
        border-right: 1px solid #e6e8ec;
    }
    #cartModalBody .cart-item-ecovalor-row.no-border-bottom,
    #cartModalBody .cart-item-extra-row.no-border-bottom {
        border-bottom: 0 !important;
    }
    #cartModalBody .cart-item-ecovalor-row:not(.no-border-bottom),
    #cartModalBody .cart-item-extra-row:not(.no-border-bottom) {
        border-bottom: 1px solid #e6e8ec !important;
        border-radius: 0 0 12px 12px;
        margin-bottom: 8px !important;
    }
    #cartModalBody .cart-item-ecovalor-row > td,
    #cartModalBody .cart-item-extra-row > td {
        display: none !important;
        border: 0 !important;
        padding: 0 !important;
    }
    #cartModalBody .cart-item-ecovalor-row > td.text-taxes,
    #cartModalBody .cart-item-extra-row > td.text-taxes {
        display: block !important;
        text-transform: uppercase;
        letter-spacing: 0.2px;
    }
    #cartModalBody .cart-item-ecovalor-row > td.fw-bold,
    #cartModalBody .cart-item-extra-row > td.fw-bold {
        display: block !important;
        font-weight: 700 !important;
        color: #374151 !important;
        white-space: nowrap;
    }

    /* --- Totais --- */
    #cartModalBody .row.mt-4 {
        margin: 12px 0 0 0 !important;   /* anula as margens negativas do .row do Bootstrap
                                            que empurravam o bloco e cortavam os valores à direita */
        width: 100% !important;
    }
    #cartModalBody .row.mt-4 > .col-md-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 {
        display: flex !important;
        flex-wrap: nowrap !important;
        border-top: 1px solid #eef0f2;
        padding-top: 10px;
        margin: 0 !important;
        width: 100% !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 > .col-6 {
        padding: 0 !important;
        max-width: none !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 > .col-6:first-child {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        text-align: left !important;
        padding-right: 10px !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 > .col-6:last-child {
        flex: 0 0 auto !important;
        white-space: nowrap;
        text-align: right !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 > .col-6 > div {
        padding: 2px 0 !important;
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    #cartModalBody .row.mt-4 .row.g-2 .mt-1 { margin-top: 2px !important; }
    #cartModalBody .row.mt-4 .row.g-2 .mt-3 { margin-top: 8px !important; }
    .cart-modal-content #cartModalBody .mt-3.text-dark { font-size: 0.88rem !important; }
    #cartModalBody .row.mt-4 .text-dark strong { font-size: 0.92rem !important; }

    /* --- Limpar / Finalizar --- */
    #cartModalBody div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
        margin-top: 10px !important;
    }
    #cartModalBody div[style*="justify-content: space-between"] > button {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
    }
}

.cart-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background-color: #e74c3c !important;
    color: white !important;
    border-radius: 20px !important; /* Aumentado para garantir o arredondado */
    
    /* Tamanho e Ajuste */
    min-width: 18px !important; 
    height: 18px !important;
    width: auto !important; /* Permite que cresça se necessário */
    padding: 0 5px !important;
    
    /* Tipografia e Alinhamento */
    font-size: 10px !important; /* Um pouco menor para caber melhor */
    font-weight: bold !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Garantias Visuais */
    white-space: nowrap !important;
    box-sizing: border-box !important;
    z-index: 10 !important; /* Garante que fique por cima */
}


.social-icons {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 15px;
}

.social-icons li a {
    color: white; /* cor dos ícones */
    font-size: 24px;
    transition: transform 0.3s;
}

.social-icons li a:hover {
    transform: scale(1.2);
    color: #dc3545; /* muda cor ao passar o mouse */
}



/* ============================== */
/* NAVBAR MAIS FINA */
/* ============================== */

/* Reduz o padding da navbar */
.navbar.menu {
    padding-top: 0.3rem;   /* default: 0.5rem */
    padding-bottom: 0.3rem;
    /*z-index: 100;*/
}

/* 1ª Barra (Header) */
.navbar.header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1030; /* Valor alto para ficar sempre no topo */
}

/* 2ª Barra (Menu) */
.navbar.menu {
    position: -webkit-sticky;
    position: sticky;
    /* Usamos var() para ler a altura dinamicamente se necessário, 
       ou uma aproximação segura. Se a .header costuma ter ~70px: */
    top: 69px; /* Ajusta este valor ligeiramente para colar à risca na de cima */
    z-index: 1020; /* Logo abaixo da .header */
}

/* Reduz o padding dos links da navbar */
.navbar-nav .nav-link {
    padding-top: 0.35rem;   /* default: 0.5rem */
    padding-bottom: 0.35rem;
    font-size: 0.95rem;     /* opcional: deixa os links ligeiramente menores */
}

/* Reduz o tamanho do botão toggler para mobile */
.navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
}

/* Dropdowns ajustados */
.dropdown-menu {
    padding: 0.25rem 0;
}


/* ============================== */
/* CORREÇÕES PARA CENTRALIZAÇÃO */
/* ============================== */

/* Estilos para page-content card card-block com display flex */
.page-content.card.card-block {
    display: flex !important;
    flex-direction: row;
    width: 100%;
    margin: 20px 0;
    clear: both;
}

/* Container principal - FORÇAR centralização */
.main-content .container {
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    margin-top: 5px !important;
    width: 100%;
}

/* Estilo para text-center py-5 com flex */
.text-center.py-5 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto;
    padding-top: 10px !important; /* override default ~48px */
    padding-bottom: 10px !important; /* override default ~48px */
}

/* Slideshow - Centralização completa */
.carousel-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-container .row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0;
}

.carousel-container .col-12 {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

body #fotoCarousel {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

#fotoCarousel,
#fotoCarousel .carousel-inner,
#fotoCarousel .carousel-item {
    height: auto !important;
}

.carousel-image {
    width: 100% !important;
    height: auto !important;
    max-height: 90vh;
    object-fit: contain !important;
    object-position: center;
}

/* Para mobile */
@media (max-width: 768px) {
    .carousel-image {
        height: auto !important;
        max-height: 60vh;
    }
    
    .carousel-container {
        padding: 10px;
    }
}

/* Enforce uniform 16:9 ratio for the main carousel */
#fotoCarousel .carousel-inner {
    aspect-ratio: 3 / 1;
    width: 100%;
}

#fotoCarousel .carousel-item {
    height: 100%;
}

/* Desktop sizing caps */
@media (min-width: 992px) {
    #fotoCarousel .carousel-inner {
        max-height: 70vh;
    }
}

/* Cartão do banner (Google Drive) para mobile: escondido em desktop */
.banner-mobile-card { display: none; }

/* "Pan" horizontal lento da imagem do carrossel em mobile: direita -> esquerda */
@keyframes heroPan {
    0%   { object-position: 100% center; }
    100% { object-position: 0% center; }
}
@media (prefers-reduced-motion: reduce) {
    body #fotoCarousel .carousel-item .carousel-image {
        animation: none !important;
        object-position: center center !important;
    }
}

/* ============================================================
   HOMEPAGE — carrossel + banner Google Drive · APENAS MOBILE (< 992px).
   Em desktop as imagens largas funcionam; em mobile ficavam ilegíveis.
   Carrossel: recorta para um "hero" 3:2 em vez de tira fina.
   Banner: a imagem (texto embutido) dá lugar a um cartão com texto real.
   ============================================================ */
@media (max-width: 991.98px) {
    .carousel-container { padding: 6px !important; }
    #fotoCarousel {
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    }
    /* Caixa "hero" 3:2 fixa; a imagem (mais larga) é enquadrada com
       object-fit:cover e faz um "pan" lento da esquerda para a direita,
       para se ver a foto toda sem cortar espaço nem deixar branco. */
    #fotoCarousel .carousel-inner {
        aspect-ratio: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    #fotoCarousel .carousel-item {
        position: relative !important;
        aspect-ratio: 3 / 2 !important;
        height: auto !important;
        overflow: hidden !important;
    }
    body #fotoCarousel .carousel-item .carousel-image {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: 100% center;   /* repouso: mostra o lado direito */
        display: block;
        background: #000;
        animation: none;
        transition: object-position 0.5s ease;
    }
    /* Só o slide ativo faz o pan, e reinicia a cada mudança de slide
       (o JS em carrousel.php põe o intervalo do carrossel em 9s > 8s do pan,
       para a imagem ser percorrida até ao fim antes de mudar). */
    body #fotoCarousel .carousel-item.active .carousel-image {
        animation: heroPan 8s linear forwards;
    }
    #fotoCarousel .carousel-control-prev,
    #fotoCarousel .carousel-control-next {
        width: 44px !important;
        opacity: 1 !important;
    }
    #fotoCarousel .carousel-control-prev-icon,
    #fotoCarousel .carousel-control-next-icon {
        width: 44px;
        height: 44px;
        background-color: rgba(0, 0, 0, 0.35);
        border-radius: 50%;
        background-size: 42% 42%;
    }
    #fotoCarousel .carousel-indicators { margin-bottom: 8px; }
    #fotoCarousel .carousel-indicators [data-bs-slide-to] {
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
        border: 0 !important;
    }

    /* ---- Banner Google Drive ---- */
    .contents_menu_banner2 { margin-bottom: 14px !important; }
    .banner-module .banner-container,
    .banner-module.banner-container { padding-left: 0 !important; padding-right: 0 !important; }
    /* Com cartão de texto (configurado no backoffice), a imagem dá lugar ao cartão */
    .banner-module .banner-item.banner-com-cartao > :not(.banner-mobile-card) { display: none !important; }

    .banner-mobile-card {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 9px;
        margin: 0 6px;
        padding: 18px 16px;
        border-radius: 14px;
        text-decoration: none !important;
        background: linear-gradient(160deg, #1c46bb 0%, #0f2f7d 100%);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    }
    .banner-mobile-card .bmc-tag {
        align-self: center;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 5px 12px;
        border-radius: 999px;
        background: #ec5a13;
        color: #fff !important;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    .banner-mobile-card .bmc-title {
        align-self: center;
        text-align: center;
        color: #fff !important;
        font-size: 1rem;
        font-weight: 800;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        line-height: 1.2;
    }
    .banner-mobile-card .bmc-text {
        color: #d7e2ff !important;
        font-size: 0.82rem;
        line-height: 1.45;
    }
    .banner-mobile-card .bmc-text strong { color: #fff !important; font-weight: 700; }
    .banner-mobile-card .bmc-btn {
        align-self: stretch;
        margin-top: 3px;
        padding: 12px 14px;
        border-radius: 9px;
        background: #ec5a13;
        color: #fff !important;
        text-align: center;
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }
}

/* Navbar tree (menu.php) as boxed items - desktop default */
.navbar .navbar-nav-tree {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar .navbar-nav-tree .nav-item {
    display: flex;
}

.navbar .navbar-nav-tree .nav-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
}

.navbar.menu .navbar-nav-tree .nav-link {
               /* brand text color */
    color: #ffffff !important;
    background: #33aeac;                  /* light box */
    border: 1px solid #33aeac;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
    font-weight: 600;
}

/* Estilo base para os links do menu */
.navbar.menu .navbar-nav-tree .nav-link {
    color: #ffffff !important;
    background: #33aeac;
    border: 1px solid #33aeac;
    transition: all 0.2s ease;
}

/* Estilo para hover */
.navbar.menu .navbar-nav-tree .nav-link:hover,
.navbar.menu .navbar-nav-tree .nav-link:focus {
    background: #f8f9fa !important;
    color: #33aeac !important;
    border-color: #33aeac !important;
}

/* Estilo para links ativos */
.navbar.menu .navbar-nav-tree .nav-link.active {
    background: #ffffff !important;
    color: #33aeac !important;
    border-color: #33aeac !important;
    font-weight: 600 !important;
}

/* Estilo específico para a home - apenas quando estiver na home */
body.home .navbar.menu .navbar-nav-tree .nav-link[href="/"],
body.home .navbar.menu .navbar-nav-tree .nav-link[href="/engine"],
body.home .navbar.menu .navbar-nav-tree .nav-link[href*="index.php"] {
    background: #ffffff !important;
    color: #33aeac !important;
    border-color: #33aeac !important;
}

/* Reset para a home quando não estiver ativa */
.navbar.menu .navbar-nav-tree .nav-link[href="/"],
.navbar.menu .navbar-nav-tree .nav-link[href="/engine"],
.navbar.menu .navbar-nav-tree .nav-link[href*="index.php"] {
    background: #33aeac !important;
    color: #ffffff !important;
}

/* Mobile: stack as column and center */
@media (max-width: 576px) {
  .navbar .navbar-nav-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .navbar .navbar-nav-tree .nav-item {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .navbar .navbar-nav-tree .nav-link {
    width: auto;
  }
}

/* Espaço entre o botão do menu (hambúrguer) e a lista de opções quando o
   menu está aberto em mobile - sem isto a 1ª opção (HOME) ficava encostada
   / sobreposta ao botão. Só aplica abaixo de lg, onde o botão é visível. */
@media (max-width: 991.98px) {
  .navbar.menu #navbarNav.show {
    margin-top: 12px;
  }
}

/* ============================================================
   BARRA AZUL COM ÍCONES (APENAS MOBILE, < 992px)
   Ícones brancos: casa · utilizador · pesquisa · carrinho · menu.
   As ações saem do header branco e passam para esta barra.
   Desktop (>= 992px) fica exatamente como estava.
   ============================================================ */
@media (max-width: 991.98px) {
    /* Header branco só com o logótipo, centrado; e deixa de ser sticky
       para a barra azul poder colar sozinha ao topo sem gaps. */
    .navbar.header {
        position: static !important;
    }
    .navbar.header #headerActions {
        display: none !important;
    }
    .navbar.header > .container {
        justify-content: center !important;
    }

    /* Barra azul: linha de ícones espaçados; a colapsar (#navbarNav) e os
       paineis descem para a linha seguinte (flex-basis 100%). */
    .navbar.menu {
        top: 0 !important;
    }
    .navbar.menu > .container {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-around !important;
        gap: 2px !important;
        padding-top: 2px !important;
        padding-bottom: 2px !important;
    }

    .navbar.menu .menu-icon-btn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 0;
        margin: 0;
        padding: 11px 14px;
        color: #fff;
        font-size: 1.2rem;
        line-height: 1;
        position: relative;
        cursor: pointer;
        text-decoration: none;
    }
    .navbar.menu .menu-icon-btn,
    .navbar.menu .menu-icon-btn:hover,
    .navbar.menu .menu-icon-btn:focus { color: #fff; text-decoration: none; }
    .navbar.menu .menu-icon-btn > i { color: #fff; }
    .navbar.menu .menu-icon-btn:focus { outline: none; }
    .navbar.menu .menu-icon-btn[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 8px;
    }

    /* Hambúrguer: ícone FontAwesome branco em vez do SVG do Bootstrap */
    .navbar.menu .navbar-toggler {
        flex: 0 0 auto;
        margin: 0;
        padding: 11px 16px !important;
        border: 0 !important;
        color: #fff !important;
        background: transparent !important;
    }
    .navbar.menu .navbar-toggler .navbar-toggler-icon { display: none !important; }
    .navbar.menu .navbar-toggler .menu-toggler-fa {
        display: inline-block;
        color: #fff;
        font-size: 1.2rem;
        line-height: 1;
    }
    .navbar.menu .navbar-toggler.collapsed { background: transparent !important; }
    .navbar.menu .navbar-toggler:not(.collapsed) {
        background: rgba(255, 255, 255, 0.15) !important;
        border-radius: 8px;
    }

    /* Ordem pedida: menu · casa · utilizador · pesquisa · carrinho · (menu aberto) · paineis */
    .navbar.menu #menuToggler     { order: 1; }
    .navbar.menu #menuHomeBtn     { order: 2; }
    .navbar.menu #menuUserBtn     { order: 3; }
    .navbar.menu #menuSearchBtn   { order: 4; }
    .navbar.menu #menuCartBtn     { order: 5; }
    .navbar.menu #navbarNav       { order: 6; }
    .navbar.menu #menuSearchPanel { order: 7; }
    .navbar.menu #menuUserPanel   { order: 8; }

    .navbar.menu #menuCartBtn .cart-badge {
        top: 3px !important;
        right: 4px !important;
    }

    /* Opções do menu hambúrguer alinhadas à esquerda (o hambúrguer também
       está agora à esquerda na barra de ícones). O "caixote" de cada opção
       (azul, ou branco quando ativa) abraça só o próprio texto - por isso
       força-se o encolhimento (shrink-to-fit) tanto no <li> como no <a>. */
    .navbar.menu #navbarNav .navbar-nav-tree {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100%;
        gap: 6px !important;
    }
    .navbar.menu #navbarNav .navbar-nav-tree > .nav-item {
        display: flex !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 100% !important;
        align-self: flex-start !important;
        justify-content: flex-start !important;
    }
    .navbar.menu #navbarNav .navbar-nav-tree .nav-link {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 100%;
        text-align: left;
    }
    .navbar.menu #navbarNav .navbar-nav-tree .dropdown-menu {
        align-self: flex-start !important;
        width: auto !important;
        min-width: 0;
        left: 0;
        right: auto;
    }

    /* Paineis que descem por baixo da barra azul */
    .navbar.menu .menu-mobile-panel {
        flex: 0 0 100%;
        width: 100%;
        margin-top: 8px;
        padding: 10px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.20);
    }
    .navbar.menu .menu-user-panel { padding: 6px; }

    /* Caixa de pesquisa realojada (vinda do header via JS) */
    #menuSearchPanel #headerSearchBox {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    /* Painel do utilizador */
    .navbar.menu .menu-user-name {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        font-weight: 700;
        font-size: 0.92rem;
        color: #1f2937;
        border-bottom: 1px solid #eef0f2;
    }
    .navbar.menu .menu-user-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        font-size: 0.92rem;
        font-weight: 500;
        color: #40c7c5;
        text-decoration: none;
        border-radius: 8px;
    }
    .navbar.menu .menu-user-link:hover { background: #f5f8fb; }
    .navbar.menu .menu-user-link i { width: 18px; text-align: center; }
}

/* ============================================================
   TOAST "Item adicionado ao carrinho!" (mostrarMensagemSucesso, em
   get_vehicles.php / get_products.php / get_sparepart.php) — APENAS
   MOBILE (< 992px). Em desktop fica "top:20px; right:20px" como sempre.
   Em mobile isso ficava colado ao canto superior direito, por cima dos
   ícones da barra azul e a espremer-se contra a borda do ecrã em vez de
   ficar centrado. Passa a ficar centrado horizontalmente e abaixo da
   barra azul (que é sticky no topo).
   ============================================================ */
@media (max-width: 991.98px) {
    .toast-sucesso-carrinho {
        top: 70px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        width: max-content !important;
        max-width: calc(100% - 32px) !important;
        text-align: center;
        font-size: 0.88rem !important;
    }
}

/* Dropdown de desenhos: escondido em desktop (lá usa-se a sidebar). */
.desenhos-select { display: none; }

/* ============================================================
   CATÁLOGO DE PEÇAS — desenhos + lista de peças (get_sparepart.php
   e showme_spareparts.php) — APENAS MOBILE (< 992px).
   Desktop fica como estava (layout de 2 colunas com sidebar fixa).
   ============================================================ */
@media (max-width: 991.98px) {
    /* Layout: deixa de ser 2 colunas lado a lado */
    .sparepart-layout {
        display: block !important;
        min-height: 0 !important;
    }
    .sparepart-main {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 4px !important;
        overflow: visible !important;
    }

    /* Sidebar dos desenhos: escondida; substituída pela dropdown */
    .desenhos-sidebar { display: none !important; }

    .desenhos-select {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 0 12px 0 !important;
        padding: 12px 40px 12px 14px !important;
        font-size: 0.9rem !important;
        font-weight: 600;
        color: #40c7c5;
        background-color: #fff;
        border: 1px solid #e6e8ec;
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2340c7c5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
    }
    .desenhos-select:focus {
        outline: none;
        border-color: #40c7c5;
    }

    /* Título (Modelo / nome do desenho) */
    .sparepart-title {
        display: block !important;
        margin: 0 0 10px 0 !important;
        padding: 11px 14px !important;
        background: #fff !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        color: #40c7c5 !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        text-align: left !important;
        line-height: 1.3 !important;
    }

    /* Cartão da imagem + zoom */
    .sparepart-img-card {
        margin-bottom: 12px !important;
        padding: 10px !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }
    .sparepart-img-card #zoom-container {
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 58vh;
        margin: 0 auto;
        background: #fafbfc;
    }
    .sparepart-img-card #zoom-image {
        width: 100% !important;
        height: auto !important;
        max-height: 58vh;
        object-fit: contain;
    }
    /* Barra de controlos do zoom: slider a toda a largura, botões por baixo */
    .sparepart-img-card #zoom-container + div {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        max-width: 100% !important;
        margin-top: 12px !important;
    }
    .sparepart-img-card #zoom-container + div > div {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        order: -1;
    }
    .sparepart-img-card #zoom-container + div > button {
        flex: 0 0 auto;
        min-width: 44px !important;
        padding: 9px 14px !important;
    }
    .sparepart-img-card > p {
        font-size: 0.72rem !important;
        color: #9aa1ab !important;
        margin: 8px 0 0 0 !important;
    }

    /* ===== Lista de peças: de tabela de 7 colunas -> cartão por peça ===== */
    .sparepart-grid-card {
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .sparepart-grid-head { display: none !important; }

    .sparepart-grid-card .item-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            'num  ref'
            'name name'
            'price subtotal'
            'qty  cart';
        column-gap: 10px;
        row-gap: 6px;
        align-items: center;
        padding: 12px !important;
        margin-bottom: 8px;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        font-size: 0.85rem;
    }
    .sparepart-grid-card .item-row:hover { background: #fff !important; }

    .sparepart-grid-card .item-row > div {
        padding: 0 !important;
        text-align: left !important;
    }
    .sparepart-grid-card .item-row > div:nth-child(1) {
        grid-area: num;
        font-size: 0.72rem;
        color: #6b7280;
        white-space: nowrap;
    }
    .sparepart-grid-card .item-row > div:nth-child(1)::before { content: 'Nº '; }
    .sparepart-grid-card .item-row > div:nth-child(2) {
        grid-area: ref;
        font-weight: 700 !important;
        color: #40c7c5 !important;
        justify-self: end;
        text-align: right !important;
    }
    .sparepart-grid-card .item-row > div:nth-child(3) {
        grid-area: name;
        padding: 7px 0 !important;
        margin: 1px 0;
        border-top: 1px solid #eef0f2;
        border-bottom: 1px solid #eef0f2;
        line-height: 1.3;
    }
    .sparepart-grid-card .item-row > div:nth-child(3) a {
        color: #1f2937 !important;
        font-size: 0.85rem;
    }
    .sparepart-grid-card .item-row > div:nth-child(4) {
        grid-area: price;
        font-weight: 700;
        color: #1f2937;
    }
    .sparepart-grid-card .item-row > div:nth-child(4)::before {
        content: 'PVP s/IVA ';
        font-weight: 400;
        color: #6b7280;
    }
    .sparepart-grid-card .item-row > div:nth-child(5) {
        grid-area: qty;
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
    .sparepart-grid-card .item-row > div:nth-child(5)::before {
        content: 'Qtd';
        color: #6b7280;
        font-size: 0.8rem;
    }
    .sparepart-grid-card .item-row .quantidade-input {
        width: 62px !important;
        height: auto !important;
        padding: 7px 6px !important;
        font-size: 0.9rem !important;
        border-radius: 6px 6px 0 0 !important;
    }
    .sparepart-grid-card .item-row > div:nth-child(6) {
        grid-area: subtotal;
        justify-self: end;
        text-align: right !important;
        font-weight: 700 !important;
        color: #40c7c5;
    }
    .sparepart-grid-card .item-row > div:nth-child(6)::before {
        content: 'Subtotal ';
        font-weight: 400;
        color: #6b7280;
    }
    .sparepart-grid-card .item-row > div:nth-child(7) {
        grid-area: cart;
        justify-self: end;
    }
    .sparepart-grid-card .item-row > div:nth-child(7) button {
        width: auto !important;
        min-width: 44px;
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
    }

    /* ===== showme_spareparts: grelha de miniaturas dos desenhos ===== */
    .desenhos-grid {
        border: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 8px !important;
        justify-content: space-between !important;
    }
    .desenhos-grid > div {
        margin: 0 !important;
        flex: 0 0 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 10px !important;
        padding: 8px !important;
    }
    .desenhos-grid > div > a { border-left: 0 !important; padding: 0 !important; }
    .desenhos-grid .thumb-wrapper {
        width: 100% !important;
        aspect-ratio: 4 / 3;
        border: 1px solid #eef0f2 !important;
    }
    .desenhos-grid .desenho-titulo {
        max-width: 100% !important;
        font-size: 0.75rem !important;
        margin-top: 6px;
    }
}

/* Make the slide image fill the 16:9 box without cropping */
#fotoCarousel .carousel-item .carousel-image {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important; /* use 'cover' if you prefer edge-to-edge with crop */
    object-position: center center; /* sem !important: deixa o pan em mobile animar object-position */
    background: #000; /* optional backdrop for letterboxing */
}

/* Miniaturas centralizadas */
.thumbnail-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.thumbnail:hover, .thumbnail.active {
    border-color: #007bff;
    transform: scale(1.1);
}


/* Sobrescrevendo o estilo do Bootstrap */
.mb-4, 
body .mb-4,
.container .mb-4,
.row .mb-4 {
    margin-bottom: 5px !important;
}

/* ISOLAMENTO PARA MY AREA */

#myarea-exclusive-section .links-img-at img {
    position: absolute;
    top: 50%;             /* Move o topo para o meio */
    left: 50%;            /* Move a esquerda para o meio */
    transform: translate(-50%, -50%); /* Recua 50% da própria imagem para centrar real */
    max-height: 70%;
    object-fit: contain;
    background-color: #fff;
}

/* --- AJUSTE DO TEXTO DESCRITIVO NA MY AREA --- */
#myarea-exclusive-section .texto-descritivo-at {
    font-size: 1rem !important; /* Aumenta o tamanho (pode ajustar o valor) */
    font-weight: 600 !important;   /* Define o negrito extra forte */
    color: #40c7c5 !important;       /* Cor mais escura para melhor leitura */
    margin: 15px 0 !important;    /* Espaçamento em volta do texto */
    text-transform: uppercase;    /* Opcional: mantém em maiúsculas como na imagem */
    display: block !important;
}

/* ============================================================
   "A MINHA CONTA" (myarea.php) + título .catalogo-titulo — APENAS
   MOBILE (< 992px). Uniformizar com o resto do site: título em cartão
   branco/texto azul, cartões pequenos e todos do mesmo tamanho.
   ============================================================ */
@media (max-width: 991.98px) {
    /* Título -> cartão branco, texto azul (igual a "Catálogo de Peças" etc.) */
    .container.mt-4:has(> .catalogo-titulo) {
        margin-top: 4px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .catalogo-titulo {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        margin: 4px 0 12px 0 !important;
        padding: 13px 16px !important;
        background-color: #fff !important;
        color: #40c7c5 !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 14px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px;
        text-align: center;
    }

    /* Grelha de cartões: 2 por linha, pequenos, todos iguais */
    #myarea-exclusive-section { padding: 0 !important; }
    #myarea-exclusive-section > .row { margin: 0 !important; }
    #myarea-exclusive-section > .row > .col-12 { padding: 0 !important; }
    #myarea-exclusive-section .links-inner-at {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 0 !important;
    }
    #myarea-exclusive-section .links-item-at {
        flex: 0 0 calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 12px 8px 10px 8px !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        background: #fff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    #myarea-exclusive-section .links-item-at .links-img-at {
        width: 84px !important;
        max-width: 84px !important;
        min-width: 84px !important;
        margin: 0 auto !important;
        aspect-ratio: 1 / 1 !important;
        position: relative !important;
    }
    #myarea-exclusive-section .links-img-at img { max-height: 80% !important; }
    #myarea-exclusive-section .links-text-at {
        width: 100% !important;
        padding: 0 !important;
        flex-grow: 0 !important;
    }
    #myarea-exclusive-section .texto-descritivo-at {
        margin: 8px 0 0 0 !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        color: #40c7c5 !important;
        text-align: center;
        /* reserva 2 linhas e corta a partir daí -> cartões todos iguais */
        min-height: 2.4em;
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
    #myarea-exclusive-section .texto-descritivo-at a {
        color: #40c7c5 !important;
        text-decoration: none;
    }
}

.links-container-at {
    width: 100% !important;
}

.links-at {
    width: 100% !important;
}

/* Imagens das marcas - Centralização completa */
.links-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.links-container .row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0;
}

.links-container .col-12 {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.links-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    align-items: center;
    width: 100%;
}

.links-item {
    flex: 0 0 auto;
}

.img_contents_menu_links {
    max-width: 200px;
    width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: grayscale(0%) !important;
    opacity: 0.8;
}


.img_contents_menu_links:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.carousel-caption {
    background: rgba(0,0,0,0.7);
    border-radius: 5px;
    padding: 10px;
}

.image-info {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* ============================== */
/* ESTILOS EXISTENTES MANTIDOS */
/* ============================== */

.contents_menu_fotos {
    width: 100px;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: var(--bs-navbar-nav-link-padding-x);
        padding-left: var(--bs-navbar-nav-link-padding-x);
    }
}

.nav-link {
    display: block;
    padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);
    font-size: var(--bs-nav-link-font-size);
    font-weight: var(--bs-nav-link-font-weight);
    color: var(--bs-nav-link-color);
    text-decoration: none;
    background: 0 0;
    border: 0;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;
}

/* Dropdown Hover para Desktop */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px #2c3e50;
    border-radius: 8px;
}

/* Menu do utilizador em mobile: abre ao toque (JS em header.php) e fica
   ancorado ao canto direito, por baixo do nome, sem sair do ecrã. */
@media (max-width: 991.98px) {
    .navbar-nav .nav-item.dropdown {
        position: relative;
    }
    .navbar-nav .nav-item.dropdown > .dropdown-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        margin-top: 6px;
        min-width: 210px;
        z-index: 1200;
        background: #fff;
    }
    .navbar-nav .nav-item.dropdown > .dropdown-menu.show {
        display: block;
    }
}

.dropdown-item {
    transition: all 0.2s ease;
    color: #40c7c5 !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #40c7c5 !important;
}

.dropdown-toggle {
    color: #40c7c5 !important;
}

/* Link "Entrar" no header (visitante sem sessão) - sem isto herda
   .nav-link { color: white !important } e fica invisível sobre o fundo
   branco de .navbar.header. */
.nav-link-login {
    color: #40c7c5 !important;
}

/* ============================== */
/* Barra de Pesquisa (Header)     */
/* ============================== */

#searchForm {
    position: relative;
}

#searchForm .input-group {
    flex-wrap: nowrap;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

#searchForm .input-group > #searchInput {
    flex: 1 1 auto;
    min-width: 0;
}

#searchForm .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(64, 199, 197, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
}

#searchInput {
    border: 1px solid #e1e6ec !important;
    border-right: none !important;
    border-radius: 50px 0 0 50px !important;
    padding: 0.55rem 2.4rem 0.55rem 1.1rem !important;
    font-size: 0.9rem;
    background-color: #f8f9fb;
}

#searchInput:focus {
    box-shadow: none !important;
    border-color: #40c7c5 !important;
    background-color: #fff;
}

#searchClearBtn {
    position: absolute;
    right: 54px;
    top: 0;
    bottom: 0;
    border: none;
    background: transparent;
    color: #adb5bd;
    font-size: 0.8rem;
    width: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    display: none;
    z-index: 5;
}

#searchClearBtn:hover {
    color: #40c7c5;
}

#searchForm .btn.btn-primary {
    border-radius: 0 50px 50px 0 !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    flex: 0 0 48px !important;
    background-color: #40c7c5 !important;
    border: 1px solid #40c7c5 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#searchForm .btn.btn-primary:hover {
    background-color: #0d4a89 !important;
}

/* Dropdown de resultados */
#searchResultsQuick {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(64, 199, 197, 0.18);
    margin-top: 8px;
    padding: 0.4rem;
    animation: searchResultsFadeIn 0.15s ease;
}

@keyframes searchResultsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

#searchResultsQuick .search-result-item {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.6rem !important;
    border-radius: 8px;
    border-bottom: none !important;
    color: #2c3e50 !important;
}

#searchResultsQuick .search-result-item + .search-result-item {
    margin-top: 2px;
}

#searchResultsQuick .search-result-item:hover,
#searchResultsQuick .search-result-item:focus {
    background-color: #eef5fc !important;
    color: #2c3e50 !important;
}

#searchResultsQuick .search-result-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background-color: #f8f9fb;
    border: 1px solid #eaeef3;
    color: #40c7c5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.85rem;
}

#searchResultsQuick .search-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

#searchResultsQuick .search-result-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#searchResultsQuick .search-result-code {
    font-weight: 600;
    font-size: 0.85rem;
    color: #40c7c5;
}

#searchResultsQuick .search-result-desc {
    font-size: 0.78rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#searchResultsQuick .search-result-price {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #40c7c5;
    background-color: #eaf2fb;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

#searchResultsQuick .search-result-empty,
#searchResultsQuick .search-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem !important;
    color: #adb5bd;
    font-size: 0.85rem;
}

#searchResultsQuick .search-result-empty i,
#searchResultsQuick .search-result-loading i {
    font-size: 1.4rem;
}

#searchResultsQuick .search-result-loading i {
    color: #40c7c5;
}

#searchResultsQuick::-webkit-scrollbar {
    width: 6px;
}

#searchResultsQuick::-webkit-scrollbar-thumb {
    background-color: #cfd8e3;
    border-radius: 10px;
}

/* AREA TECNICA */
.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: bold;
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.contact-info {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    font-size: 1em;
    border-radius: 0 0 10px 10px;
    margin-bottom: 30px;
}

/* .main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 20px;
} */

.info-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-section h2 {
    color: #2c3e50;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.8em;
}

/* Estilos do Acordeão */
/* Acordeão simples - sobrescreve o existente */
.accordion {
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  background: #e74c3c;        /* vermelho principal */
  color: #fff;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.accordion-header:hover {
  background: #c0392b;        /* tom mais escuro no hover */
}

.accordion-content {
  display: none;
  padding: 15px;
  background: #f8f9fa;
  border-top: 1px solid #ccc;
}

.accordion.active .accordion-content {
  display: block;
}


.tecnic_area_img_contents_menu_links {
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: grayscale(0%) !important;
    opacity: 0.8;
}


.tecnic_area_img_contents_menu_links:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}


/* ============================== */
/* CORREÇÃO EXTRA PARA BOOTSTRAP */
/* ============================== */

/* Sobrescrever possíveis estilos do Bootstrap que impedem centralização */
.container {
    max-width: 1400px !important;
}

.row {
    justify-content: center !important;
    width: 100%;
    padding-top: 5px;
}

.col-12 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* ============================== */
/* ESTILOS PARA AS MARCAS - ENQUADRADAS */
/* ============================== */

.links-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.links-container .row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0;
}

.links-container .col-12 {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.links-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    align-items: stretch; /* Para que todos os items tenham a mesma altura */
    width: 100%;
}

.links-item.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 90vw;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    margin: 0 auto 1.5rem;
    height: 100%;
}

.card {
    /*width: 90vw !important;*/
    max-width: 1400px !important;
}

.links-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 300px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.links-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.links-container {
    padding-bottom: 15px;
    padding-top: 0px;
}


/* Estilo para a seção de informações da pesquisa */
.page-content.card.card-block.search-info {
    background-color: #f8f9fa;
    border-left: 4px solid #4a6cf7;
    border-radius: 0.25rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.search-info h4 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.search-info .d-flex {
    align-items: center;
    padding: 0.5rem 0;
}

.search-info strong {
    color: #495057;
    min-width: 150px;
}

/* Ajustes para telas menores */
@media (max-width: 768px) {
    .search-info .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-info strong {
        margin-bottom: 0.5rem;
    }
}

/* Technical Area Specific Styles */
#fotolinks .links-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly !important;
    gap: 15px;
    padding: 10px 0;
    max-width: 1400px !important;
    margin: 0 auto;
    padding-top: 0px !important;
}

#section-text.text-center.py-5 {
    padding-top: 0 !important;
}
#fotolinks .links-item {
    width: 180px;
    text-align: center;
    margin: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 200px;
}

#fotolinks .links-item:hover {
    border-color: #33aeac;
    box-shadow: 0 2px 8px rgba(51,174,172,0.1);
}

#fotolinks .links-item img {
    max-width: 100px;
    max-height: 60px;
    width: auto;
    height: auto;
    margin-bottom: 5px;
    object-fit: contain;
}

#fotolinks .links-item p {
    margin: 3px 0;
    font-size: 0.85em;
    color: #333;
    line-height: 1.3;
}

#fotolinks .links-item p:first-of-type {
    font-weight: bold;
    color: #33aeac;
    font-size: 0.95em;
    margin-top: auto;
}

#fotolinks .links-item a {
    color: #33aeac;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8em;
    margin-top: auto;
    display: block;
}

#fotolinks .links-item a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #fotolinks .links-item {
        width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    #fotolinks .links-item {
        width: 100%;
    }
}

/* ============================================================
   "AS NOSSAS MARCAS" (homepage) — APENAS MOBILE (< 992px).
   O título e os logótipos vêm de duas secções separadas mas
   adjacentes (#section-text + #section-links); juntam-se aqui
   num único cartão, com o título dentro do seu próprio cartão.
   ============================================================ */
@media (max-width: 991.98px) {
    /* Metade de cima do cartão = secção do título */
    .main-content #section-text.text-center.py-5:has(.links.title) {
        background: #fff !important;
        border: 1px solid #e6e8ec !important;
        border-bottom: 0 !important;
        border-radius: 14px 14px 0 0 !important;
        margin: 8px 6px 0 6px !important;
        padding: 14px 12px 8px 12px !important;
    }

    /* Metade de baixo do cartão = secção dos logótipos */
    .main-content .text-center.py-5:has(.links-module) {
        background: #fff !important;
        border: 1px solid #e6e8ec !important;
        border-top: 0 !important;
        border-radius: 0 0 14px 14px !important;
        margin: 0 6px 14px 6px !important;
        padding: 6px 10px 14px 10px !important;
    }
    .main-content .text-center.py-5:has(.links-module) .links-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
    .main-content .text-center.py-5:has(.links-module) .links-container .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .main-content .text-center.py-5:has(.links-module) .links-container .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Cartão interior à volta do título + subtítulo */
    #section-text .links.title {
        background: #f7f9fb;
        border: 1px solid #e6e8ec;
        border-radius: 10px;
        padding: 12px !important;
        margin: 0 !important;
    }
    #section-text .links.title h5 {
        margin: 0 0 4px 0 !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: #40c7c5 !important;
        line-height: 1.25 !important;
    }
    #section-text .links.title h6 {
        margin: 0 !important;
        font-size: 0.82rem !important;
        font-weight: 500 !important;
        color: #6b7280 !important;
        line-height: 1.35 !important;
    }
}

.links-square .links-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.links-square .links-item {
    width: 300px !important;
    height: 300px !important;
    max-width: none !important;
    padding: 0; /* ensure exact 300x300 square */
    overflow: hidden; /* clip image to square (and rounded corners) */
}

.links-square .links-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important; /* center the crop */
    display: block;
}

@media (max-width: 992px) {
    /* Use grid to force two columns on tablets/small screens */
    .links-square .links-inner {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
        justify-items: stretch;
        width: 100%;
        margin: 0 !important;
    }
    .links-container { padding-left: 10px; padding-right: 10px; }
    .links-square .links-item {
        display: block !important; /* avoid flex sizing issues from desktop */
        position: relative;
        width: 100% !important;
        max-width: 100% !important; /* override desktop max-width:300px */
        height: 0 !important;
        padding-top: 100% !important; /* 1:1 square */
        overflow: hidden;
        padding: 0 !important; /* remove desktop padding:20px */
        border: none !important; /* remove any borders */
        background: transparent !important;
        box-shadow: none !important;
    }
    .links-square .links-item > a,
    .links-square .links-item > a > img {
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        display: block;
    }
    .links-square .links-item > a > img {
        object-fit: cover !important; /* switch to contain if you prefer no crop */
        object-position: center center !important;
        display: block !important;
    }
    /* Avoid layout shifts/overlap from hover effects on mobile/tablet */
    .links-square .links-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

@media (max-width: 768px) {
    /* Keep grid and let it control columns */
    .links-square .links-inner {
        gap: 8px;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        margin: 0 !important;
    }
    .links-container { padding-left: 10px; padding-right: 10px; }
    .links-square .links-item {
        display: block !important;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0;
        /* Square via padding-top to avoid aspect-ratio overlaps */
        height: 0 !important;
        padding-top: 100% !important; /* 1:1 square */
        max-width: none !important;
        max-height: none !important;
        overflow: hidden;
        background: transparent !important;
        box-shadow: none !important;
    }
    .links-square .links-item > a,
    .links-square .links-item > a > img {
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        display: block;
    }
    .links-square .links-item > a > img {
        object-fit: cover !important; /* or contain, your choice */
        object-position: center center !important;
        display: block !important;
    }
    .links-square .links-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

@media (max-width: 480px) {
    .links-square {
        margin-top: 0;
    }
    /* Keep two per row on small phones as well */
    .links-square .links-inner {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin: 0 !important;
    }
    .links-container { padding-left: 8px; padding-right: 8px; }
    .links-square .links-item {
        display: block !important;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        height: 0 !important;
        padding-top: 100% !important;
        overflow: hidden;
        background: transparent !important;
        box-shadow: none !important;
    }
    .links-square .links-item > a,
    .links-square .links-item > a > img {
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        display: block;
    }
    .links-square .links-item > a > img {
        object-fit: cover !important;
        object-position: center center !important;
        display: block !important;
    }
    .links-square .links-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Switch to flex for mobile/tablet to ensure smooth two-per-row squares */
@media (max-width: 1200px) {
  .links-module .links-square .links-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    column-gap: 0 !important;   /* avoid rounding pushing to one column */
    row-gap: 8px !important;    /* vertical spacing only */
  }
  .links-module .links-square .links-item {
    display: block !important;
    position: relative !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    flex: 0 0 50% !important;   /* exact two columns */
    max-width: 50% !important;
    width: 50% !important;      /* override any width:100% from earlier rules */
    /* native square sizing */
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    padding: 0 !important;      /* remove desktop padding */
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  .links-module .links-square .links-item > a,
  .links-module .links-square .links-item > a > img {
    position: static !important; /* no absolute needed with aspect-ratio */
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  .links-module .links-square .links-item > a > img {
    object-fit: cover !important;
    object-position: center center !important;
  }
}

/* Container fixo para as imagens */
.image-container {
    width: 200px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.contents_menu_Area.Tecnica {
    max-width: 180px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain; /* Mantém a proporção sem distorcer */
}

/* Estilos para o texto */

.mb-4 {
    align-self: flex-start;
}

h5.mb-4 {
    font-weight: bold; /* Define o texto em negrito */
    font-size: 1.5rem;  /* Aumenta o tamanho da fonte. Ajuste este valor (1.5rem, 1.6rem, etc.) conforme desejar. */
    /* Você pode adicionar outras propriedades, como cor, se necessário */
    color: #333; 
}


.links-item p {
    margin: 8px 0;
    color: #333;
    line-height: 1.5;
}

.links-item a:last-child p {
    color: #40c7c5;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.links-item a:last-child:hover p {
    color: #0d3d6d;
    text-decoration: underline;
}

/* Responsividade para as marcas */
@media (max-width: 768px) {
    .links-inner {
        gap: 30px;
    }
    
    .links-item {
        max-width: 250px;
        padding: 15px;
    }
    
    .image-container {
        width: 180px;
        height: 100px;
    }
    
    .contents_menu_Area.Tecnica {
        max-width: 160px;
        max-height: 80px;
    }
}

@media (max-width: 576px) {
    .links-inner {
        gap: 20px;
        flex-direction: column;
    }
    
    .links-item {
        max-width: 100%;
        padding: 15px;
    }
    
    .image-container {
        width: 160px;
        height: 90px;
    }
    
    .contents_menu_Area.Tecnica {
        max-width: 140px;
        max-height: 70px;
    }
}



/* Forçar fundo transparente no link de download */
/* .link-download,
.link-download:hover,
.link-download:focus,
.link-download:active, */
/* .acordeao-header .link-download,
.acordeao-header.active .link-download,
.anexos-acordeao .link-download {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    text-decoration: none !important;
} */


/* Final override: ensure two-per-row squares on small phones for links module */
@media (max-width: 576px) {
  .links-module .links-square .links-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    width: 100% !important;
    margin: 0 !important;
    column-gap: 0 !important;
    row-gap: 8px !important;
    justify-content: space-between !important;
  }
  .links-module .links-square .links-item {
    box-sizing: border-box !important;
    min-width: 0 !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  .links-module .links-square .links-item > a,
  .links-module .links-square .links-item > a > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
  }
  .links-module .links-square .links-item > a > img {
    object-fit: cover !important;
    object-position: center center !important;
  }
}


html body .container {
    max-width: 1400px !important;
}

page-content.card.card-block.search-form {
    width: 40vw !important;
}

page-content.card.card-block-search-results {
    width: 40vw !important;
}


page-content .page subtitle {
    padding-top: 5px !important;
}

.page-content.card.card-block.search-form,
.page-content.card.card-block.search-info,
.page-content.card.card-block.search-results {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    border: none;
}

.links-inner-at {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center !important;
    gap: 20px;
    padding: 10px;
}

.links-item-at {
    flex: 0 0 calc(25% - 20px);   /* 4 por linha (20px = compensação do gap) */
    max-width: calc(25% - 20px);
    min-height: 250px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

/* Quadrado menor para imagem */
.links-img-at {
    /* Adicionar esta linha para limitar o tamanho máximo, mantendo o aspect-ratio de 1/1 */
    max-width: 300px; 
    
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.links-img-at img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;  /* mostra a imagem inteira */
    object-position: center;
    background-color: #fff; /* opcional: fundo branco ou outra cor */
}


/* Texto abaixo da imagem */
.links-text-at {
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.links-text-at .marca {
    font-weight: bold;
    color: #33aeac;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.links-text-at .descricao {
    font-size: 0.7rem;
    color: #333;
    margin-bottom: 6px;
}

.links-text-at .ver-mais {
    display: inline-block;
    color: #33aeac;
    font-weight: 500;
    font-size: 0.75rem;
    text-decoration: none;
}

.links-text-at .ver-mais:hover {
    text-decoration: underline;
}

/* --- ESTILOS PARA CORTE DE TEXTO (TEXTO-DESCRITIVO-AT) --- */

/* 1. Definir o container P para o corte e usar uma altura de linha base */
/* 1. Definir o container P para o corte e usar uma altura de linha base */
.texto-descritivo-at {
    /* Ajuste de Altura da Linha para ser mais robusto */
    --line-height: 1.4em; 
    
    /* Limite a 4 linhas */
    max-height: calc(4 * var(--line-height)); 
    
    overflow: hidden;
    position: relative;
    /* REMOVIDO: padding-right (não necessário sem reticências) */

    /* Adicionar um margem para garantir que não toca no link 'Ver mais »' */
    margin-bottom: 8px; 
    
    /* Impedir o Flexbox de esticar este bloco quando o texto é cortado */
    flex-shrink: 0;
}

/* Responsivo: 2 por linha no mobile */
@media (max-width: 992px) {
    .links-item-at {
        flex: 0 0 calc(33.33% - 15px);
        max-width: calc(33.33% - 15px);
    }
}

@media (max-width: 768px) {
    .links-item-at {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
        min-height: 220px;
    }
}

@media (max-width: 576px) {
    .links-item-at {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
        min-height: 200px;
    }
}

@media (max-width: 400px) {
    .links-item-at {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* A .row global tem width:100% forçado mas mantém as margens negativas do
   Bootstrap (-0.75rem de cada lado). Como a largura já está fixada em 100%,
   essas margens deixam de ser compensadas pelo padding do container e
   empurram o conteúdo ~24px para a esquerda, deixando uma folga à direita
   (nota-se na lista de marcas de Veículos, Área Técnica e A Minha Área).
   Em mobile anulamos as margens negativas para o bloco voltar ao centro. */
@media (max-width: 991.98px) {
    .links-container-at .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* A caixa da imagem tem max-width:300px; num cartão mais largo que isso
       encostava à esquerda (align-items:stretch do pai) - centrar. */
    .links-item-at .links-img-at {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Lista de marcas de veículos: SEMPRE 2 por linha em mobile, cartões
   compactos (sem o parágrafo descritivo). Vence a regra
   "@media (max-width: 400px) { .links-item-at { flex: 0 0 100% } }" acima. */
@media (max-width: 991.98px) {
    .links-container-at .links-inner-at {
        gap: 10px !important;
        padding: 4px !important;
        justify-content: flex-start !important;
    }
    .links-container-at .links-item-at {
        flex: 0 0 calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
        min-height: 0 !important;
        margin-bottom: 0 !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        justify-content: flex-start !important;
    }
    .links-container-at .links-item-at .links-img-at {
        max-width: 140px !important;
        margin: 10px auto 4px auto !important;
    }
    .links-container-at .links-item-at .links-text-at {
        padding: 6px 10px 12px !important;
        flex-grow: 0 !important;
        justify-content: flex-start !important;
        gap: 8px;
    }
    .links-container-at .links-item-at .texto-descritivo-at {
        display: none !important;
    }
    .links-container-at .links-item-at .links-text-at > a {
        display: block;
        margin-top: 2px;
        padding: 9px 10px;
        background: #40c7c5;
        color: #fff !important;
        text-decoration: none;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.2;
    }
}


.contents_menu_banner2 {
    width: 100%;
    max-width: 1200px;
margin-top: 0px;
margin-bottom: 40px;
margin-left: auto;
margin-right: auto;}

.img_contents_menu_banner2 {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center
}

body {
    background-color: white !important;
}


/* ACORDEAO */

.anexos-acordeao {
  font-family: Arial, sans-serif;
  width: 100%;
  font-family: Arial, sans-serif; 
  padding-top: 1vh;
}

.acordeao-pasta {
    margin: 2px 0;
    border: none !important;
    background: none !important;
}

/* --- CORES DO ACORDEÃO --- */

/* 1º NÍVEL (RAIZ) - Azul Escuro quando ativo */
.acordeao-pasta.pasta-raiz .acordeao-header.active {
    background-color: #003366 !important; /* Azul Escuro */
    color: #ffffff !important;
    font-weight: normal !important;
}

/* NÍVEIS SEGUINTES (SUBPASTAS) - Azul Clarinho quando ativo */
.acordeao-pasta.is-subfolder .acordeao-header.active {
    background-color: #e3f2fd !important; /* Azul Muito Claro */
    color: #003366 !important; /* Texto em azul escuro para contraste */
    border-left: 4px solid #003366; /* Opcional: uma bordinha para destacar */
}

/* Estilo base para os headers (garantir que o hover não atrapalha) */

/* Coloca as pastas de nível 1 (principais) a negrito */
.acordeao-pasta.nivel-1 > .acordeao-header {
    font-weight: bold;
}

/* Garante que todas as subpastas (nível 2, 3, etc.) tenham peso normal */
.acordeao-pasta.subpasta:not(.nivel-1) > .acordeao-header {
    font-weight: normal;
}
.acordeao-header {
    transition: background-color 0.3s ease;
    cursor: pointer;
    padding: 2px !important;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acordeao-header.active {
  background: #40c7c5 !important;
  color: white;
  font-weight: normal !important;
}

.acordeao-header:hover { text-decoration: underline; }

.acordeao-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.acordeao-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 15px;
    background: none !important;
}

.acordeao-content.active { max-height: 1000px; }

.lista-arquivos { list-style: none; padding: 0; margin: 0; }

.item-arquivo {
    display: flex;
    align-items: center;
    padding: 2px 0;
    background: none !important;
}

.item-arquivo:hover { text-decoration: underline; }

.icone-arquivo { margin-right: 6px; width: 20px; text-align: center; }

.info-arquivo {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: space-between;
    font-size: 0.85rem;
}

.detalhes-arquivo { font-size: 0.75rem; color: #555; margin-left: 10px; }

.subpasta { margin-left: 15px; border-left: none !important; }

.pasta-vazia {
    color: #666;
    font-style: italic;
    padding: 4px 0;
}

/* ============================================================
   ÁREA TÉCNICA (tecnicarea.php - gerarAttachAT) — APENAS MOBILE (< 992px).
   Cabeçalho + acordeão de documentos em conformidade com o resto do site.
   ============================================================ */
@media (max-width: 991.98px) {
    .anexos-container {
        padding: 0 !important;
        margin-top: 4px !important;
        max-width: 100% !important;
        text-align: left !important;
    }
    .anexos-container > .row { margin: 0 !important; }
    .anexos-container > .row > .col-12 { padding: 0 !important; }

    /* Cabeçalho dentro de um cartão branco (uniforme com "Catálogo de Peças") */
    .anexos-container .at-cabecalho {
        margin: 0 0 12px 0 !important;
        padding: 13px 14px !important;
        background: #fff !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        text-align: left !important;
    }

    .anexos-container .at-cabecalho h5 {
        margin: 0 0 4px 0 !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #40c7c5 !important;
        text-align: left !important;
    }
    .anexos-container .at-cabecalho h6 {
        margin: 0 0 3px 0 !important;
        font-size: 0.82rem !important;
        font-weight: 500 !important;
        color: #6b7280 !important;
        text-align: left !important;
    }
    .anexos-container .at-cabecalho .at-contacto {
        margin: 0 !important;
        font-size: 0.78rem !important;
        color: #9aa1ab !important;
        text-align: left !important;
    }
    .anexos-container .at-cabecalho .at-contacto a { color: #40c7c5; text-decoration: none; }

    .anexos-acordeao { padding-top: 0 !important; }

    /* Pasta de topo = cartão branco */
    .anexos-acordeao .acordeao-pasta.pasta-raiz {
        margin: 0 0 8px 0 !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        background: #fff !important;
        overflow: hidden;
    }
    .anexos-acordeao .acordeao-pasta.pasta-raiz > .acordeao-header {
        padding: 13px 14px !important;
        margin: 0 !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #1f2937;
        background: #fff;
    }
    .anexos-acordeao .acordeao-pasta.pasta-raiz > .acordeao-header.active {
        background: #40c7c5 !important;
        color: #fff !important;
    }
    .anexos-acordeao .acordeao-header:hover { text-decoration: none; }

    .anexos-acordeao .acordeao-nome {
        display: flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
    }
    .anexos-acordeao .acordeao-folder-ic { color: #40c7c5; }
    .anexos-acordeao .acordeao-header.active .acordeao-folder-ic { color: #fff; }

    .anexos-acordeao .acordeao-icon {
        flex: 0 0 auto;
        margin-left: 10px;
        font-size: 0.7rem;
        opacity: 0.7;
    }

    /* Conteúdo da pasta */
    .anexos-acordeao .acordeao-content { padding: 0 12px !important; }
    .anexos-acordeao .acordeao-content.active {
        max-height: none !important;
        padding: 4px 12px 10px !important;
    }

    /* Subpastas -> cartão interior mais leve */
    .anexos-acordeao .acordeao-pasta.is-subfolder {
        margin: 6px 0 !important;
        border: 1px solid #eef0f2 !important;
        border-radius: 8px !important;
        overflow: hidden;
    }
    .anexos-acordeao .acordeao-pasta.is-subfolder > .acordeao-header {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        background: #f7f9fb !important;
    }
    .anexos-acordeao .acordeao-pasta.is-subfolder > .acordeao-header.active {
        background: #e3f2fd !important;
        color: #003366 !important;
        border-left: 0 !important;
    }
    .anexos-acordeao .subpasta { margin-left: 0 !important; }

    /* Lista de ficheiros */
    .anexos-acordeao .lista-arquivos { padding: 2px 0 !important; }
    .anexos-acordeao .item-arquivo {
        align-items: center;
        gap: 11px;
        padding: 10px 4px !important;
        border-bottom: 1px solid #f0f2f4;
    }
    .anexos-acordeao .item-arquivo:last-child { border-bottom: 0; }
    .anexos-acordeao .item-arquivo:hover { text-decoration: none; }
    .anexos-acordeao .icone-arquivo {
        margin: 0 !important;
        width: 24px !important;
        flex: 0 0 auto;
        font-size: 1.15rem;
        text-align: center;
    }
    .anexos-acordeao .info-arquivo {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: 2px;
        min-width: 0;
    }
    .anexos-acordeao .nome-arquivo {
        font-size: 0.83rem !important;
        line-height: 1.3;
        color: #1f2937 !important;
        word-break: break-word;
    }
    .anexos-acordeao .detalhes-arquivo {
        margin: 0 !important;
        font-size: 0.72rem !important;
        color: #9aa1ab !important;
    }
}

/* ============================================================
   ÁREA TÉCNICA — cores uniformizadas com o mobile, EM TODOS OS TAMANHOS
   (pedido explícito para também mudar o desktop aqui). Só cores/estado
   ativo; o resto do layout de desktop (sem cartão, sidebar, etc.) fica
   como estava - não foi pedido para mudar.
   ============================================================ */
.anexos-container .at-cabecalho h5 { color: #40c7c5; }
.anexos-container .at-cabecalho h6 { color: #6b7280; }
.anexos-container .at-cabecalho .at-contacto { color: #9aa1ab; }
.anexos-container .at-cabecalho .at-contacto a { color: #40c7c5; }

.anexos-acordeao .acordeao-folder-ic { color: #40c7c5; }
.anexos-acordeao .acordeao-header.active .acordeao-folder-ic { color: #fff; }

.anexos-acordeao .acordeao-pasta.pasta-raiz > .acordeao-header { color: #1f2937; }
.anexos-acordeao .acordeao-pasta.pasta-raiz > .acordeao-header.active {
    background-color: #40c7c5 !important;
    color: #ffffff !important;
}


/* --- ALINHAMENTO ESPECÍFICO PARA A PÁGINA TERMOS.PHP (usando a classe page-termos) --- */

/* 1. Alinha o container principal de conteúdo à esquerda */
.main-content.page-termos {
    text-align: left;
}

/* 2. Garante que o card-body (onde o texto está) anule qualquer centralização herdada */
/* Usar !important para anular regras de centralização do Bootstrap/Global, se existirem */
.main-content.page-termos .card-body {
    text-align: left !important;
}

/* 3. Garante que todos os títulos e parágrafos dentro do card-text respeitem o alinhamento esquerdo */
.main-content.page-termos .card-text h1,
.main-content.page-termos .card-text h3,
.main-content.page-termos .card-text p,
.main-content.page-termos .card-text .lead,
.main-content.page-termos .card-text .ms-4 {
    text-align: left;
}

/* --- ESTILOS DE TAMANHO E COR ESPECÍFICOS PARA A PÁGINA TERMOS.PHP --- */

/* 1. Estilo para a classe 'lead mb-4' */
/* Esta é a primeira linha de texto do termo: "A compra de produtos em E-Commerce..." */
.page-termos .lead.mb-4 {
    font-size: 1.1rem !important; /* Força o tamanho da fonte para 1.1rem */
}

/* 2. Estilo para o título principal 'card-title' (H1) */
/* "Termos e Condições" */
.page-termos .card-title {
    font-size: 1.5rem !important; /* Força o tamanho da fonte para 1.5rem */
}

/* 3. Estilo para as classes 'text-primary mb-3' (os títulos H3) */
/* "1. Objeto", "2. Informação de Produtos...", etc. */
.page-termos .text-primary.mb-3 {
    /* O Bootstrap geralmente define 'text-primary' como azul. Queremos preto. */
    color: #000000 !important; /* Define a cor do texto para preto puro */
    font-size: 1.2rem;
}





/***********************************
* Estilo do loading 
*********************************** */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}






/** PRODUTOS **/

.product-ficha-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
    margin: 20px 0;
    min-width: -webkit-fill-available;
    width: 100%;
}

.product-ficha-header {
    border-bottom: 2px solid #40c7c5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.product-ficha-header h1 {
    color: #40c7c5;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.product-ficha-header .ref {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

.product-image-wrapper {
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.product-info-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #40c7c5;
}

.product-info-card h3 {
    color: #40c7c5;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 500;
    color: #555;
    font-size: larger;
}

.spec-value {
    font-weight: 600;
    color: #333;
    font-weight: bold;
}

.subtotal {
    font-weight: 600;
    color: #333;
    font-size: larger;
    font-weight: bold;
}

.price-section {
    background: #e7f3ff;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #b3d7ff;
}

.price-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: #40c7c5;
    margin-bottom: 5px;
}

.price-detail {
    color: #666;
    font-size: 0.9rem;
}

.stock-status {
    /*display: inline-flex;*/
    display: none !important;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 0;
}

.stock-available {
    background: #d4edda;
    color: #155724;
}

.stock-unavailable {
    background: #ffe5d0;
    color: #fd7e14;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    justify-content: flex-start;
}

.quantity-input {
    width: 80px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.btn-add-cart-ficha {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-add-cart-ficha:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-add-cart-ficha i {
    font-size: 1.1rem;
}

.discount-badge {
    background: #17a2b8;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.regras-desconto {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: #856404;
}

.regras-desconto strong {
    display: block;
    margin-bottom: 5px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.product-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.product-tag.primary {
    background: #cfe2ff;
    color: #084298;
}

.product-tag.success {
    background: #d1e7dd;
    color: #0f5132;
}

@media (max-width: 768px) {
    .product-info-grid {
        grid-template-columns: 1fr;
    }
    
    .product-ficha-header h1 {
        font-size: 1.3rem;
    }
    
    .price-main {
        font-size: 1.5rem;
    }
}





/** CHANGE PASSWORD **/

.password-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

/* ============================================================
   CHECKOUT / Finalizar Encomenda (checkout.php) — APENAS MOBILE
   (< 992px). Polimento visual: cartões mais apertados, dados de
   faturação em lista compacta, botões e totais uniformes. Desktop igual.
   ============================================================ */
@media (max-width: 991.98px) {
    .checkout-container {
        max-width: 100% !important;
        margin: 4px 0 0 0 !important;
        padding: 0 !important;
    }
    #checkoutForm > .row { margin-left: 0 !important; margin-right: 0 !important; }
    #checkoutForm > .row > [class*="col-"] { padding-left: 0 !important; padding-right: 0 !important; }
    .checkout-container .row.mb-4 { margin: 0 !important; }

    /* Cartões de secção */
    .checkout-container .section-card {
        padding: 14px !important;
        margin-bottom: 12px !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        transition: none !important;
        background: #fff !important;
    }
    .checkout-container .section-card:hover { transform: none !important; box-shadow: none !important; }
    .checkout-container .section-card .section-card {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    .checkout-container .section-card > h5 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
        border: 0 !important;
        font-size: 0.98rem !important;
        font-weight: 700 !important;
        color: #40c7c5 !important;
    }
    .checkout-container .section-card > h5 i { color: #40c7c5 !important; }

    /* Opções: entrega / morada / pagamento */
    .checkout-container .shipping-option,
    .checkout-container .payment-option {
        padding: 12px !important;
        margin-bottom: 8px !important;
        border-width: 1.5px !important;
        border-radius: 10px !important;
    }
    .checkout-container .shipping-option .option-content,
    .checkout-container .payment-option .option-content { gap: 10px !important; }
    .checkout-container .shipping-option h6,
    .checkout-container .payment-option h6 {
        margin: 0 !important;
        font-size: 0.88rem !important;
        font-weight: 600;
    }
    .checkout-container .shipping-option h8 {
        display: block;
        margin-top: 2px;
        font-size: 0.76rem !important;
        color: #6b7280 !important;
    }

    /* Dados de Faturação -> lista compacta ETIQUETA : valor */
    .checkout-container .customer-data {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    .checkout-container .customer-data > .row { margin: 0 !important; }
    .checkout-container .customer-data > .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .checkout-container .customer-data .row.align-items-center {
        display: grid !important;
        grid-template-columns: 34% 1fr;
        column-gap: 10px;
        align-items: baseline;
        margin: 0 !important;
        padding: 8px 0 !important;
        border-bottom: 1px dashed #eef0f2;
    }
    .checkout-container .customer-data > .row > [class*="col-"]:last-child .row.align-items-center {
        border-bottom: 0;
    }
    .checkout-container .customer-data .row.align-items-center > * {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .checkout-container .customer-data .row.align-items-center > h6 {
        text-align: left !important;
        font-size: 0.73rem !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        color: #6b7280 !important;
    }
    .checkout-container .customer-data .p-2.bg-white.rounded.border {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        text-align: right !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        word-break: break-word;
    }

    /* Resumo da Encomenda */
    .checkout-container .resumo-card {
        background: #f7f9fb !important;
        border-left: 1px solid #e6e8ec !important;
    }
    /* Neutraliza o realce (grande/verde) que apanhava a última linha = IVA */
    .checkout-container .table-totals tr:last-child {
        font-size: inherit !important;
        font-weight: inherit !important;
        color: inherit !important;
    }
    .checkout-container .table-totals td { padding: 3px 0 !important; }
    .checkout-container .table-totals td h6 {
        margin: 0 !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        color: #4b5563 !important;
    }
    .checkout-container .table-totals td h6.text-end { font-weight: 700 !important; color: #1f2937 !important; }
    .checkout-container .table.border-top.border-bottom td { padding: 9px 0 !important; }
    .checkout-container .table.border-top.border-bottom h4 {
        font-size: 1.05rem !important;
        color: #40c7c5 !important;
    }
    .checkout-container .table.border-top.border-bottom tr.text-success { color: #40c7c5 !important; }

    /* Observações */
    .checkout-container textarea.form-control {
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        border: 1.5px solid #d7dbe0 !important;
    }
    .checkout-container label.form-label {
        text-align: left !important;
        font-size: 0.82rem !important;
        font-weight: 600;
        color: #374151;
    }

    /* Total + Confirmar */
    .checkout-container .total-card {
        background: #fff !important;
        border: 1px solid #e6e8ec !important;
    }
    .checkout-container .total-card > .text-center h4 {
        font-size: 1.1rem !important;
        color: #40c7c5 !important;
        margin-bottom: 10px !important;
    }
    .checkout-container .btn-confirmar,
    .checkout-container .btn-confirmar.w-100 {
        width: 100% !important;
        margin: 0 !important;
        padding: 13px 16px !important;
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        border-radius: 10px !important;
        background: #40c7c5 !important;
        box-shadow: none !important;
        color: #fff !important;
    }
    .checkout-container #aceito_termos {
        width: 17px !important;
        height: 17px !important;
        margin: 0 8px 0 0 !important;
        vertical-align: middle;
    }
    .checkout-container .form-check-label[for="aceito_termos"] {
        font-size: 0.8rem !important;
        vertical-align: middle;
    }
    .checkout-container .total-card > .text-center > .text-center { margin-top: 10px !important; }
}

.password-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 30px;
}

.user-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: rgb(51, 174, 172) !important;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.user-email {
    color: #666;
    font-size: 18px;
}


.password-strength {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.password-requirements {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.password-requirements li {
    margin-bottom: 5px;
}

.password-requirements li.valid {
    color: #28a745;
}

.password-requirements li.valid:before {
    content: "✓ ";
}

.btn-submit {
    background: rgb(51, 174, 172) !important;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-back {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

.btn-back:hover {
    text-decoration: underline;
}

/* ============================================================
   "DADOS DE ACESSO" / Alterar Password (changepassword.php) — APENAS
   MOBILE (< 992px). As duas .password-box estavam lado a lado (flex:1)
   e ficavam esmagadas. Passam a empilhar em cartões. Desktop igual.
   ============================================================ */
@media (max-width: 991.98px) {
    .password-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 4px 0 0 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    .password-box {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        margin: 0 0 12px 0 !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }
    .password-box .user-info {
        margin-bottom: 14px !important;
        padding-bottom: 12px !important;
    }
    .password-box .user-avatar {
        width: 54px !important;
        height: 54px !important;
        font-size: 22px !important;
        margin: 0 auto 8px !important;
    }
    .password-box .user-name { font-size: 1rem !important; }
    .password-box .user-email { font-size: 0.84rem !important; word-break: break-all; }
    .password-box h2 {
        font-size: 1.05rem !important;
        margin-bottom: 14px !important;
        color: #40c7c5 !important;
    }
    .password-box .password-requirements {
        margin: 0 !important;
        padding: 12px !important;
        font-size: 0.8rem !important;
    }
    .password-box .password-requirements #req-length,
    .password-box .password-requirements #req-match {
        justify-content: flex-start !important;
    }

    /* Formulário */
    #form-password .form-group { margin-bottom: 14px !important; }
    #form-password label {
        display: block !important;
        text-align: left !important;
        margin-bottom: 5px !important;
        font-size: 0.8rem !important;
        font-weight: 600;
        color: #374151;
    }
    #form-password .pw-input-wrap { width: 100%; }
    #form-password input[type="password"],
    #form-password input[type="text"] {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 11px 40px 11px 12px !important;
        font-size: 0.9rem !important;
        border: 1.5px solid #d7dbe0 !important;
        border-radius: 8px !important;
    }
    #form-password .btn-submit {
        padding: 13px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }
    #form-password #backdiv { margin-top: 8px !important; }
    #form-password #backdiv #back { width: 100% !important; }
}
        




/* DataTables Custom Styles */

#customer-datatable_wrapper {
    padding: 0;
}

#customer-datatable th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    padding: 8px 4px !important;
}

#customer-datatable td {
    vertical-align: middle;
}

.dataTables_filter {
    float: right;
    margin-bottom: 10px;
}

.dataTables_length {
    float: left;
    margin-bottom: 10px;
}

.dataTables_info {
    padding-top: 10px;
}

.dataTables_paginate {
    margin-top: 10px;
}

/* Botões de ação */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-pdf {
    cursor: pointer;
}

/* Modal de detalhes */
#detailsModal .form-control-plaintext {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

/* Pesquisa avançada */
.advanced-search .card-header {
    background-color: #f8f9fa;
    cursor: pointer;
}

.advanced-search .card-header:hover {
    background-color: #e9ecef;
}

/* Responsividade */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }

    #customer-datatable {
        font-size: 0.9rem;
    }
}

/* ============================================================
   GRELHAS DE DADOS (Conta Corrente / Não Regularizados / Encomendas /
   Moradas — giveme_customerdatatable.php) — APENAS MOBILE (< 992px).
   Tabela larga -> um cartão por linha, com label:valor por campo.
   Mostra toda a informação do desktop, adaptada. Desktop fica igual.
   ============================================================ */
@media (max-width: 991.98px) {
    .container-fluid.mt-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 4px !important;
    }
    .container-fluid.mt-4 > br { display: none !important; }

    /* Saldo devedor: barra à largura total (o seletor .container-fluid.mt-4 ...
       é preciso para ganhar à regra base .saldo_conta_corrente mais abaixo no ficheiro) */
    .container-fluid.mt-4 .saldo_conta_corrente,
    .saldo_conta_corrente {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 0 12px 0 !important;
        padding: 12px 16px !important;
        text-align: center;
        border-radius: 10px !important;
        font-size: 0.86rem !important;
        line-height: 1.45;
    }
    .container-fluid.mt-4 .saldo_conta_corrente_bold,
    .saldo_conta_corrente_bold {
        font-size: 1rem !important;
        white-space: nowrap;
    }

    /* Cartão-contentor + rodapé */
    .card.shadow-sm, #customer-datatable_wrapper { box-shadow: none !important; border: 0 !important; }
    #customer-datatable_wrapper .card-footer { padding: 12px 0 0 0 !important; background: transparent !important; }
    #customer-datatable_wrapper .card-footer .row { margin: 0 !important; }
    #customer-datatable_wrapper .card-footer .col-md-6 { padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
    #customer-datatable_wrapper .card-footer .btn { margin: 0 !important; }

    /* Controlos da DataTable (Mostrar N / Procurar / info / paginação) */
    #customer-datatable_wrapper .dataTables_length,
    #customer-datatable_wrapper .dataTables_filter {
        float: none !important;
        width: 100% !important;
        text-align: left !important;
        margin: 0 0 8px 0 !important;
    }
    #customer-datatable_wrapper .dataTables_length label,
    #customer-datatable_wrapper .dataTables_filter label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.83rem;
        margin: 0;
    }
    #customer-datatable_wrapper .dataTables_filter input { flex: 1 1 auto; width: auto !important; margin: 0 !important; }
    #customer-datatable_wrapper .dataTables_info { font-size: 0.76rem !important; text-align: center; padding: 6px 0 0 0 !important; }
    #customer-datatable_wrapper .dataTables_paginate { text-align: center !important; margin-top: 6px !important; }
    #customer-datatable_wrapper .dataTables_paginate .paginate_button { padding: 6px 10px !important; min-width: 0 !important; }
    #customer-datatable_wrapper .dt-buttons { display: none !important; }

    /* ---- Tabela -> cartões ---- */
    #customer-datatable,
    #customer-datatable tbody,
    #customer-datatable tr,
    #customer-datatable td {
        display: block !important;
        width: auto !important;
    }
    #customer-datatable { border: 0 !important; font-size: 0.82rem !important; }
    #customer-datatable thead { display: none !important; }

    #customer-datatable tbody tr,
    #customer-datatable tbody tr.odd,
    #customer-datatable tbody tr.even {
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        background: #fff !important;
        padding: 3px 12px !important;
        margin-bottom: 8px !important;
    }

    #customer-datatable tbody td {
        display: grid !important;
        grid-template-columns: 38% 1fr;
        column-gap: 10px;
        align-items: center;
        padding: 3px 0 !important;
        border: 0 !important;
        border-bottom: 1px dashed #eef0f2 !important;
        text-align: right !important;
        vertical-align: middle !important;
        min-height: 0 !important;
        line-height: 1.2 !important;
    }
    #customer-datatable tbody tr td:last-child { border-bottom: 0 !important; }
    #customer-datatable tbody td:empty { display: none !important; }
    #customer-datatable tbody td::before {
        content: attr(data-label);
        text-align: left;
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #6b7280;
    }
    #customer-datatable tbody td.text-end { font-weight: 600; color: #1f2937; }
    #customer-datatable tbody td.col-clicavel { color: #40c7c5 !important; font-weight: 700; }
    #customer-datatable tbody td [class^="badge_status_"] {
        min-width: 0 !important;
        justify-self: end;
    }
    #customer-datatable tbody td.text-center:last-child { justify-items: end; }
    #customer-datatable tbody td .btn-pdf,
    #customer-datatable tbody td .btn-details { padding: 7px 11px !important; }

    /* Rodapé de totais (só no Detalhe de Encomenda) */
    #customer-datatable tfoot { display: block !important; }
    #customer-datatable tfoot tr { display: block !important; }
    #customer-datatable tfoot th {
        display: block !important;
        padding: 0 !important;
        border: 0 !important;
    }
    #customer-datatable tfoot th:empty { display: none !important; }
    #customer-datatable tfoot th table {
        margin-top: 8px;
        border: 1px solid #e6e8ec;
        border-radius: 12px;
        background: #f7f9fb;
        padding: 10px 12px;
    }
}


/* Ajustes no container da tabela */
.dataTables_wrapper {
    width: 100% !important;
    overflow-x: hidden !important;
}

.table-responsive {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Remove padding extra do card */
.card-body {
    padding: 0 !important;
}

/* Container estilo "Card" do exemplo */
.datatable-container-custom {
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Estilo do Cabeçalho para parecer com a Grelha de Peças */
#customer-datatable thead th {
    background: #f8f9fa !important;
    color: #333;
    font-weight: bold;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 0px solid #ddd !important;
    padding: 10px 5px;
}

/* Estilo das linhas e bordas */
#customer-datatable {
    border-collapse: collapse !important;
    font-size: 0.85rem;
}

#customer-datatable tbody td {
    vertical-align: baseline;
    padding: 2px 2px;
}

/* Remover bordas padrão do Bootstrap que conflitam */
.dataTables_wrapper .row {
    margin-bottom: 15px;
}

.cart-modal-content .mt-3.text-dark {
    font-size: x-large;
}

.cart-modal-content .desconto {
    font-weight: bold;
}

/* .box-desconto {
    border: 1px solid #ff0000; 
    color: #ff0000;
    padding: 2px 6px;
    display: inline-block;
    text-align: center;
    border-radius: 2px;
    font-weight: bold;
} */

/* Box de desconto conforme imagem anterior */
.box-desconto {
    display: inline-block;
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 1px 4px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 2px;
    margin-right: 5px;
}

/* Ajustes no Card da Direita */
.product-info-card {
    min-height: 400px; /* Ajuste para alinhar com a altura da imagem */
    display: flex;
    flex-direction: column;
}

/* Estilo do input de quantidade */
.input-group-text {
    padding: 0 5px;
    font-size: 10px;
}

/* Ajuste do Título no Meio */
.product-info-middle h1 {
    letter-spacing: -0.5px;
    color: #333;
    font-size: x-large;
    font-weight: bold;
}

.product-info-middle.p-3 {
    text-align: left;
    font-size: small;
}

.d-flex {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
}

/****************************/


    .custom-form-container {
        font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        background: #fff;
        padding: 20px;
    }

    .form-title {
        font-size: 24px;
        font-weight: 600;
        color: #333;
        border-left: 4px solid #d9534f; /* Linha vermelha lateral */
        padding-left: 15px;
    }

    .form-title small {
        font-size: 14px;
        font-weight: 400;
    }

    .custom-label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 5px;
        color: #333;
    }

    .custom-input-box {
        background-color: #f8f9fa; /* Cinza claro da imagem */
        border: 1px solid #dee2e6;
        padding: 10px 15px;
        border-radius: 4px;
        min-height: 42px;
        color: #6c757d;
        font-size: 14px;
        display: flex;
        align-items: center;
         width: 100%; /* Garante que a box ocupa toda a largura da coluna definida (12 ou 6) */
    }


    /* Ajuste para o botão de voltar */
    .btn-outline-dark {
        border-radius: 0;
        text-transform: uppercase;
        font-weight: 600;
        font-size: 12px;
        padding: 10px 25px;
    }


.custom-form-group {
    width: 100%;
}

.mb-3 {
    margin-bottom: 0.5rem !important;
}

/* ============================================================
   "OS MEUS DADOS" (giveme_customerdatafield.php) — APENAS MOBILE
   (< 992px). Dados numa lista compacta label: valor, dentro de um
   cartão, uniforme com o resto. Desktop fica igual.
   ============================================================ */
@media (max-width: 991.98px) {
    .custom-form-container.mt-4 {
        padding: 0 !important;
        margin: 4px 0 0 0 !important;
        background: transparent !important;
    }

    .form-body {
        margin: 0 !important;
        padding: 2px 14px !important;
        border: 1px solid #e6e8ec !important;
        border-radius: 12px !important;
        background: #fff !important;
    }
    .form-body > .row {
        margin: 0 !important;
        display: block !important;
    }
    .form-body > .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .form-body > .row > [class*="col-"].mb-3 { margin-bottom: 0 !important; }

    .form-body .custom-form-group {
        display: grid !important;
        grid-template-columns: 42% 1fr;
        column-gap: 10px;
        align-items: baseline;
        padding: 9px 0 !important;
        border-bottom: 1px dashed #eef0f2;
    }
    .form-body > .row > [class*="col-"]:last-child .custom-form-group {
        border-bottom: 0;
    }

    .form-body .custom-label {
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        font-size: 0.73rem !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        color: #6b7280 !important;
        line-height: 1.25 !important;
    }
    .form-body .custom-label .text-danger { color: #d0463b !important; }

    .form-body .custom-input-box {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        display: block !important;
        text-align: right !important;
        font-size: 0.86rem !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }

    /* Voltar */
    #section-giveme_customerdatafield #back,
    .custom-form-container ~ #back,
    .form-body ~ #back {
        display: block !important;
        width: 100% !important;
        margin: 12px 0 0 0 !important;
        padding: 11px !important;
    }
}

body .mt-4 {
    margin-top: 25px !important;
    padding: 0px;
}

div#customer-datatable_info {
    font-size: small;
}

a.page-link {
    font-size: small;
}

ul.social-icons.d-flex.justify-content-center.list-unstyled.p-0.mb-3 {
    flex-direction: row;
}








/** LISTA DE ENCOMENDAS **/
/* .col-clicavel:hover {
    text-decoration: underline !important;
    color: #33aeac !important; 
} */

.odd, .even {
    border-bottom: 1px solid #9a9898bd !important;
}



/* Esta classe agora será aplicada ao SPAN e não ao TD */
.badge_status_PENDENTE, .badge_status_EM_ABERTO {
    background-color: #ecf020 !important;
    color: #000000 !important;
    padding: 1px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-width: 80px;
    text-transform: uppercase;
}

.badge_status_ANULADO {
    background-color: hsl(0, 0%, 0%) !important;
    color: #ffffff !important;
    padding: 1px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-width: 80px;
    text-transform: uppercase;
}

.badge_status_VENCIDO {
    background-color: hsl(0, 100%, 42%) !important;
    color: #ffffff !important;
    padding: 1px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-width: 80px;
    text-transform: uppercase;
}

.badge_status_FECHADO {
    background-color: #28a745 !important;
    color: #ffffff !important;
    padding: 1px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-width: 80px;
    text-transform: uppercase;
}

.badge_status_PARCIAL {
    background-color: #6530e0 !important;
    color: #ffffff !important;
    padding: 1px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-width: 80px;
    text-transform: uppercase;
}

.saldo_conta_corrente  {
    max-width: 50% !important;
    background-color: #eca363 !important;
    align-items: center !important;
    display: inline-block !important;
    align-content: center !important;
    align-items: center !important;
    padding: 10px !important;
    font-weight:normal  !important;
    border-radius: 4px !important;
}

.saldo_conta_corrente_bold  {
    font-weight: bold !important;
    font-size: larger !important;
}








/** COOKIES **/



/* Cookie Consent Styles */
.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 25px;
    z-index: 9999;
    transform: translateY(200%);
    transition: transform 0.4s ease-in-out;
    border-left: 4px solid #33aeac;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-consent .cookie-icon {
    width: 50px;
    height: 50px;
    background: #f0f7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.cookie-consent .cookie-icon i {
    font-size: 24px;
    color: #33aeac;
}

.cookie-consent h4 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.cookie-consent p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.cookie-consent .cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-consent .btn-cookie {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    flex: 1;
    min-width: 120px;
}

.cookie-consent .btn-accept {
    background: #33aeac;
    color: white;
}

.cookie-consent .btn-accept:hover {
    background: #004494;
}

.cookie-consent .btn-settings {
    background: #e9ecef;
    color: #495057;
}

.cookie-consent .btn-settings:hover {
    background: #dee2e6;
}

.cookie-consent .btn-link {
    background: transparent;
    color: #6c757d;
    text-decoration: underline;
    flex: 0 0 auto;
}

.cookie-consent .btn-link:hover {
    color: #33aeac;
}

/* Modal de Configurações */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cookie-modal.active {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.cookie-modal-body {
    padding: 20px;
}

.cookie-option {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cookie-option:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cookie-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-option-title {
    font-weight: 600;
    color: #333;
}

.cookie-option-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #33aeac;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:disabled + .slider {
    background-color: #33aeac;
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 480px) {
    .cookie-consent {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-consent .btn-cookie {
        width: 100%;
    }
}

/* Seletor específico para os campos de dados na página de checkout */
.customer-data .p-3, 
.customer-data .p-2 {
    padding: .2rem !important;
}

label.form-check-label.h8.mb-0 {
    font-size: 14px;
}

.customer-data {
    padding: 5px !important;
}

.section-card {
    margin-bottom: 10px !important;
    padding: 0.5rem !important;
    padding-bottom: 0px !important;
}

.shipping-option {
    padding: 0.1rem !important;
    margin-bottom: 0.5rem !important;
}

h8 {
    font-size: 0.8rem !important;
}

/* Aplica o tamanho da sua classe h8 ao placeholder do textarea */
textarea.h8::placeholder {
    font-size: 0.8rem !important;
}

/* Garante compatibilidade com Chrome, Edge e Safari */
textarea.h8::-webkit-input-placeholder {
    font-size: 0.8rem !important;
}

/* Garante compatibilidade com Firefox */
textarea.h8::-moz-placeholder {
    font-size: 0.8rem !important;
}

/* Aplica apenas aos títulos h6 dentro desta estrutura */
    .section-card h6, 
    .customer-data h6 {
        margin-bottom: .1rem !important;
    }

.resumo-card h6, 
#enderecosSection h6 {
    font-weight: normal !important;
}

.resumo-card,
.customer-data {
    border-left: none !important;
    padding-bottom: 0.5rem !important;
}

.total-card {
    background: linear-gradient(135deg, #0a58ca00 0%, #0a58ca7a 100%) !important;
    border: 2px solid #33aeac !important;
}


.option-text {
    text-align: start;
}

/* Aplica apenas aos títulos h6 dentro desta estrutura */
    .section-card h5, 
    .customer-data h5 {
        text-align: start;
        font-size: 1.1rem;
    }

.total-card h4 {
        font-weight: 800;
        font-size: 1.1rem;
    }


    /* Aplica apenas aos títulos h6 dentro desta estrutura */
    .section-card h4, 
    .customer-data h4 {
        text-align: start;
        font-size: 1.2rem;
    }


.customer-data .mb-2 {
    margin-bottom: .1rem !important;
}

/* Aplica apenas o alinhamento para a classe específica dentro de .customer-data */
.table-totals h6.text-end {
    text-align: end !important;
}

.payment-option {
    padding: 0.1rem !important;
    margin-bottom: 0.5rem !important;
}


/** CHECK CREDIT **/


/* Estilos para o popup de bloqueio */
#creditBlockPopup {
    animation: fadeIn 0.3s ease;
}

#creditBlockPopup > div > div {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estilo para o loading */
#creditLoading > div {
    animation: fadeIn 0.2s ease;
}

.table-totals h6 {
        text-align: start !important;
    }

    .table-totals td {
            padding-top: 2px !important;
    padding-bottom: 2px !important;
    }


/* Forçar o Azul apenas dentro do checkout */
.checkout-container {
    --bs-success: #40c7c5 !important;
    --success: #40c7c5 !important;
}

/* Sobrescrever as classes utilitárias do Bootstrap dentro do checkout */
.checkout-container .bg-success, 
.checkout-container .btn-success {
    background-color: #40c7c5 !important;
    border-color: #40c7c5 !important;
}

.checkout-container .text-success {
    color: #40c7c5 !important;
}

.checkout-container .border-success,
.checkout-container .shipping-option.selected {
    border-color: #40c7c5 !important;
}

/* Corrigir o Checkbox dos Termos */
.checkout-container .form-check-input:checked {
    background-color: #40c7c5 !important;
    border-color: #40c7c5 !important;
}

.checkout-container .selected {
    border-color: var(--success) !important;
    background-color: #40c7c51c !important;
}

/* Remove qualquer cor de destaque da última linha da tabela de totais */
.table-totals tr:last-child h6 {
    color: inherit !important;
    font-weight: normal !important;
}

/* Garante que o ID específico dos portes não herde o azul do checkout */
#portesValor {
    color: #212529 !important; 
}

/* Remove o azul dos portes e tira o sublinhado se houver */
#portesRow h6, #portesRow td, #portesValor {
    color: #212529 !important; 
    text-decoration: none !important;
}





/*  LISTA DE PRODUTOS */


.custom-p-row { 
    display: grid; 
    grid-template-columns: 140px 1fr 320px; 
    gap: 20px;
    border-bottom: 1px solid #ddd; 
    padding: 25px 10px; 
    background: white;
}
.custom-p-row:hover { background: #fdfdfd; }

/* Coluna Esquerda: Imagens */
.custom-p-img-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.custom-p-prod-img {
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
}
.custom-p-brand-img {
    max-width: 40px;
    max-height: 40px;
    height: auto;
}

.custom-product-brand-img {
    max-width: 120px;
    max-height: 100px;
    height: auto;
}

/* Coluna Central: Info */
.custom-p-info-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}
.custom-p-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    line-height: 1.3;
    text-align: start;
}
.custom-p-title:hover { text-decoration: underline; }
.custom-p-ref {
    font-size: 0.85rem;
    color: #555;
    text-align: start;
}

/* Bloco de Preços Centralizado */
.custom-p-price-block {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 4px 12px;
    justify-content: start;
    font-size: 0.85rem;
    color: #444;
    margin-top: 4px;
    align-items: start;
    max-width: 480px;
}
.custom-p-price-block span {
    display: block;
    min-width: 0;
    text-align: left;
    justify-self: start;
}
.custom-p-price-label {
    font-size: 0.78rem;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.custom-p-discount-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
.custom-p-discount-tag {
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 4px;
    text-align: left;
    width: fit-content;
}
.custom-p-discount-amount {
    font-size: 0.85rem;
    color: #dc3545;
}
.custom-p-final-price {
    font-size: 1.05rem;
    font-weight: bold;
    color: #000;
    text-align: left;
}
.custom-p-price-note {
    font-size: 0.75rem;
    color: #666;
    grid-column: 1 / -1;
    margin-top: 6px;
    line-height: 1.3;
    text-align: left !important;
}

/* Coluna Direita: Ações de Compra */
.custom-p-action-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}
.custom-p-metrics-grid {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 10px;
    text-align: center;
    font-size: 0.85rem;
    align-items: center;
}
.custom-p-metrics-header {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}
.custom-p-input-qty {
    width: 100%;
    height: 2rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Botão de Compra Largo */
.custom-p-btn-cart {
    width: 100%;
    padding: 12px;
    background: #40c7c5;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.custom-p-btn-cart:hover { background: #2b8ee7; }

/* MOBILE: adaptações sem alterar desktop */
@media (max-width: 576px) {
    .custom-p-row {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .custom-p-img-box {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }
    .custom-p-prod-img { max-width: 70px; max-height: 70px; }
    .custom-p-brand-img { max-width: 50px; }
    .custom-p-info-box { order: 2; }
    .custom-p-title { font-size: 1rem; }
    .custom-p-ref { font-size: 0.8rem; }
    .custom-p-price-block { flex-wrap: wrap; gap: 8px; }
    .custom-p-action-box { order: 3; display: flex; flex-direction: column; gap: 8px; }
    .custom-p-metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .custom-p-btn-cart { padding: 10px; border-radius: 8px; font-size: 0.9rem; }
}



/* 
**************************************************
** FICHA VEICULOS
**************************************************
*/

/* Tabela de cores/variantes do veículo (GetVehicleData) */
/* Tabela de cores/variantes do veículo */
.veiculo-cores-table {
    display: table !important; /* Força o comportamento nativo de tabela */
    width: 100% !important;
    max-width: 100%;
    margin-top: 15px;
    border-top: 1px solid #dee2e6;
    border-collapse: collapse;
    table-layout: fixed !important; /* Obriga as colunas a respeitarem as larguras */
}

/* Força as linhas a comportarem-se estritamente como linhas de tabela, */
/* anulando qualquer regra de 'display: grid' ou 'display: flex' herdada. */
.veiculo-cores-table tr {
    display: table-row !important; 
}

.veiculo-cores-table th,
.veiculo-cores-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    padding: 12px 8px;
}

/* Definição rigorosa de larguras para as colunas */
.veiculo-cores-table .col-cores {
    width: auto !important; /* Fica com o espaço restante */
    text-align: left !important;
}

.veiculo-cores-table .col-qtd {
    width: 140px !important; /* Largura fixa e segura para o input */
    text-align: center !important;
}

.veiculo-cores-table .col-subtotal {
    width: 120px !important; /* Largura fixa para o preço */
    text-align: right !important;
}

/* Estilos visuais adicionais */
.veiculo-cores-table th {
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.veiculo-cores-table td {
    border-bottom: 1px solid #f8f9fa;
}

.veiculo-cores-table tr:last-child td {
    border-bottom: none;
}

.veiculo-cor-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 20%;
    border: 1px solid #ccc;
    margin-right: 8px;
    vertical-align: middle;
}

.veiculo-cor-input-qty {
    width: 60px;
    text-align: center;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.veiculo-cores-table .subtotal {
    font-weight: 600;
    color: #40c7c5;
}

.product-info-middle {
    overflow-x: hidden;
}

.col-md-6 {
    overflow: hidden;
}

/* Cartão de resumo (PVR / Desconto linha / Preço) */
.veiculo-resumo-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
}

.veiculo-marca-logo {
    max-height: 45px;
    max-width: 140px;
    object-fit: contain;
    object-position: top;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0;
    margin-left: auto;
    padding-left: 15px;
}

.d-flex.justify-content-between.align-items-start.flex-wrap {
    flex-flow: wrap;
}

@media (max-width: 576px) {
    .veiculo-marca-logo {
        margin-left: 0;
        margin-top: 10px;
    }
}

.veiculo-resumo-linha {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.veiculo-resumo-linha:last-child {
    border-bottom: none;
}

.veiculo-resumo-label {
    font-size: 0.8rem;
    color: #666;
}

.veiculo-resumo-pvr {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.veiculo-resumo-desconto-valor {
    font-size: 0.85rem;
    color: #dc3545;
    margin-left: 6px;
}

.veiculo-resumo-preco-final .veiculo-resumo-preco {
    font-size: 1.3rem;
    font-weight: 700;
    color: #40c7c5;
}

.custom-p-discount-tag {
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 1px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
}

/* Total + botão único de adicionar ao carrinho */
.veiculo-resumo-total-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
}

.veiculo-resumo-total-label {
    font-size: 0.85rem;
    color: #666;
}

.veiculo-resumo-total-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.veiculo-resumo-nota {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 12px;
}

.veiculo-resumo-btn-cart {
    width: 100%;
    background: #212529;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.veiculo-resumo-btn-cart:hover {
    background: #40c7c5;
}

.veiculo-resumo-btn-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .veiculo-cores-table th:nth-child(2),
    .veiculo-cores-table td:nth-child(2) {
        text-align: center;
    }
}

.product-ficha-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
    margin: 20px 0;
}

.product-ficha-header {
    border-bottom: 2px solid #40c7c5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.product-ficha-header h1 {
    color: #40c7c5;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.product-ficha-header .ref {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

.product-image-wrapper {
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.product-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-info-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    border-left: 4px solid #40c7c5;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 500;
    color: #555;
}

.spec-value {
    font-weight: 600;
    color: #333;
    text-align: right;
}

.price-original {
    font-size: 1.4rem;
    font-weight: 700;
    color: #40c7c5;
}

.price-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
    margin: 10px 0;
}

.price-main small {
    font-size: 1rem;
    margin-left: 10px;
}

.price-detail {
    color: #666;
    font-size: 0.9rem;
}

.price-section {
    background: #e7f3ff;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #b3d7ff;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 0;
}

.stock-available {
    background: #d4edda;
    color: #28a745;
}

.stock-unavailable {
    background: #ffe5d0;
    color: #fd7e14;
}

.discount-badge {
    background: #17a2b8;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.quantidade-input {
    width: 50px;
    text-align: center;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.btn-add-cart-ficha {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-add-cart-ficha:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-add-cart-ficha:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.text-decoration-line-through {
    text-decoration: line-through;
}

/* Estilos para os descontos */
.regras-desconto-container {
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 10px;
}

.desconto-atual {
    border-left: 4px solid #28a745;
}

.escaloes-desconto {
    max-height: 200px;
    overflow-y: auto;
}

.escalao-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.escalao-item:hover {
    border-color: #dee2e6;
    background: white;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

@media (max-width: 768px) {
    .quantity-control {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantidade-input {
        width: 100%;
    }
    
    .price-main {
        font-size: 1.5rem;
    }
}


.text-taxes {
    padding-left: 3vw !important;
    --bs-text-opacity: 1;
    color: rgb(51, 174, 172) !important;
}

/* ============================== */
/* MENU DE CATEGORIAS (familias/subfamilias do ERP, ver menu.php)
   Desktop: painel por baixo da barra azul com as familias a esquerda e as
   subfamilias da familia sob o rato a direita, em colunas.
   Mobile: lista de familias; o toque abre as subfamilias com "Voltar". */
/* ============================== */
.navbar.menu > .container {
    position: relative;
}

.navbar .navbar-nav-tree .mega-categorias {
    position: static;
}

.navbar.menu .navbar-nav-tree .mega-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.navbar.menu .navbar-nav-tree .mega-toggle.aberto {
    background: #ffffff !important;
    color: #33aeac !important;
    border-color: #33aeac !important;
}

.mega-panel {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    z-index: 1300;
    display: flex;
    height: min(560px, 75vh);
    margin-top: 6px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(32, 32, 35, .18);
    overflow: hidden;
    text-align: left;
}

.mega-panel[hidden] {
    display: none;
}

.mega-familias {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    width: 290px;
    min-width: 290px;
    overflow-y: auto;
    border-right: 1px solid #eef0f1;
}

.mega-familia {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 16px;
    color: #474a4e;
    font-size: 14px;
    font-weight: 500;
    line-height: 16px;
    text-decoration: none;
}

.mega-familia:hover,
.mega-familia.ativa {
    background: #eaf7f7;
    color: #33aeac;
    text-decoration: none;
}

.mega-familia-icone {
    width: 26px;
    min-width: 26px;
    text-align: center;
    font-size: 17px;
    color: #33aeac;
}

.mega-familia-nome {
    flex: 1;
}

.mega-familia-seta {
    font-size: 10px;
    color: #b5b8ba;
}

.mega-familia.ativa .mega-familia-seta {
    color: #33aeac;
}

.mega-subs {
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px;
}

.mega-sub-titulo {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eef0f1;
    font-size: 16px;
    font-weight: 700;
    color: #33aeac;
    text-transform: uppercase;
}

.mega-ver-tudo {
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    color: #474a4e;
    text-decoration: none;
}

.mega-ver-tudo i {
    font-size: 8px;
    margin-left: 4px;
    color: #33aeac;
}

.mega-ver-tudo:hover {
    color: #33aeac;
}

.mega-sub-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    column-width: 200px;
    column-gap: 24px;
}

.mega-sub-lista li {
    break-inside: avoid;
}

.mega-sub-lista a {
    display: block;
    padding: 6px 0;
    color: #76787a;
    font-size: 13px;
    line-height: 16px;
    text-decoration: none;
}

.mega-sub-lista a:hover {
    color: #33aeac;
}

.mega-voltar {
    display: none;
}

@media (max-width: 1199.98px) {
    .mega-sub-lista {
        column-width: 200px;
    }
}

/* Mobile: o painel fica dentro do menu hamburguer, em fluxo normal */
@media (max-width: 991.98px) {
    .navbar.menu #navbarNav .navbar-nav-tree > .mega-categorias {
        flex-direction: column !important;
        width: 100% !important;
    }

    .mega-panel {
        position: static;
        height: auto;
        max-height: 70vh;
        margin: 6px 0 0;
        width: 100%;
    }

    .mega-familias {
        width: 100%;
        min-width: 0;
        border-right: none;
    }

    .mega-subs {
        display: none;
        padding: 12px 16px;
    }

    .mega-panel.mega-sub-aberta .mega-familias {
        display: none;
    }

    .mega-panel.mega-sub-aberta .mega-subs {
        display: block;
    }

    .mega-voltar {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        padding: 4px 0;
        border: none;
        background: none;
        color: #33aeac;
        font-weight: 600;
    }

    .mega-sub-lista {
        column-width: 200px;
    }
}


/* ============================== */
/* MENU LATERAL DE CATEGORIAS (ao estilo do aquario.pt, ver menu.php)
   Desktop: a barra azul desaparece; as familias ficam numa barra fixa a
   esquerda, so com icones, que abre ao passar o rato. As subfamilias da
   familia sob o rato aparecem num painel a direita, em colunas. Na pagina
   inicial, em ecras largos, a barra fica sempre aberta.
   Mobile: a barra de icones passa a branca e o menu abre a lista de familias. */
/* ============================== */
.menu-lateral {
    display: none;
}

@media (min-width: 992px) {
    .navbar.menu {
        display: none !important;
    }

    .menu-lateral {
        display: block;
        position: fixed;
        top: var(--altura-header, 70px);
        left: 0;
        bottom: 0;
        z-index: 1028;
        width: 62px;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        background: #ffffff;
        box-shadow: 0 3px 7px rgba(32, 32, 35, .08);
        transition: width .25s ease-in-out .15s;
    }

    .menu-lateral::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .menu-lateral:hover {
        width: 256px;
        transition-delay: 0s;
    }

    body:has(.menu-lateral) .main-content,
    body:has(.menu-lateral) .footer {
        margin-left: 62px;
    }

    .menu-lateral-lista {
        list-style: none;
        margin: 0;
        padding: 10px 0;
    }

    .menu-lateral-link {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 7px 16px;
        color: #474a4e;
        font-size: 13px;
        font-weight: 500;
        line-height: 15px;
        text-decoration: none;
    }

    .menu-lateral-link:hover,
    .menu-lateral-item:hover > .menu-lateral-link {
        background: #ccedec;
        color: #2a908f;
        text-decoration: none;
    }

    .menu-lateral-icone {
        width: 30px;
        min-width: 30px;
        text-align: center;
        font-size: 17px;
        line-height: 30px;
        color: #33aeac;
    }

    /* Largura fixa (a da barra aberta): os nomes longos quebram em duas
       linhas em vez de mudarem de forma durante a animação de abrir */
    .menu-lateral-nome {
        flex: 0 0 auto;
        width: calc(256px - 32px - 30px - 16px - 26px);
    }

    .menu-lateral-seta {
        font-size: 9px;
        color: #2a908f;
        opacity: 0;
    }

    .menu-lateral-item:hover .menu-lateral-seta {
        opacity: 1;
    }

    /* Painel das subfamilias: fixo (e nao absoluto) para nao ser cortado
       pelo scroll vertical da barra lateral */
    .menu-lateral-sub {
        display: none;
        position: fixed;
        top: var(--altura-header, 70px);
        left: 256px;
        bottom: 0;
        z-index: 1027;
        width: min(calc(100vw - 256px), 1000px);
        overflow-y: auto;
        padding: 20px 28px;
        background: #ffffff;
        box-shadow: 6px 3px 12px rgba(32, 32, 35, .12);
        text-align: left;
    }

    .menu-lateral-item:hover > .menu-lateral-sub {
        display: block;
    }

    .menu-lateral-sub .mega-sub-lista {
        column-width: 200px;
    }
}

@media (min-width: 1200px) {
    .menu-lateral.menu-lateral-fixo {
        width: 256px;
    }

    body:has(.menu-lateral-fixo) .main-content,
    body:has(.menu-lateral-fixo) .footer {
        margin-left: 256px;
    }

    .menu-lateral-sub .mega-sub-lista {
        column-width: 200px;
    }
}

/* Mobile: barra de icones branca (sem a barra azul) e, ao abrir o menu, a
   lista de familias aparece logo (sem o botao "Categorias" intermedio) */
@media (max-width: 991.98px) {
    .navbar.menu {
        background-color: #ffffff !important;
        border-bottom: 1px solid #eef0f1;
        box-shadow: 0 2px 6px rgba(32, 32, 35, .06);
    }

    .navbar.menu .menu-icon-btn,
    .navbar.menu .menu-icon-btn:hover,
    .navbar.menu .menu-icon-btn:focus,
    .navbar.menu .menu-icon-btn > i,
    .navbar.menu .navbar-toggler,
    .navbar.menu .navbar-toggler .menu-toggler-fa {
        color: #33aeac !important;
    }

    .navbar.menu .menu-icon-btn[aria-expanded="true"],
    .navbar.menu .navbar-toggler:not(.collapsed) {
        background: rgba(51, 174, 172, .12) !important;
    }

    .navbar.menu #navbarNav .navbar-nav-tree .mega-toggle {
        display: none !important;
    }

    .navbar.menu .mega-panel {
        flex-direction: column;
        margin-top: 0;
        box-shadow: none;
        border: 1px solid #eef0f1;
    }
}


/* ============================== */
/* MINI-CESTO (ao passar o rato no botao do carrinho, so desktop - ver
   carregarMiniCesto() em header.php). Medidas do cesto do aquario.pt. */
/* ============================== */
.mini-cesto {
    display: none;
}

@media (min-width: 992px) {
    .mini-cesto-wrapper {
        position: relative;
    }

    /* padding-top faz a "ponte" entre o botao e o cartao, para o rato nao
       sair da area de hover ao descer */
    .mini-cesto {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 1040;
        width: 320px;
        padding-top: 12px;
    }

    .mini-cesto-wrapper:hover .mini-cesto {
        display: block;
    }

    .mini-cesto-wrapper.mini-cesto-fechado .mini-cesto {
        display: none;
    }

    .mini-cesto-conteudo {
        padding: 30px 16px;
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 0 7px rgba(32, 32, 35, .12);
        color: #474a4e;
        text-align: left;
    }

    .mini-cesto-vazio {
        text-align: center;
        font-size: 14px;
    }

    /* scrollbar-gutter + padding-right: a barra de scroll fica no seu próprio
       espaço, à direita do botão de remover, em vez de passar por cima dele */
    .mini-cesto-itens {
        max-height: 278px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
        padding-right: 8px;
    }

    .mini-cesto-item {
        display: flex;
        align-items: flex-start;
    }

    .mini-cesto-item:not(:first-child) {
        margin-top: 20px;
    }

    .mini-cesto-img {
        display: block;
        width: 70px;
        min-width: 70px;
        height: 70px;
    }

    .mini-cesto-img img {
        display: block;
        max-width: 100%;
        max-height: 100%;
        margin: 0 auto;
    }

    .mini-cesto-info {
        flex-grow: 1;
        min-width: 0;
        margin: 0 16px;
    }

    .mini-cesto-nome {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 5px;
        color: #474a4e;
        font-size: 12px;
        font-weight: 700;
        line-height: 17px;
        text-decoration: none;
    }

    .mini-cesto-nome:hover {
        color: #40c7c5;
    }

    .mini-cesto-qtd {
        margin-bottom: 5px;
        font-size: 12px;
        line-height: 17px;
    }

    .mini-cesto-valor {
        color: #40c7c5;
        font-size: 16px;
        font-weight: 900;
        letter-spacing: .25px;
        line-height: 19px;
    }

    .mini-cesto-remover {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        background: none;
        color: #000000;
        font-size: 18px;
        line-height: 24px;
    }

    .mini-cesto-remover:hover {
        color: #dc3545;
    }

    .mini-cesto-total {
        margin-top: 20px;
    }

    .mini-cesto-total-texto {
        display: inline-block;
        vertical-align: middle;
        font-weight: 700;
    }

    .mini-cesto-total-valor {
        display: inline-block;
        vertical-align: middle;
        margin-left: 16px;
        color: #40c7c5;
        font-size: 26px;
        font-weight: 900;
        letter-spacing: .25px;
    }

    .mini-cesto-botoes {
        display: flex;
        gap: 16px;
        margin-top: 20px;
    }

    .mini-cesto-botoes .btn {
        flex-grow: 1;
        font-size: 13px;
    }
}


/* ============================== */
/* MENU DE CATEGORIAS - 3o NIVEL (sub-subfamilias, artigo.cdu_artigossubfam)
   A subfamilia fica em destaque e as sub-subfamilias por baixo, mais leves,
   como no aquario.pt. Cada subfamilia nao se parte entre colunas. */
/* ============================== */
.mega-sub-lista > li {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.mega-sub-lista a.mega-sub-nivel2 {
    padding-top: 8px;
    color: #474a4e;
    font-weight: 700;
}

.mega-sub-lista a.mega-sub-nivel2:hover {
    color: #33aeac;
}

.mega-subsub-lista {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
}

.mega-sub-lista .mega-subsub-lista a {
    padding: 3px 0;
    color: #76787a;
    font-size: 12.5px;
    font-weight: 300;
}

.mega-sub-lista .mega-subsub-lista a:hover {
    color: #33aeac;
}

/* ===== As minhas encomendas (lista e detalhe): aspeto do carrinho (.carrinho-v2) ===== */
.tabela-v2,
.tabela-v2 .dataTables_wrapper,
.tabela-v2 #customer-datatable { color: #202023; font-size: .875rem; }
.tabela-v2 .card.shadow-sm { box-shadow: none !important; border: 0 !important; }
.tabela-v2 .dataTables_wrapper .dataTables_length,
.tabela-v2 .dataTables_wrapper .dataTables_filter,
.tabela-v2 .dataTables_wrapper .dataTables_info,
.tabela-v2 .dataTables_wrapper .dataTables_paginate { font-size: .8rem; color: #6b7280; }
.tabela-v2 .dataTables_wrapper .dataTables_filter input,
.tabela-v2 .dataTables_wrapper .dataTables_length select {
    border: 1px solid #e6e8ec; border-radius: 8px; padding: 4px 10px; font-size: .8rem; color: #202023;
}
.tabela-v2 .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.tabela-v2 .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #40c7c5 !important; border-color: #40c7c5 !important; color: #fff !important; border-radius: 6px;
}

/* Etiquetas de estado como as do carrinho, mantendo a cor de cada estado */
.tabela-v2 #customer-datatable [class^="badge_status_"] {
    font-size: .75rem !important;
    font-weight: 400 !important;
    padding: 2px 7px !important;
    border-radius: 3px !important;
    min-width: 0 !important;
}

/* Botões do rodapé como os do carrinho */
.tabela-v2 .card-footer { background: transparent !important; border-top: 0 !important; padding: 18px 0 14px !important; }
.tabela-v2 .card-footer .btn {
    border: 0 !important; border-radius: 6px !important; padding: 9px 22px !important;
    font-weight: 700 !important; font-size: .875rem !important;
}
.tabela-v2 .card-footer #back { background: #d4f2f1 !important; color: #33aeac !important; }
.tabela-v2 .card-footer #back:hover { background: #c2ecea !important; }
.tabela-v2 .card-footer #export-excel,
.tabela-v2 .card-footer #export-pdf { background: #40c7c5 !important; color: #fff !important; }
.tabela-v2 .card-footer #export-excel:hover,
.tabela-v2 .card-footer #export-pdf:hover { background: #33aeac !important; }

/* Ações (PDF / detalhe) discretas, como o botão de remover do carrinho */
.tabela-v2 #customer-datatable .btn-pdf,
.tabela-v2 #customer-datatable .btn-details {
    background: none !important; border: 0 !important; color: #202023 !important; padding: 2px 6px !important; font-size: .95rem;
}
.tabela-v2 #customer-datatable .btn-pdf:hover,
.tabela-v2 #customer-datatable .btn-details:hover { color: #33aeac !important; }
.tabela-v2 #customer-datatable td.col-clicavel { color: #33aeac !important; font-weight: 700; }

@media (min-width: 768px) {
    .tabela-v2 #customer-datatable { border-collapse: collapse !important; }
    .tabela-v2 #customer-datatable thead th {
        background: transparent !important;
        color: #555 !important;
        font-weight: 700 !important;
        font-size: .875rem !important;
        padding: 0 14px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e6e8ec !important;
        white-space: nowrap;
    }
    .tabela-v2 #customer-datatable tbody td {
        padding: 16px 14px !important;
        vertical-align: middle !important;
        border: 0 !important;
        border-bottom: 1px solid #e6e8ec !important;
        background: #fff !important;
        box-shadow: none !important;
        font-size: .875rem;
    }
    .tabela-v2 #customer-datatable tbody tr:hover td { background: #f7fbfb !important; }
    .tabela-v2 #customer-datatable tfoot th {
        background: transparent !important;
        border: 0 !important;
        padding: 16px 14px !important;
        font-weight: 700;
        color: #202023;
    }
}
@media (max-width: 767.98px) {
    .tabela-v2 #customer-datatable { font-size: .875rem !important; }
    .tabela-v2 #customer-datatable tbody td::before { color: #555; }
}
