/*
 * MEGASHOP — COMPONENTES DA VITRINE
 * Arquivo organizado por seções para facilitar a manutenção manual.
 */

/* =========================================================
   1. CABEÇALHO E NAVEGAÇÃO
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
}

.header__main {
    display: grid;
    grid-template-columns: 185px minmax(320px, 1fr) auto;
    align-items: center;
    gap: 26px;
    min-height: 86px;
}

.header__main .brand {
    width: 185px;
}

.header__main .search {
    width: 100%;
    max-width: 680px;
    justify-self: center;
}

.header__actions {
    justify-self: end;
}

.header__contact {
    padding: 7px 8px;
    border-radius: 10px;
    transition: background-color .2s ease;
}

.header__contact:hover {
    background: #f2fbf5;
}

.header__fav span {
    display: grid;
    place-items: center;
}

.header__fav .icon {
    width: 27px;
    height: 27px;
}

.menu-button .icon {
    width: 28px;
    height: 28px;
}

.category-nav__inner {
    justify-content: center;
}

.nav-item {
    align-items: stretch;
}

.nav-item__toggle {
    display: grid;
    place-items: center;
    width: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6d7b87;
    cursor: pointer;
}

.nav-item__toggle .icon {
    width: 13px;
    height: 13px;
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu,
.nav-item.is-expanded .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* =========================================================
   2. CARROSSEL DE LOGOTIPOS
   ========================================================= */

.brand-logo-section {
    position: relative;
    z-index: 8;
    margin-top: 14px;
    margin-bottom: 8px;
}

.brand-logo-panel {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 88px;
    padding: 8px 42px;
    overflow: hidden;
    border: 1px solid #e8edf1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 40, 61, .1);
}

.brand-logo-viewport {
    width: 100%;
    overflow: hidden;
    scrollbar-width: none;
}

.brand-logo-viewport::-webkit-scrollbar {
    display: none;
}

.brand-logo-track {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
}

.brand-logo {
    display: grid;
    flex: 0 0 190px;
    place-items: center;
    height: 68px;
    padding: 10px 26px;
    border-right: 1px solid #edf0f3;
    background: #fff;
}

.brand-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 42px;
    margin: auto;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .72;
    transform-origin: center;
    transition: transform .25s ease, filter .25s ease, opacity .25s ease;
}

.brand-logo:hover img {
    filter: grayscale(1) contrast(1.1);
    opacity: .96;
    transform: scale(1.045);
}

/* Medidas visuais por marca: mantém símbolos e wordmarks equilibrados. */
.brand-logo--apple img {
    width: 34px;
    max-height: 42px;
}

.brand-logo--samsung img {
    width: 110px;
    max-height: 27px;
}

.brand-logo--jbl img {
    width: 44px;
    max-height: 42px;
}

.brand-logo--realme img {
    width: 100px;
    max-height: 30px;
}

.brand-logo--sony img {
    width: 106px;
    max-height: 26px;
}

.brand-logo-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0 0 2px;
    transform: translateY(-50%);
    border: 1px solid #e3e9ed;
    border-radius: 50%;
    background: #fff;
    color: var(--navy);
    box-shadow: 0 4px 14px rgba(16, 40, 61, .12);
    font-size: 20px;
    cursor: pointer;
}

.brand-logo-arrow--prev {
    left: 9px;
}

.brand-logo-arrow--next {
    right: 9px;
}

/* =========================================================
   3. CARROSSÉIS E CARDS DE PRODUTO
   ========================================================= */

.product-carousel {
    gap: 14px;
    scroll-snap-type: x proximity;
}

.product-carousel .product-card {
    flex: 0 0 calc((100% - 70px) / 6);
    scroll-snap-align: start;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card__media {
    height: 158px;
}

.product-card__heart {
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #edf1f3;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 3px 10px rgba(16, 40, 61, .08);
}

.product-card__heart.is-saved,
.product-page__favorite.is-saved {
    color: #e94158;
}

.product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.product-card h3 {
    display: -webkit-box;
    height: auto;
    min-height: 51px;
    margin-bottom: 9px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.product-card__prices {
    margin-top: auto;
}

.product-card__actions {
    display: grid;
    gap: 8px;
    margin-top: 11px;
    padding-top: 10px;
}

.product-card__whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: #25d366;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.product-card__whatsapp:hover {
    transform: translateY(-1px);
    background: #159f4d;
}

.product-card__whatsapp span {
    font-size: 15px;
    line-height: 1;
}

.product-card__secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.product-card__secondary > a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--navy);
    font-size: 10px;
    font-weight: 800;
}

.product-card__secondary .icon {
    width: 13px;
    height: 13px;
}

/* =========================================================
   4. PÁGINA DO PRODUTO
   ========================================================= */

.product-page__media {
    position: relative;
}

.product-page__favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #e7ecef;
    border-radius: 50%;
    background: #fff;
    color: #96a3ad;
    box-shadow: 0 6px 18px rgba(16, 40, 61, .1);
    font-size: 26px;
    cursor: pointer;
}

.product-page__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 13px;
}

.product-page__prices {
    margin-top: 24px;
}

.product-page__price {
    display: block;
    margin: 0;
}

.product-page__whatsapp {
    min-width: 230px;
    margin-top: 8px;
}

/* =========================================================
   5. FAVORITOS
   ========================================================= */

.favorites-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
    padding: 28px;
    border: 1px solid #e5ebef;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff 0%, #f6fafc 100%);
}

.favorites-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -.04em;
}

.favorites-hero p:not(.eyebrow) {
    max-width: 600px;
    margin: 7px 0 0;
    color: var(--muted);
}

.favorites-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.favorites-count {
    display: grid;
    min-width: 78px;
    text-align: center;
}

.favorites-count b {
    color: var(--navy);
    font-size: 25px;
    line-height: 1;
}

.favorites-count small {
    color: var(--muted);
    font-size: 10px;
}

.button--outline {
    border: 1px solid #d9e2e8;
    background: #fff;
    color: var(--navy);
}

.favorites-loading {
    padding: 60px 20px;
    color: var(--muted);
    text-align: center;
}

.favorites-grid {
    align-items: stretch;
}

.favorites-empty {
    min-height: 360px;
    border: 1px dashed #d7e1e7;
    border-radius: 20px;
    background: #fff;
}

.favorites-empty__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #fff4f5;
    color: #e94158;
    font-size: 42px;
}

/* =========================================================
   6. WHATSAPP FLUTUANTE E MODAL
   ========================================================= */

.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-float__label {
    display: grid;
    padding: 9px 14px;
    border: 1px solid #e5ece8;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(16, 40, 61, .16);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity .2s ease, transform .2s ease;
}

.whatsapp-float:hover .whatsapp-float__label,
.whatsapp-float:focus-within .whatsapp-float__label {
    opacity: 1;
    transform: none;
}

.whatsapp-float__label small {
    color: var(--muted);
    font-size: 10px;
}

.whatsapp-float__label b {
    color: var(--navy);
    font-size: 13px;
}

.whatsapp-float__button {
    position: relative;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    padding: 4px;
    overflow: visible;
    border: 3px solid #25d366;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 26px rgba(37, 211, 102, .35);
    cursor: pointer;
    transition: transform .2s ease;
}

.whatsapp-float__button:hover {
    transform: translateY(-3px) scale(1.03);
}

.whatsapp-float__button img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.whatsapp-float__button svg {
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 27px;
    height: 27px;
    padding: 5px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #25d366;
    fill: #fff;
}

.whatsapp-float__status {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #25d366;
}

.wa-modal__panel {
    width: min(440px, 100%);
}

.wa-vendor {
    min-height: 70px;
}

.wa-vendor img {
    width: 52px;
    height: 52px;
}

/* =========================================================
   7. RESPONSIVIDADE
   ========================================================= */

@media (max-width: 1120px) {
    .header__main {
        grid-template-columns: 155px minmax(260px, 1fr) auto;
        gap: 16px;
    }

    .header__main .brand {
        width: 155px;
    }

    .header__contact > span:last-child {
        display: none;
    }

    .product-carousel .product-card {
        flex-basis: calc((100% - 56px) / 5);
    }

    .brand-logo {
        flex-basis: 170px;
    }
}

@media (max-width: 900px) {
    .header__main {
        grid-template-columns: 42px 1fr auto;
        gap: 12px;
        padding-block: 10px;
    }

    .menu-button {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid #e7ecef;
        border-radius: 10px;
        background: #fff;
    }

    .header__main .brand {
        width: 160px;
        justify-self: center;
    }

    .header__main .search {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
    }

    .header__contact {
        display: none;
    }

    .category-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        border-top: 1px solid var(--line);
        background: #fff;
        box-shadow: 0 16px 30px rgba(16, 40, 61, .14);
    }

    .category-nav.is-open {
        display: block;
    }

    .category-nav__inner {
        display: grid;
        padding-block: 10px 16px;
    }

    .category-nav a {
        min-height: 44px;
        padding-inline: 10px;
        border: 0;
    }

    .nav-item {
        display: grid;
        grid-template-columns: 1fr 42px;
    }

    .nav-item__toggle {
        width: 42px;
    }

    .nav-item.is-expanded .nav-item__toggle .icon {
        transform: rotate(180deg);
    }

    .submenu {
        position: static;
        display: none;
        grid-column: 1 / -1;
        width: auto;
        margin: 0 10px 8px;
        padding: 5px 0 5px 10px;
        transform: none;
        border: 0;
        border-left: 2px solid var(--orange);
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
    }

    .nav-item.is-expanded .submenu {
        display: block;
    }

    .nav-bio {
        margin-left: 0;
    }

    .product-carousel .product-card {
        flex-basis: calc((100% - 42px) / 4);
    }

    .favorites-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .favorites-hero__actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .topbar__inner {
        min-height: 34px;
    }

    .topbar__tagline,
    .topbar__desktop {
        display: none;
    }

    .topbar__quote {
        width: 100%;
        justify-content: center;
        font-size: 10px;
    }

    .header__main {
        gap: 8px;
    }

    .header__main .brand {
        width: 142px;
    }

    .header__fav small {
        display: none;
    }

    .search button {
        padding-inline: 16px;
    }

    .brand-logo-section {
        width: calc(100% - 22px);
        margin-top: 14px;
    }

    .brand-logo-panel {
        min-height: 72px;
        padding: 6px 32px;
        border-radius: 12px;
    }

    .brand-logo {
        flex-basis: 125px;
        height: 58px;
        padding: 8px 16px;
    }

    .brand-logo img {
        max-height: 34px;
    }

    .brand-logo--apple img {
        width: 28px;
    }

    .brand-logo--samsung img {
        width: 82px;
    }

    .brand-logo--jbl img {
        width: 36px;
    }

    .brand-logo--realme img {
        width: 76px;
    }

    .brand-logo--sony img {
        width: 82px;
    }

    .brand-logo-arrow {
        width: 25px;
        height: 25px;
        font-size: 17px;
    }

    .brand-logo-arrow--prev {
        left: 6px;
    }

    .brand-logo-arrow--next {
        right: 6px;
    }

    .product-carousel .product-card {
        flex-basis: calc((100% - 11px) / 2);
    }

    .product-card__media {
        height: 148px;
    }

    .product-card h3 {
        min-height: 49px;
    }

    .product-card__whatsapp {
        min-height: 36px;
    }

    .favorites-hero {
        padding: 20px 17px;
    }

    .favorites-hero__actions .button {
        flex: 1 1 150px;
        padding-inline: 12px;
    }

    .favorites-count {
        min-width: 55px;
    }

    .product-page__whatsapp {
        width: 100%;
    }

    .whatsapp-float {
        right: 14px;
        bottom: 14px;
    }

    .whatsapp-float__label {
        display: none;
    }

    .whatsapp-float__button {
        width: 60px;
        height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-logo img,
    .product-card,
    .product-card__whatsapp,
    .whatsapp-float__button {
        transition: none;
    }
}

/* =========================================================
   8. BUSCA INTERATIVA E TEMA MEGASHOP
   ========================================================= */

.topbar,
.footer {
    background: #111;
}

.footer-benefits {
    background: #242424;
}

.footer-benefits__grid .icon,
.footer-main #atendimento p .icon {
    color: #d71920;
}

.footer-social a {
    background: #303030;
}

.quick-categories a:hover {
    background: #fff4f4;
}

.quick-categories a span,
.product-card__actions > a {
    background: #f1f1f1;
}

.header__contact:hover {
    background: #f3f3f3;
}

.header__main .search {
    position: relative;
    overflow: visible;
    border-color: #d5d5d5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
}

.header__main .search:focus-within {
    border-color: #d71920;
    box-shadow: 0 0 0 3px rgba(215, 25, 32, .1);
}

.search-suggestions[hidden] {
    display: none;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 120;
    max-height: min(460px, 70vh);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #dedede;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.search-suggestion {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 9px 12px;
    border-bottom: 1px solid #ededed;
    transition: background-color .15s ease;
}

.search-suggestion:hover,
.search-suggestion.is-active {
    background: #f5f5f5;
}

.search-suggestion img {
    width: 58px;
    height: 58px;
    padding: 3px;
    border: 1px solid #ededed;
    border-radius: 9px;
    background: #fff;
    object-fit: contain;
}

.search-suggestion__content {
    display: grid;
    min-width: 0;
}

.search-suggestion__content small {
    color: #d71920;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.search-suggestion__content b {
    overflow: hidden;
    color: #171717;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion__content em {
    color: #888;
    font-size: 9px;
    font-style: normal;
}

.search-suggestion__price {
    display: grid;
    justify-items: end;
    white-space: nowrap;
}

.search-suggestion__price strong {
    color: #111;
    font-size: 13px;
    font-weight: 900;
}

.search-suggestion__price small {
    color: #148548;
    font-size: 10px;
    font-weight: 800;
}

.search .search-suggestions__all {
    width: 100%;
    min-height: 43px;
    padding: 8px 14px;
    border: 0;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.search-suggestions__loading,
.search-suggestions__empty {
    padding: 18px;
    color: #696969;
    font-size: 12px;
    text-align: center;
}

.submenu {
    width: 270px;
    max-height: min(620px, 72vh);
    overflow-y: auto;
}

.submenu__title {
    display: block;
    padding: 12px 15px 5px;
    color: #777;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.product-card__usd {
    color: #111;
    font-size: 16px;
    font-weight: 900;
}

.product-card__brl,
.product-page__brl {
    color: #148548;
    font-weight: 800;
}

.product-card__pyg,
.product-page__pyg {
    color: #c51e28;
    font-weight: 800;
}

.product-page__price {
    color: #111;
    font-size: 35px;
    font-weight: 900;
}

.button--quote {
    background: #25a95a;
    color: #fff;
}

.button--quote:hover {
    background: #168847;
}

.whatsapp-float {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
}

.whatsapp-float__button {
    width: 64px;
    height: 64px;
    overflow: hidden;
}

.whatsapp-float__button img {
    object-position: center 24%;
}

.whatsapp-float__button svg {
    right: 0;
    bottom: 0;
    width: 24px;
    height: 24px;
    padding: 4px;
}

@media (max-width: 640px) {
    .search-suggestions {
        top: calc(100% + 6px);
        max-height: min(390px, 58vh);
    }

    .search-suggestion {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 66px;
        padding: 8px;
    }

    .search-suggestion img {
        width: 48px;
        height: 48px;
    }

    .search-suggestion__price {
        display: none;
    }

    .submenu {
        width: auto;
        max-height: none;
        overflow: visible;
    }

    .product-card__usd {
        font-size: 15px;
    }

    .whatsapp-float {
        right: max(11px, env(safe-area-inset-right));
        bottom: max(11px, env(safe-area-inset-bottom));
    }

    .whatsapp-float__button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-float__button svg {
        width: 22px;
        height: 22px;
    }
}
