/* Catálogo de Cores CIN */
:root {
    --primary-color: #d32304;
    --primary-dark: #a81808;
    --text-dark: #262626;
    --text-muted: #5f5f5f;
    --bg: #f6f5f2;
    --card: #ffffff;
    --line: #e6e3dd;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
}

main.catalogo {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
}

/* Introdução */
.intro {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 2rem;
}

.intro h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.intro h1 span {
    color: var(--primary-color);
}

.intro p {
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.intro .aviso {
    font-size: 0.85rem;
}

/* Barra de filtros */
.filtros {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 245, 242, 0.96);
    backdrop-filter: blur(6px);
    padding: 1rem 0 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.filtros-linha {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.pesquisa {
    flex: 1 1 260px;
    position: relative;
}

.pesquisa i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.pesquisa input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    background: #fff;
}

.pesquisa input:focus,
.filtros select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.filtros select {
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    background: #fff;
    cursor: pointer;
}

.chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0 0.25rem;
    scrollbar-width: thin;
}

.chip {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover {
    border-color: #bbb;
}

.chip[aria-pressed="true"] {
    background: var(--text-dark);
    border-color: var(--text-dark);
    color: #fff;
}

.chip .ponto {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.chip small {
    opacity: 0.7;
}

.contagem {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

/* Catálogos e famílias */
.cat-seccao {
    margin-bottom: 3rem;
}

.cat-cabecalho {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--text-dark);
}

.cat-cabecalho h2 {
    margin: 0;
    font-size: 1.7rem;
}

.cat-cabecalho p {
    margin: 0;
    color: var(--text-muted);
}

.familia {
    margin-bottom: 1.75rem;
}

.familia h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.grelha {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
}

.cor {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.cor:hover,
.cor:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cor:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.cor .amostra {
    display: block;
    height: 96px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cor .info {
    display: block;
    padding: 0.6rem 0.75rem 0.7rem;
}

.cor .ref {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.cor .nome {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cor .fav-marca {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.cor.favorita .fav-marca {
    display: flex;
}

.sem-resultados {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* Janela de detalhe */
dialog.detalhe {
    border: none;
    border-radius: 16px;
    padding: 0;
    width: min(440px, calc(100vw - 2rem));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: var(--text-dark);
}

dialog.detalhe::backdrop {
    background: rgba(20, 20, 20, 0.55);
}

.detalhe .grande {
    height: 220px;
    position: relative;
}

.detalhe .fechar {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    cursor: pointer;
}

.detalhe .corpo {
    padding: 1.25rem 1.5rem 1.5rem;
}

.detalhe h2 {
    margin: 0;
    font-size: 1.5rem;
    text-transform: capitalize;
}

.detalhe .meta {
    color: var(--text-muted);
    margin: 0.25rem 0 1rem;
}

.detalhe dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.detalhe dt {
    color: var(--text-muted);
}

.detalhe dd {
    margin: 0;
    font-weight: 600;
}

.acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.botao {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-dark);
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.botao:hover {
    border-color: #aaa;
}

.botao.principal {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.botao.principal:hover {
    background: var(--primary-dark);
}

.detalhe .cin-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Barra de favoritas */
.barra-favoritas {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 900;
    background: var(--text-dark);
    color: #fff;
    border-radius: 999px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: calc(100vw - 110px);
}

.barra-favoritas .mini {
    display: flex;
}

.barra-favoritas .mini span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--text-dark);
    margin-left: -6px;
}

.barra-favoritas .mini span:first-child {
    margin-left: 0;
}

.barra-favoritas .texto {
    font-size: 0.9rem;
    white-space: nowrap;
}

.barra-favoritas .botao {
    padding: 0.5rem 0.9rem;
}

.barra-favoritas .limpar {
    background: transparent;
    color: #ccc;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}

.toast {
    position: fixed;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 2000;
}

.whatsapp-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    text-decoration: none;
}

@media (max-width: 600px) {
    .grelha {
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        gap: 0.6rem;
    }

    .cor .amostra {
        height: 72px;
    }

    .cor .info {
        padding: 0.45rem 0.55rem 0.55rem;
    }

    .filtros {
        position: static;
    }

    .filtros select {
        flex: 1 1 100%;
    }

    .barra-favoritas .texto {
        display: none;
    }
}
