/*
 * MAXSOFT Product Page - Mercado Livre inspired v52.0
 * Layout de duas colunas com galeria esquerda bloqueada (sticky) no desktop.
 * A fixacao termina junto com o bloco principal para nao sobrepor o conteudo.
 */
:root {
    --msml-bg: #ededed;
    --msml-surface: #ffffff;
    --msml-line: #e5e5e5;
    --msml-text: #333333;
    --msml-muted: #666666;
    --msml-blue: #3483fa;
    --msml-blue-dark: #2968c8;
    --msml-blue-soft: rgba(65, 137, 230, .15);
    --msml-green: #00a650;
    --msml-radius: 8px;
    --msml-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    --msml-sticky-top: 88px;
}

body { background: var(--msml-bg) !important; }
.ms-product-page { color: var(--msml-text) !important; }
.ms-product-layout,
.ms-product-topnav {
    width: min(calc(100% - 32px), 1184px) !important;
}

/* Bloco superior no padrao marketplace: galeria ampla e compra na direita. */
.ms-product-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    gap: 28px;
    align-items: start;
    padding: 24px;
    border-radius: var(--msml-radius);
    background: var(--msml-surface);
    box-shadow: var(--msml-shadow);
}
.ms-product-gallery-column {
    min-width: 0;
    align-self: stretch;
    position: relative;
}
.ms-product-gallery-lock {
    position: sticky;
    top: var(--msml-sticky-top);
    z-index: 3;
    height: fit-content;
}
.ms-product-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static !important;
}
.ms-product-content-stack {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* A galeria fica integrada ao cartao principal, como no Mercado Livre. */
.ms-product-gallery {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.ms-product-gallery .ms-gallery-root {
    padding: 0 !important;
    border-radius: 0 !important;
}
.ms-product-gallery .ms-gallery-container { gap: 18px !important; }
.ms-product-gallery .ms-main-stage {
    height: min(560px, calc(100vh - 132px)) !important;
    min-height: 460px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #fff !important;
}
.ms-product-gallery .main-product-image {
    max-width: 92% !important;
    max-height: 92% !important;
    filter: none !important;
}
.ms-product-gallery .ms-thumb-rail {
    width: 52px !important;
    gap: 10px !important;
}
.ms-product-gallery .ms-thumb-item {
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;
    border-width: 1px !important;
    box-shadow: none !important;
}
.ms-product-gallery .ms-thumb-item.active {
    border: 2px solid var(--msml-blue) !important;
}
.ms-product-gallery .ms-zoom-hint {
    right: 12px !important;
    bottom: 12px !important;
    color: var(--msml-muted) !important;
    border-radius: 6px !important;
    text-transform: none !important;
}

/* Caixa de compra permanece na direita; somente a lateral esquerda fica bloqueada. */
.ms-product-buybox {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}
.ms-product-buybox .ms-buybox-card,
.ms-product-payment-box,
.ms-product-trust-wrap,
.ms-product-urgency {
    border: 1px solid var(--msml-line) !important;
    border-radius: var(--msml-radius) !important;
    box-shadow: none !important;
}
.ms-product-buybox .ms-buybox-card { padding: 22px !important; }
.ms-product-buybox .ms-buybox-card > h1 {
    color: var(--msml-text) !important;
    font-size: 22px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}
.ms-product-buybox .ms-price-display-box {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}
.ms-product-buybox .sys-int {
    color: var(--msml-text) !important;
    font-size: 38px !important;
    font-weight: 400 !important;
}
.ms-product-buybox .btn-ms-buy-now,
.ms-product-buybox .btn-ms-add-cart {
    min-height: 48px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
.ms-product-buybox .btn-ms-buy-now {
    background: var(--msml-blue) !important;
    box-shadow: none !important;
}
.ms-product-buybox .btn-ms-buy-now:hover { background: var(--msml-blue-dark) !important; }
.ms-product-buybox .btn-ms-add-cart {
    color: var(--msml-blue) !important;
    background: var(--msml-blue-soft) !important;
    border-color: transparent !important;
}
.ms-product-buybox .sys-select,
.ms-product-buybox .sys-qty { border-radius: 6px !important; }

/* Conteudo abaixo do bloco principal. */
.ms-product-content-stack > .ms-product-surface,
.ms-product-content-stack .ms-product-surface {
    border-color: var(--msml-line) !important;
    border-radius: var(--msml-radius) !important;
    box-shadow: var(--msml-shadow) !important;
}
.ms-product-assurances-wrap { order: initial; }
.ms-product-section-title {
    color: var(--msml-text) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}
.ms-product-section-title::before { display: none !important; }
.ms-product-section-subtitle { margin-left: 0 !important; }
.ms-product-anchor-nav a {
    border-radius: 6px !important;
    color: var(--msml-blue-dark) !important;
}
.ms-product-anchor-nav a.is-active,
.ms-product-anchor-nav a[aria-current="location"] {
    color: var(--msml-blue-dark) !important;
    background: var(--msml-blue-soft) !important;
}
.ms-product-trust__item i { color: var(--msml-green) !important; }

/* Evita que ancora fique escondida atras do cabecalho fixo. */
#vendedor,
#descricao-produto,
#perguntas,
#avaliacoes { scroll-margin-top: 104px; }

@media (max-width: 1080px) and (min-width: 1024px) {
    .ms-product-hero-grid {
        grid-template-columns: minmax(0, 1fr) 350px;
        gap: 20px;
        padding: 20px;
    }
    .ms-product-gallery .ms-main-stage {
        min-height: 420px !important;
        height: min(500px, calc(100vh - 128px)) !important;
    }
}

@media (max-width: 1023px) {
    .ms-product-layout {
        width: 100% !important;
        display: flex;
        flex-direction: column;
    }
    .ms-product-hero-grid,
    .ms-product-gallery-column,
    .ms-product-gallery-lock,
    .ms-product-sidebar,
    .ms-product-content-stack {
        display: contents;
    }
    .ms-product-gallery-lock { position: static !important; }

    .ms-product-gallery { order: 1; }
    .ms-product-mobile-summary { order: 2; }
    .ms-product-buybox { order: 3; }
    .ms-product-urgency { order: 4; }
    .ms-product-assurances-wrap { order: 5; }
    .ms-product-seller-highlight { order: 6; }
    .ms-product-anchor-wrap { order: 7; }
    .ms-product-details { order: 8; }
    .ms-product-payments { order: 9; }
    .ms-product-trust-wrap { order: 10; }
    .ms-product-questions { order: 11; }
    .ms-product-reviews { order: 12; }

    .ms-product-gallery {
        border-radius: 0 !important;
        background: #fff !important;
    }
    .ms-product-gallery .ms-gallery-root { padding: 14px !important; }
    .ms-product-gallery .ms-main-stage {
        height: auto !important;
        min-height: 340px !important;
        aspect-ratio: 1 / 1 !important;
    }
    .ms-product-buybox,
    .ms-product-urgency,
    .ms-product-payments,
    .ms-product-trust-wrap,
    .ms-product-mobile-summary,
    .ms-product-assurances-wrap,
    .ms-product-seller-highlight,
    .ms-product-anchor-wrap,
    .ms-product-details,
    .ms-product-questions,
    .ms-product-reviews {
        margin-top: 8px !important;
    }
}

@media (max-width: 560px) {
    .ms-product-gallery .ms-main-stage { min-height: 290px !important; }
    .ms-product-buybox .ms-buybox-card { padding: 18px 15px !important; }
    .ms-product-buybox .ms-buybox-card > h1 { font-size: 20px !important; }
    .ms-product-buybox .sys-int { font-size: 34px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .ms-product-gallery-lock { scroll-behavior: auto; }
}

/* ========================================================================== */
/* MAXSOFT v53 — características abaixo da galeria e versões inteligentes      */
/* ========================================================================== */
.ms-product-gallery-lock {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ms-product-gallery-characteristics {
    border: 1px solid var(--msml-line);
    border-radius: var(--msml-radius);
    background: #fff;
    overflow: hidden;
}

.ms-gallery-characteristics-card {
    padding: 16px 18px;
}

.ms-gallery-characteristics-card__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.ms-gallery-characteristics-card__head small {
    display: block;
    margin-bottom: 2px;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ms-gallery-characteristics-card__head h2 {
    margin: 0;
    color: var(--msml-text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.ms-gallery-characteristics-card__head a {
    flex: 0 0 auto;
    color: var(--msml-blue-dark);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.ms-gallery-characteristics-card__head a:hover {
    text-decoration: underline;
}

.ms-gallery-characteristics-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #ededed;
    border-radius: 6px;
}

.ms-gallery-characteristics-list > div {
    min-width: 0;
    padding: 9px 11px;
    border-bottom: 1px solid #ededed;
}

.ms-gallery-characteristics-list > div:nth-child(odd) {
    border-right: 1px solid #ededed;
}

.ms-gallery-characteristics-list > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.ms-gallery-characteristics-list dt {
    margin: 0 0 2px;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 500;
}

.ms-gallery-characteristics-list dd {
    margin: 0;
    overflow: hidden;
    color: var(--msml-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-gallery-characteristics-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 11px;
}

.ms-gallery-characteristics-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5f5f5f;
    font-size: 11px;
    font-weight: 500;
}

.ms-gallery-characteristics-highlights i {
    color: var(--msml-green);
    font-size: 10px;
}

.ms-buybox-selectors--single {
    max-width: 150px;
}

.ms-buybox-selectors--single .ms-buybox-quantity-only {
    width: 150px;
}

#comprar-produto {
    scroll-margin-top: 104px;
}

@media (max-width: 1023px) {
    .ms-product-gallery-lock {
        display: contents;
    }

    .ms-product-gallery-characteristics {
        order: 2;
        margin-top: 8px;
        border-radius: 0;
    }

    .ms-product-mobile-summary { order: 3; }
    .ms-product-buybox { order: 4; }
    .ms-product-urgency { order: 5; }
    .ms-product-assurances-wrap { order: 6; }
    .ms-product-seller-highlight { order: 7; }
    .ms-product-anchor-wrap { order: 8; }
    .ms-product-details { order: 9; }
    .ms-product-payments { order: 10; }
    .ms-product-trust-wrap { order: 11; }
    .ms-product-questions { order: 12; }
    .ms-product-reviews { order: 13; }
}

@media (max-width: 560px) {
    .ms-gallery-characteristics-card {
        padding: 16px 14px;
    }

    .ms-gallery-characteristics-card__head {
        align-items: flex-start;
    }

    .ms-gallery-characteristics-card__head h2 {
        font-size: 17px;
    }

    .ms-gallery-characteristics-list {
        grid-template-columns: 1fr;
    }

    .ms-gallery-characteristics-list > div,
    .ms-gallery-characteristics-list > div:nth-child(odd),
    .ms-gallery-characteristics-list > div:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid #ededed;
    }

    .ms-gallery-characteristics-list > div:last-child {
        border-bottom: 0;
    }
}

/* ========================================================================== */
/* MAXSOFT v54 — mobile com cara de aplicativo + vendedor estilo marketplace  */
/* ========================================================================== */

.ms-product-seller-highlight {
    overflow: hidden;
}

.ms-seller-pro {
    display: grid;
    gap: 18px;
}

.ms-seller-pro__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr);
    gap: 16px;
    align-items: stretch;
}

.ms-seller-pro__identity,
.ms-seller-pro__cta,
.ms-seller-pro__timeline {
    border: 1px solid #e7ecf3;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.ms-seller-pro__identity {
    padding: 20px;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.ms-seller-pro__avatar {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid #edf2f7;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.ms-seller-pro__avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ms-seller-pro__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.ms-seller-pro__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ms-seller-pro__title-row h3 {
    margin: 0;
    color: #172033;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.ms-seller-pro__tier {
    min-height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    color: var(--seller-tier-color, #2968c8);
    background: color-mix(in srgb, var(--seller-tier-color, #2968c8) 12%, white);
    font-size: 11px;
    font-weight: 850;
}

.ms-seller-pro__meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ms-seller-pro__meta span {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: #f6f8fb;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
}

.ms-seller-pro__meta i {
    color: var(--seller-tier-color, #2968c8);
}

.ms-seller-pro__summary {
    margin: 12px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.65;
}

.ms-seller-pro__cta {
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.ms-seller-pro__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ms-seller-pro__stat {
    padding: 14px 12px;
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid #e7eef9;
}

.ms-seller-pro__stat strong {
    display: block;
    color: #172033;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.ms-seller-pro__stat span {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.ms-seller-pro__quality {
    display: grid;
    gap: 8px;
}

.ms-seller-pro__quality-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ms-seller-pro__quality-head small {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.ms-seller-pro__quality-head strong {
    color: var(--seller-tier-color, #2968c8);
    font-size: 18px;
    font-weight: 900;
}

.ms-seller-pro__quality-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.ms-seller-pro__quality-bar span {
    height: 8px;
    border-radius: 999px;
    background: #e8eef5;
}

.ms-seller-pro__action {
    min-height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #3483fa, #2968c8);
    box-shadow: 0 12px 24px rgba(52, 131, 250, .22);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.ms-seller-pro__action:hover {
    color: #fff;
    filter: brightness(.98);
}

.ms-seller-pro__timeline {
    padding: 18px;
}

.ms-seller-pro__timeline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 14px;
    margin-bottom: 14px;
}

.ms-seller-pro__timeline-head strong {
    color: #172033;
    font-size: 15px;
    font-weight: 900;
}

.ms-seller-pro__timeline-head small {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.ms-seller-pro__meters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ms-seller-meter {
    padding: 14px 12px;
    border-radius: 14px;
    background: #fcfdff;
    border: 1px solid #ebf0f6;
}

.ms-seller-meter__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ms-seller-meter__head span {
    color: #344054;
    font-size: 12px;
    font-weight: 850;
}

.ms-seller-meter__head strong {
    color: var(--meter-color, #00a650);
    font-size: 13px;
    font-weight: 900;
}

.ms-seller-meter__bar {
    height: 8px;
    margin-top: 10px;
    border-radius: 999px;
    background: #e8eef5;
    overflow: hidden;
}

.ms-seller-meter__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--meter-color, #00a650);
}

.ms-seller-meter p {
    margin: 9px 0 0;
    color: #667085;
    font-size: 11px;
    line-height: 1.55;
}

@media (max-width: 1023px) {
    .ms-product-topnav {
        display: none !important;
    }

    .ms-product-page {
        background: #f5f5f7 !important;
    }

    .ms-product-gallery,
    .ms-product-gallery-characteristics,
    .ms-product-mobile-summary,
    .ms-product-buybox,
    .ms-product-urgency,
    .ms-product-payments,
    .ms-product-trust-wrap,
    .ms-product-assurances-wrap,
    .ms-product-seller-highlight,
    .ms-product-anchor-wrap,
    .ms-product-details,
    .ms-product-questions,
    .ms-product-reviews {
        margin-inline: 10px !important;
        border-radius: 16px !important;
        overflow: hidden;
        border: 1px solid #e7ebf0 !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .06) !important;
    }

    .ms-product-gallery {
        margin-top: 10px !important;
    }

    .ms-product-gallery .ms-gallery-root {
        padding: 12px !important;
    }

    .ms-product-gallery .ms-main-stage {
        border-radius: 14px !important;
        background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%) !important;
    }

    .ms-product-mobile-summary {
        padding: 18px 16px !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    }

    .ms-product-mobile-summary h1 {
        margin-top: 8px;
        color: #172033;
        font-size: 21px;
        line-height: 1.3;
        font-weight: 900;
        letter-spacing: -.03em;
    }

    .ms-mobile-summary__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ms-mobile-summary__meta span,
    .ms-mobile-summary__benefits span {
        min-height: 30px;
        padding: 0 11px;
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        background: #f3f7ff;
        color: #2968c8;
        font-size: 10px;
        font-weight: 850;
    }

    .ms-mobile-summary__rating {
        margin-top: 12px;
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 7px;
        text-decoration: none;
    }

    .ms-mobile-summary__benefits {
        margin-top: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ms-product-buybox .ms-buybox-card {
        border-radius: 16px !important;
        padding: 18px 16px 16px !important;
    }

    .ms-product-buybox .btn-ms-buy-now,
    .ms-product-buybox .btn-ms-add-cart,
    .ms-product-buybox .sys-select,
    .ms-product-buybox .sys-qty {
        border-radius: 12px !important;
    }

    .ms-product-anchor-nav {
        padding: 12px !important;
        gap: 10px !important;
        scroll-snap-type: x mandatory;
    }

    .ms-product-anchor-nav a {
        min-height: 40px !important;
        padding-inline: 14px !important;
        border-radius: 999px !important;
        background: #f8fafc !important;
        scroll-snap-align: start;
    }

    .ms-seller-pro__hero {
        grid-template-columns: 1fr;
    }

    .ms-seller-pro__identity {
        grid-template-columns: 62px minmax(0, 1fr);
        padding: 16px;
    }

    .ms-seller-pro__avatar {
        width: 62px;
        height: 62px;
        border-radius: 18px;
    }

    .ms-seller-pro__title-row h3 {
        font-size: 20px;
    }

    .ms-seller-pro__meta span {
        width: 100%;
        justify-content: flex-start;
    }

    .ms-seller-pro__cta,
    .ms-seller-pro__timeline {
        padding: 16px;
    }

    .ms-seller-pro__stats,
    .ms-seller-pro__meters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .ms-product-gallery,
    .ms-product-gallery-characteristics,
    .ms-product-mobile-summary,
    .ms-product-buybox,
    .ms-product-urgency,
    .ms-product-payments,
    .ms-product-trust-wrap,
    .ms-product-assurances-wrap,
    .ms-product-seller-highlight,
    .ms-product-anchor-wrap,
    .ms-product-details,
    .ms-product-questions,
    .ms-product-reviews {
        margin-inline: 8px !important;
        border-radius: 14px !important;
    }

    .ms-product-mobile-summary h1 {
        font-size: 19px;
    }

    .ms-seller-pro__stats,
    .ms-seller-pro__meters {
        grid-template-columns: 1fr;
    }

    .ms-seller-pro__title-row h3 {
        font-size: 18px;
    }

    .ms-seller-pro__tier {
        width: 100%;
        justify-content: center;
    }
}
