/**
 * MAXSOFT Marketplace Home v36.0
 * Camada visual final: hierarquia comercial, densidade e responsividade.
 */

:root {
    --ms-v36-shell: 1320px;
    --ms-v36-ink: #152033;
    --ms-v36-muted: #667085;
    --ms-v36-line: #e5eaf0;
    --ms-v36-blue: #2563eb;
    --ms-v36-blue-dark: #1d4ed8;
    --ms-v36-soft-blue: #eff6ff;
    --ms-v36-bg: #f4f6f8;
    --ms-v36-card: #ffffff;
    --ms-v36-shadow: 0 8px 26px rgba(15, 23, 42, .055);
}

body.ms-original-marketplace {
    background: var(--ms-v36-bg);
}

.ms-home {
    padding-bottom: 54px;
    background:
        linear-gradient(180deg, #f8fbff 0, #f4f6f8 420px, #f4f6f8 100%);
}

.ms-home__ambient {
    height: 460px;
    opacity: .82;
}

.ms-home-features {
    margin-bottom: 18px;
}

.ms-home-sections {
    width: min(var(--ms-v36-shell), calc(100% - 28px));
    margin-top: 17px;
    gap: 16px;
}

.ms-home-section {
    min-width: 0;
}

/* Intro comercial */
.ms-marketplace-intro {
    width: min(var(--ms-v36-shell), calc(100% - 28px));
    margin: 0 auto;
    padding: 22px;
    position: relative;
    z-index: 4;
    overflow: hidden;
    border: 1px solid var(--ms-v36-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--ms-v36-shadow);
}

.ms-marketplace-intro::after {
    content: "";
    width: 290px;
    height: 290px;
    position: absolute;
    top: -190px;
    right: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .09), transparent 70%);
    pointer-events: none;
}

.ms-marketplace-intro__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.ms-marketplace-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--ms-v36-blue);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ms-marketplace-intro h1 {
    margin: 0;
    color: var(--ms-v36-ink);
    font-size: clamp(21px, 2.3vw, 31px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -.035em;
}

.ms-marketplace-intro__top p {
    margin: 8px 0 0;
    color: var(--ms-v36-muted);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 560;
}

.ms-marketplace-intro__catalog {
    min-height: 42px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid #cfe0f8;
    border-radius: 12px;
    color: var(--ms-v36-blue-dark);
    background: #f7faff;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
}

.ms-marketplace-intro__catalog:hover {
    color: #fff;
    border-color: var(--ms-v36-blue);
    background: var(--ms-v36-blue);
    transform: translateY(-1px);
}

.ms-marketplace-stats {
    margin-top: 20px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid #edf0f4;
    border-radius: 17px;
    background: #f8fafc;
}

.ms-marketplace-stat {
    min-width: 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid #e8edf3;
}

.ms-marketplace-stat:last-child {
    border-right: 0;
}

.ms-marketplace-stat__icon {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    display: grid;
    place-items: center;
    border: 1px solid #d8e7fb;
    border-radius: 12px;
    color: var(--ms-v36-blue);
    background: #eef5ff;
    font-size: 13px;
}

.ms-marketplace-stat strong {
    display: block;
    color: #182337;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 900;
}

.ms-marketplace-stat small {
    display: block;
    margin-top: 3px;
    color: #7b8799;
    font-size: 8px;
    font-weight: 700;
}

.ms-marketplace-categories-head {
    margin-top: 21px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.ms-marketplace-categories-head strong {
    display: block;
    color: #172033;
    font-size: 14px;
    font-weight: 900;
}

.ms-marketplace-categories-head small {
    display: block;
    margin-top: 3px;
    color: #8792a3;
    font-size: 8px;
    font-weight: 650;
}

.ms-marketplace-categories-head a {
    color: var(--ms-v36-blue);
    font-size: 9px;
    font-weight: 900;
    text-decoration: none;
}

.ms-marketplace-category-rail {
    margin-top: 11px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.ms-marketplace-category-card {
    min-width: 0;
    min-height: 67px;
    padding: 9px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 8px;
    border: 1px solid #e7ebf0;
    border-radius: 14px;
    color: #273348;
    background: #fff;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ms-marketplace-category-card:hover {
    transform: translateY(-2px);
    border-color: #bfd2ed;
    box-shadow: 0 9px 20px rgba(15, 23, 42, .07);
}

.ms-marketplace-category-card__visual {
    width: 38px;
    height: 38px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid #dce9fa;
    border-radius: 12px;
    color: var(--ms-v36-blue);
    background: #f0f6ff;
    font-size: 14px;
}

.ms-marketplace-category-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-marketplace-category-card__copy {
    min-width: 0;
}

.ms-marketplace-category-card__copy strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.28;
    font-weight: 850;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ms-marketplace-category-card__copy small {
    display: block;
    margin-top: 3px;
    color: #98a2b3;
    font-size: 7.5px;
    font-weight: 650;
}

.ms-marketplace-category-card__arrow {
    color: #c2cad5;
    font-size: 8px;
}

/* Seções e cabeçalhos */
.ms-home .elite-card-container,
.ms-home .ms-market-section {
    border-color: #e3e8ef !important;
    border-radius: 20px !important;
    box-shadow: 0 7px 24px rgba(15, 23, 42, .05) !important;
}

.ms-home .elite-card-container:hover {
    transform: none;
    border-color: #d8e0ea !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .075) !important;
}

.ms-home .ms-market-section::before {
    height: 2px;
}

.ms-home .ms-market-section > .ms-market-head,
.ms-home .elite-card-container > div:first-child {
    min-height: 72px;
    padding: 15px 20px !important;
}

.ms-home .elite-card-container > div:first-child::before {
    display: none;
}

.ms-home .ms-market-head__icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
    font-size: 14px;
}

.ms-home .ms-market-head__eyebrow {
    font-size: 7.5px;
    letter-spacing: .12em;
}

.ms-home .ms-market-head__copy h2 {
    margin-top: 3px !important;
    font-size: clamp(16px, 1.8vw, 21px) !important;
}

.ms-home .ms-market-head__copy p {
    margin-top: 4px;
    font-size: 9px;
}

.ms-market-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-home .ms-market-head__link {
    min-height: 37px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 8px;
}

.ms-home .ms-market-body,
.ms-home .elite-card-container > div:nth-child(2) {
    padding: 14px 16px 17px !important;
}

.ms-home .ms-home-discount-chip {
    min-height: 28px;
    font-size: 8px;
}

/* Cartões de produto */
.ms-home .ms-product-card {
    border-color: #e6e9ee !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .035) !important;
}

.ms-home .ms-product-card:hover {
    transform: translateY(-3px) !important;
    border-color: #bfd0e8 !important;
    box-shadow: 0 13px 28px rgba(15, 23, 42, .095) !important;
}

.ms-home .ms-product-card__media {
    background: #fff !important;
}

.ms-home .ms-product-card__image-wrap {
    padding: clamp(12px, 1.8vw, 20px) !important;
}

.ms-home .ms-product-card__content {
    min-height: 171px !important;
    padding: 12px !important;
}

.ms-home .ms-product-card__title {
    margin-bottom: 8px !important;
    color: #354052 !important;
    font-size: 11px !important;
    line-height: 1.42 !important;
}

.ms-home .ms-product-card__price-main {
    font-size: 22px !important;
}

.ms-home .ms-product-card__footer {
    margin-top: 10px !important;
    padding-top: 8px !important;
}

/* Diretório de categorias */
.ms-home .ms-home-category-directory {
    padding: 15px 16px 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ms-home .ms-home-category-directory__item {
    min-height: 64px;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 12px;
    align-items: center;
    justify-content: initial;
    gap: 10px;
    border-radius: 13px;
    text-align: left;
}

.ms-home .ms-home-category-directory__icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.ms-home .ms-home-category-directory__item > span:nth-child(2) {
    min-width: 0;
}

.ms-home .ms-home-category-directory__item strong {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-home .ms-home-category-directory__item small {
    display: block;
    margin-top: 3px;
    font-size: 7.5px;
}

.ms-home-category-directory__arrow {
    color: #c0c9d5;
    font-size: 8px;
}

/* Faixa para vendedores e suporte */
.ms-home-commerce-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 10px;
}

.ms-home-commerce-band__main {
    min-height: 126px;
    padding: 20px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid #1e4ea4;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 10%, rgba(255, 255, 255, .14), transparent 25%),
        linear-gradient(135deg, #183f82 0%, #2563eb 100%);
    box-shadow: 0 13px 30px rgba(37, 99, 235, .17);
}

.ms-home-commerce-band__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    background: rgba(255,255,255,.12);
    font-size: 19px;
}

.ms-home-commerce-band__main span:not(.ms-home-commerce-band__icon) {
    display: block;
    color: #bfdbfe;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ms-home-commerce-band__main strong {
    display: block;
    margin-top: 4px;
    font-size: 17px;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -.02em;
}

.ms-home-commerce-band__main p {
    margin: 6px 0 0;
    color: #dbeafe;
    font-size: 9px;
    line-height: 1.45;
    font-weight: 560;
}

.ms-home-commerce-band__main a {
    min-height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    color: #1747a6;
    background: #fff;
    font-size: 9px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.ms-home-commerce-band__support {
    min-height: 126px;
    padding: 18px;
    display: grid;
    grid-template-columns: 44px minmax(0,1fr) 12px;
    align-items: center;
    gap: 11px;
    border: 1px solid #dbe6de;
    border-radius: 20px;
    color: #173426;
    background: linear-gradient(145deg, #fff 0%, #f2fbf5 100%);
    box-shadow: var(--ms-v36-shadow);
    text-decoration: none;
}

.ms-home-commerce-band__support > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: #16a34a;
    font-size: 19px;
}

.ms-home-commerce-band__support small {
    display: block;
    color: #669077;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.ms-home-commerce-band__support strong {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 900;
}

.ms-home-commerce-band__support > i {
    color: #8ba597;
    font-size: 9px;
}

/* Busca */
.ms-search {
    width: min(var(--ms-v36-shell), calc(100% - 28px));
}

.ms-search__header {
    border-radius: 20px;
    box-shadow: var(--ms-v36-shadow);
}

.ms-search-grid {
    gap: 12px;
}

/* Marcas */
.ms-home .ms-market-brand {
    border-radius: 14px;
}

/* Responsividade */
@media (max-width: 1180px) {
    .ms-marketplace-category-rail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ms-marketplace-stats {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .ms-marketplace-stat:nth-child(2) {
        border-right: 0;
    }

    .ms-marketplace-stat:nth-child(-n+2) {
        border-bottom: 1px solid #e8edf3;
    }

    .ms-home-commerce-band {
        grid-template-columns: 1fr;
    }

    .ms-home-commerce-band__support {
        min-height: 84px;
    }

    .ms-home .ms-home-category-directory {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ms-home {
        padding-bottom: 30px;
    }

    .ms-home-sections,
    .ms-search,
    .ms-marketplace-intro {
        width: calc(100% - 20px);
    }

    .ms-marketplace-intro {
        padding: 16px 12px;
        border-radius: 18px;
    }

    .ms-marketplace-intro__top {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .ms-marketplace-intro__catalog {
        width: 100%;
    }

    .ms-marketplace-intro h1 {
        font-size: 22px;
    }

    .ms-marketplace-stats {
        margin-top: 15px;
        padding: 8px;
        gap: 0;
    }

    .ms-marketplace-stat {
        padding: 9px 7px;
    }

    .ms-marketplace-stat__icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .ms-marketplace-stat strong {
        font-size: 11px;
    }

    .ms-marketplace-stat small {
        font-size: 7px;
    }

    .ms-marketplace-category-rail {
        display: grid;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 72%;
        overflow-x: auto;
        padding-bottom: 5px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .ms-marketplace-category-rail::-webkit-scrollbar {
        display: none;
    }

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

    .ms-home-sections {
        margin-top: 12px;
        gap: 12px;
    }

    .ms-home .ms-market-section > .ms-market-head,
    .ms-home .elite-card-container > div:first-child {
        min-height: 64px;
        padding: 12px 13px !important;
    }

    .ms-home .ms-market-head__icon {
        width: 37px;
        height: 37px;
        flex-basis: 37px;
    }

    .ms-home .ms-market-head__copy h2 {
        font-size: 15px !important;
    }

    .ms-home .ms-market-head__copy p {
        max-width: 55vw;
        font-size: 8px;
    }

    .ms-home .ms-market-head__link span {
        display: none;
    }

    .ms-home .ms-market-head__link {
        width: 37px;
        padding: 0;
    }

    .ms-market-head__actions .ms-home-discount-chip {
        display: none;
    }

    .ms-home .ms-market-body,
    .ms-home .elite-card-container > div:nth-child(2) {
        padding: 10px 9px 13px !important;
    }

    .ms-home .ms-product-card__content {
        min-height: 158px !important;
        padding: 10px !important;
    }

    .ms-home .ms-product-card__title {
        font-size: 10px !important;
    }

    .ms-home .ms-product-card__price-main {
        font-size: 20px !important;
    }

    .ms-home-commerce-band__main {
        min-height: 0;
        padding: 17px;
        grid-template-columns: 44px minmax(0,1fr);
        border-radius: 18px;
    }

    .ms-home-commerce-band__icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .ms-home-commerce-band__main strong {
        font-size: 14px;
    }

    .ms-home-commerce-band__main p {
        font-size: 8px;
    }

    .ms-home-commerce-band__main a {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .ms-home-commerce-band__support {
        min-height: 78px;
        border-radius: 17px;
    }

    .ms-home .ms-home-category-directory {
        padding: 10px;
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .ms-home .ms-home-category-directory__item {
        min-height: 58px;
    }
}

@media (max-width: 430px) {
    .ms-marketplace-stats {
        grid-template-columns: 1fr 1fr;
    }

    .ms-marketplace-stat {
        gap: 7px;
    }

    .ms-marketplace-category-rail {
        grid-auto-columns: 84%;
    }

    .ms-home .ms-market-head__copy p {
        display: none;
    }
}
