/* header-section.css */

.header-section {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 0 0;
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    /*
     * Posição inicial: relative com margin-top = altura navbar+banner.
     * O JS (dynamic-positioning.js) assume o controle a partir do scroll.
     * O margin-top CSS garante renderização correta antes do JS carregar.
     */
    position: relative;
    margin-top: 160px; /* navbar(120) + barra contato(40) — desktop */
    top: auto;
    z-index: 998;
    text-align: left;
}

@media (max-width: 768px) {
    .header-section {
        margin-top: 126px; /* navbar(90) + barra contato(36) — mobile */
    }
}

.header-section.fixed-header {
    position: fixed !important;
    top: var(--navbar-total-height, 60px) !important;
    left: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 998 !important;
}

/* ── Conteúdo ─────────────────────────────────────────────────────────
   O fundo da barra continua full-width (porque .header-section ocupa
   100%), mas o CONTEÚDO interno alinha com o container central do
   product_info (max-width 1600px), igual ao restante do body. */
.header-section-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

.header-section.fixed-header .header-section-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 6px 24px 8px;
}

/* ── Breadcrumb ── */
.header-section-breadcrumb-container {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.header-section-breadcrumb-link {
    text-decoration: none;
    color: #888;
    font-size: 11px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.header-section-breadcrumb-link:hover {
    color: #BB0606;
    text-decoration: none;
}

.header-section-breadcrumb-separator {
    color: #ccc;
    font-size: 11px;
}

.header-section-breadcrumb-current {
    font-size: 11px;
    color: #BB0606;
    white-space: nowrap;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Título ── */
.header-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin: 0 0 8px;
    line-height: 1.2;
    text-align: left;
}

/* ── Linha separadora ── */
.header-section-separator-container {
    position: absolute;
    width: 100vw;
    height: 1px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.header-section-separator {
    width: 100%;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    height: 1px;
}

.header-section.fixed-header .header-section-separator-container {
    margin-bottom: 0;
}

/* ── Pseudo-fundo para estado fixo ── */
.header-section.fixed-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: -1;
}

/* ── Transições suaves nos filhos ── */
.header-section * {
    transition: color 0.2s ease, font-size 0.2s ease;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .header-section-content {
        padding: 0 16px;
    }

    .header-section.fixed-header .header-section-content {
        max-width: 1600px;
        margin: 0 auto;
        padding: 5px 16px 6px;
    }

    .header-section-breadcrumb-container {
        font-size: 10px;
        gap: 5px;
    }

    .header-section-breadcrumb-link,
    .header-section-breadcrumb-separator,
    .header-section-breadcrumb-current {
        font-size: 10px;
    }

    .header-section-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .truncate {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
}
