/*
 * Refinamentos responsivos da vitrine MTS.
 * Este arquivo complementa o CSS principal sem alterar seus componentes.
 */

.filter-bar > .btn {
    align-self: end;
    height: 46px;
    min-height: 46px;
    border-radius: 9px;
}

.site-header .brand img {
    width: auto;
    max-width: 150px;
    max-height: 30px;
    object-fit: contain;
}

.footer-brand img {
    width: auto;
    max-width: 180px;
    max-height: 38px;
    object-fit: contain;
}

@media (min-width: 861px) {
    .header-inner {
        width: min(calc(100% - 32px), 1420px);
    }

    .main-nav {
        gap: 18px;
    }

    /*
     * Banner compacto: mostra a proposta, os filtros e o inicio do estoque
     * no primeiro enquadramento de um notebook.
     */
    .hero {
        height: 67vh;
        min-height: 488px;
        max-height: 650px;
    }

    .hero-content {
        justify-content: flex-start;
        padding-top: 118px;
        padding-bottom: 145px;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-copy h1 {
        font-size: clamp(2.8rem, 4vw, 3.75rem);
        line-height: 1.06;
        margin-bottom: 14px;
    }

    .hero-copy > p:not(.eyebrow) {
        max-width: 650px;
        font-size: 1rem;
    }

    /*
     * No desktop, os filtros assumem o papel de chamada principal.
     * Os botoes continuam disponiveis no mobile.
     */
    .hero-actions {
        display: none;
    }

    /*
     * O card termina 22px antes do fim do banner. A margem inferior
     * compensa a sobreposicao e preserva o fluxo da secao seguinte.
     */
    .quick-search {
        position: relative;
        z-index: 4;
        margin-top: -124px;
        margin-bottom: -18px;
    }

    .quick-search + .section {
        padding-top: 50px;
    }
}

/*
 * O menu vira gaveta antes que os links fiquem apertados.
 */
@media (min-width: 861px) and (max-width: 1180px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 76px;
        right: -100%;
        width: min(88vw, 380px);
        height: calc(100vh - 76px);
        background: #111;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 28px;
        gap: 0;
        transition: right .25s ease;
    }

    .main-nav.open {
        right: 0;
    }

    .main-nav > a {
        padding: 15px 0;
        border-bottom: 1px solid #292929;
        font-size: .82rem;
    }

    .main-nav .btn {
        margin-top: 20px;
    }
}

/*
 * Em tablets horizontais, os filtros usam duas linhas. O banner recebe
 * altura suficiente para impedir conflito com o texto institucional.
 */
@media (min-width: 861px) and (max-width: 1100px) {
    .hero {
        height: 650px;
        min-height: 650px;
        max-height: 650px;
    }

    .quick-search {
        margin-top: -207px;
    }
}

/*
 * Composicao mobile: titulo e formulario sobem juntos, reduzindo o vazio
 * sem comprometer os botoes de acao ou a leitura sobre a fotografia.
 */
@media (max-width: 560px) {
    .site-header .brand img {
        max-width: 132px;
        max-height: 27px;
    }

    .footer-brand img {
        max-width: 160px;
        max-height: 34px;
    }

    .hero {
        height: 585px;
        min-height: 585px;
    }

    .hero-content {
        padding-top: 74px;
    }

    .hero-copy .eyebrow {
        display: none;
    }

    .hero-copy h1 {
        width: 100%;
        max-width: 300px;
        font-size: clamp(2rem, 9.8vw, 2.15rem);
        line-height: 1.12;
        margin-bottom: 16px;
    }

    .hero-copy > p:not(.eyebrow) {
        font-size: .95rem;
        line-height: 1.4;
    }

    .hero-actions {
        margin-top: 20px;
    }

    .hero-actions .btn {
        min-height: 44px;
    }

    .quick-search {
        position: relative;
        z-index: 4;
        margin-top: -145px;
    }

    .quick-search + .section {
        padding-top: 24px;
    }
}

/* Hero de vitrine: composicao ampla, busca central e navegacao por tipo. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    top: 12px;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
}

.site-header .header-inner {
    height: 70px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    background: rgba(16, 16, 16, .7);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
}

.header-cta {
    display: none;
}

.home-hero {
    height: 760px;
    min-height: 760px;
    max-height: none;
    background: #080808;
}

.home-hero .hero-bg {
    object-position: center center;
}

.home-hero .hero-overlay {
    background:
        linear-gradient(180deg, rgba(5, 5, 5, .42) 0%, rgba(5, 5, 5, .2) 26%, rgba(5, 5, 5, .74) 68%, #080808 100%),
        linear-gradient(90deg, rgba(5, 5, 5, .34), rgba(5, 5, 5, .04) 52%, rgba(5, 5, 5, .22));
}

.home-hero .hero-content {
    justify-content: flex-start;
    align-items: center;
    padding-top: 154px;
    padding-bottom: 36px;
}

.home-hero .hero-copy {
    width: 100%;
    max-width: 760px;
    text-align: center;
}

.home-hero .hero-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(2.3rem, 3.3vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.045em;
}

.home-hero .hero-copy > p:not(.eyebrow) {
    max-width: 620px;
    margin: 0 auto;
    color: rgba(255, 255, 255, .72);
    font-size: 1rem;
}

.hero-search-panel {
    width: min(100%, 760px);
    margin-top: 34px;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 225px auto;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(12, 12, 12, .84);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(18px);
}

.hero-search-field,
.hero-location {
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    color: rgba(255, 255, 255, .82);
}

.hero-search-field > i,
.hero-location > i {
    color: rgba(255, 255, 255, .58);
    flex: 0 0 auto;
}

.hero-search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: .9rem;
}

.hero-search-field input::placeholder {
    color: rgba(255, 255, 255, .54);
}

.hero-location {
    font-size: .86rem;
    white-space: nowrap;
}

.hero-search-button {
    min-height: 48px;
    padding: 0 25px;
    border-radius: 12px;
    background: #fff;
    color: #111;
}

.hero-search-button:hover {
    background: #ededed;
}

.hero-stock-link {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .8);
    font-size: .8rem;
    font-weight: 700;
}

.hero-stock-link:hover {
    color: #fff;
}

.hero-categories {
    width: 100%;
    margin-top: 34px;
}

.hero-category-heading {
    text-align: center;
}

.hero-category-heading .eyebrow {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, .58);
}

.hero-category-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 1.45rem;
    letter-spacing: -.035em;
}

.hero-category-track {
    width: max-content;
    max-width: 100%;
    margin: 20px auto 0;
    display: flex;
    gap: 10px;
}

.hero-category-card {
    position: relative;
    width: 132px;
    height: 124px;
    flex: 0 0 132px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px rgba(0, 0, 0, .22);
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.hero-category-card:hover,
.hero-category-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .38);
    background: linear-gradient(145deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .04));
    outline: none;
}

.hero-category-number {
    color: rgba(255, 255, 255, .4);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.hero-category-icon {
    margin: auto 0 8px;
    color: rgba(255, 255, 255, .84);
    font-size: 2.2rem;
    line-height: 1;
}

.hero-category-label {
    max-width: calc(100% - 16px);
    overflow: hidden;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-category-arrow {
    position: absolute;
    right: 11px;
    bottom: 10px;
    color: rgba(255, 255, 255, .4);
    font-size: .7rem;
}

.home-hero + .section {
    padding-top: 64px;
}

@media (max-width: 860px) {
    .site-header {
        top: 8px;
    }

    .site-header .header-inner {
        width: calc(100% - 16px);
        height: 66px;
        padding: 0 12px 0 16px;
        border-radius: 16px;
    }

    .site-header .brand img {
        max-width: 112px;
        max-height: 25px;
    }

    .header-cta {
        display: inline-flex;
        min-height: 38px;
        padding: 0 13px;
        font-size: .72rem;
    }

    .header-cta i {
        display: none;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
        padding: 0;
        font-size: 1.45rem;
    }

    .main-nav {
        top: 82px;
        height: calc(100vh - 82px);
    }

    .home-hero {
        height: 820px;
        min-height: 820px;
    }

    .home-hero .hero-bg {
        object-position: 61% center;
    }

    .home-hero .hero-content {
        width: 100%;
        padding: 132px 14px 28px;
    }

    .home-hero .hero-copy h1 {
        max-width: 360px;
        margin-right: auto;
        margin-left: auto;
        font-size: clamp(2rem, 8vw, 2.55rem);
        line-height: 1.08;
    }

    .home-hero .hero-copy > p:not(.eyebrow) {
        max-width: 360px;
        font-size: .9rem;
        line-height: 1.5;
    }

    .hero-search-panel {
        width: min(100%, 520px);
        margin-top: 28px;
        padding: 10px;
        grid-template-columns: 1fr;
        gap: 8px;
        border-radius: 16px;
    }

    .hero-search-field,
    .hero-location,
    .hero-search-button {
        height: 44px;
        min-height: 44px;
    }

    .hero-stock-link {
        margin-top: 11px;
        font-size: .76rem;
    }

    .hero-categories {
        margin-top: 28px;
    }

    .hero-category-heading h2 {
        font-size: 1.3rem;
    }

    .hero-category-track {
        width: 100%;
        margin-top: 16px;
        padding: 0 14px 8px;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .hero-category-track::-webkit-scrollbar {
        display: none;
    }

    .hero-category-card {
        scroll-snap-align: start;
    }

    .home-hero + .section {
        padding-top: 48px;
    }
}

@media (max-width: 430px) {
    .site-header .brand img {
        max-width: 92px;
    }

    .header-cta {
        padding: 0 10px;
        font-size: .67rem;
    }

    .home-hero {
        height: 812px;
        min-height: 812px;
    }

    .home-hero .hero-content {
        padding-top: 126px;
    }

    .home-hero .hero-copy h1 {
        max-width: 335px;
        font-size: 2rem;
    }

    .home-hero .hero-copy > p:not(.eyebrow) {
        max-width: 340px;
        font-size: .84rem;
    }

    .hero-search-panel {
        margin-top: 24px;
    }

    .hero-categories {
        margin-top: 24px;
    }

    .hero-category-card {
        width: 122px;
        height: 116px;
        flex-basis: 122px;
    }

    .hero-category-icon {
        font-size: 2rem;
    }
}
