/* =========================================================
   MOTOGRAPHIX V9
   VIEWER — LIQUID GLASS / iOS STYLE
   Archivo consolidado: sin bloques de corrección duplicados.
   ========================================================= */

:root {
    --mgx-viewer-red: #e30613;
    --mgx-viewer-red-bright: #ff2432;
    --mgx-viewer-bg: #030304;
    --mgx-viewer-glass: rgba(18, 18, 22, .66);
    --mgx-viewer-glass-strong: rgba(12, 12, 15, .88);
    --mgx-viewer-border: rgba(255,255,255,.12);
    --mgx-viewer-border-soft: rgba(255,255,255,.075);
    --mgx-viewer-text-soft: rgba(255,255,255,.58);
    --mgx-viewer-shadow: 0 28px 90px rgba(0,0,0,.62);
}


/* =========================================================
   BLOQUEO DE SCROLL
   ========================================================= */

body.mgx-viewer-open {
    overflow: hidden;
}


/* =========================================================
   VIEWER PRINCIPAL
   ========================================================= */

.mgx-viewer {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;
    box-sizing: border-box;

    color: #fff;
}

.mgx-viewer.is-open {
    display: flex;
}

.mgx-viewer,
.mgx-viewer button {
    font-family: inherit;
}


/* =========================================================
   FONDO
   ========================================================= */

.mgx-viewer-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;

    /* Fondo oscuro tipo Redix:
       se sigue distinguiendo el catálogo detrás */
    background: rgba(0, 0, 0, .62);

    -webkit-backdrop-filter:
        blur(3px)
        saturate(115%)
        brightness(.80);

    backdrop-filter:
        blur(3px)
        saturate(115%)
        brightness(.80);
}


/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */

.mgx-viewer-shell {
    position: relative;
    z-index: 2;

    width: min(1500px, calc(100vw - 48px));
    height: min(900px, calc(100vh - 48px));

    display: flex;
    flex-direction: column;

    overflow: hidden;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 34px;

    background:
        linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.015) 36%),
        rgba(7,7,10,.88);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        var(--mgx-viewer-shadow);

}

.mgx-viewer-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background:
        linear-gradient(120deg, transparent 0 30%, rgba(255,255,255,.025) 41%, transparent 52%),
        radial-gradient(circle at 75% 5%, rgba(227,6,19,.07), transparent 24%);
}


/* =========================================================
   HEADER
   ========================================================= */

.mgx-viewer-header {
    position: relative;
    z-index: 15;
    flex: 0 0 62px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;

    padding: 0 18px 0 22px;
    box-sizing: border-box;

    border-bottom: 1px solid rgba(255,255,255,.075);

    background:
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.018)),
        rgba(11,11,14,.64);

    -webkit-backdrop-filter: blur(26px) saturate(150%);
    backdrop-filter: blur(26px) saturate(150%);
}

.mgx-viewer-brand {
    justify-self: start;

    color: rgba(255,255,255,.94);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1.6px;
}

.mgx-viewer-title {
    justify-self: center;
    max-width: min(520px, 48vw);

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: rgba(255,255,255,.76);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .75px;
    text-align: center;
}

.mgx-viewer-close,
.mgx-viewer-finish-popup-close,
.mgx-viewer-more-sheet__close {
    appearance: none;
    -webkit-appearance: none;
}

.mgx-viewer-close {
    justify-self: end;

    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;

    background:
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035)),
        rgba(22,22,27,.68);

    color: #fff;
    font-size: 15px;
    cursor: pointer;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 8px 24px rgba(0,0,0,.20);

    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-close:hover {
        transform: rotate(90deg) scale(1.03);
        background: rgba(227,6,19,.90);
        border-color: rgba(255,255,255,.16);
    }
}


/* =========================================================
   CONTENIDO
   ========================================================= */

.mgx-viewer-content {
    position: relative;
    z-index: 2;

    flex: 1;
    min-height: 0;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
}


/* =========================================================
   STAGE
   ========================================================= */

.mgx-viewer-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;

    background:
        radial-gradient(circle at 50% 44%, rgba(255,255,255,.055), transparent 28%),
        radial-gradient(circle at 50% 52%, rgba(227,6,19,.045), transparent 48%),
        linear-gradient(180deg, #0a0a0d 0%, #040406 100%);
}

.mgx-viewer-stage::before {
    content: "";
    position: absolute;
    inset: -9%;
    z-index: 0;

    background-image: var(--mgx-viewer-current-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;

    filter: blur(48px) saturate(1.18) brightness(.64);
    opacity: .22;
    transform: scale(1.08);
    pointer-events: none;
}

.mgx-viewer-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;

    background:
        linear-gradient(180deg, rgba(0,0,0,.08), transparent 20%, transparent 72%, rgba(0,0,0,.30)),
        radial-gradient(circle at 50% 48%, transparent 25%, rgba(0,0,0,.18) 100%);
}


/* =========================================================
   IDENTIDAD MARCA | MODELO
   ========================================================= */

.mgx-viewer-bike-identity {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 26;

    max-width: min(430px, calc(100% - 160px));
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 5px 11px;
    box-sizing: border-box;
    transform: translateX(-50%);

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    background: rgba(9,9,12,.32);

    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);

    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.mgx-viewer-bike-identity[hidden] {
    display: none !important;
}

.mgx-viewer-bike-brand-logo,
.mgx-viewer-bike-model-logo {
    display: block;
    flex: 0 0 auto;
    width: auto;
    object-fit: contain;
    -webkit-user-drag: none;
}

.mgx-viewer-bike-brand-logo {
    height: 33px;
    max-width: 180px;
    max-height: 33px;
}

.mgx-viewer-bike-model-logo {
    height: 29px;
    max-width: 180px;
    max-height: 29px;
}

.mgx-viewer-bike-logo-separator {
    flex: 0 0 1px;
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,.34);
}

.mgx-viewer-bike-identity:not(.has-brand-logo) .mgx-viewer-bike-model-logo,
.mgx-viewer-bike-identity:not(.has-model-logo) .mgx-viewer-bike-brand-logo {
    max-width: 195px;
}


/* =========================================================
   IMAGEN PRINCIPAL
   ========================================================= */

.mgx-viewer-image-wrap {
    position: absolute;
    left: 42px;
    right: 42px;
    top: 82px;
    bottom: 92px;
    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    touch-action: none;
    cursor: default;
}

.mgx-viewer-image {
    position: relative;
    z-index: 2;

    display: block;

    /*
     * La imagen ocupa la caja completa y object-fit se encarga
     * de adaptar cualquier proporción sin recortarla.
     * Esto normaliza motos altas, anchas y pequeñas.
     */
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;

    object-fit: contain;
    object-position: center center;

    transform-origin: center center;
    will-change: transform;

    user-select: none;
    -webkit-user-drag: none;
}

.mgx-viewer-image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 12;

    background-image: url('../images/logo_watermark.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .14;

    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}


/* =========================================================
   CONTADOR
   ========================================================= */

.mgx-viewer-counter {
    position: absolute;
    top: 17px;
    left: 17px;
    z-index: 30;

    min-width: 48px;
    min-height: 31px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.11);
    border-radius: 999px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.025)),
        rgba(9,9,12,.58);

    color: rgba(255,255,255,.78);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    text-align: center;

    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
}


/* =========================================================
   FLECHAS
   ========================================================= */

.mgx-viewer-arrow {
    position: absolute;
    top: 50%;
    z-index: 32;

    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;

    background:
        linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.035)),
        rgba(15,15,19,.65);

    color: #fff;
    font-size: 14px;
    cursor: pointer;

    transform: translateY(-50%);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 12px 32px rgba(0,0,0,.28);

    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);

    transition: transform .22s ease, background .2s ease, border-color .2s ease;
}

.mgx-viewer-prev { left: 18px; }
.mgx-viewer-next { right: 18px; }

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-arrow:hover {
        transform: translateY(-50%) scale(1.06);
        background: rgba(227,6,19,.90);
        border-color: rgba(255,255,255,.18);
    }
}


/* =========================================================
   ZOOM
   ========================================================= */

.mgx-viewer-zoom {
    position: absolute;
    left: 50%;
    bottom: 72px;
    z-index: 40;

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 5px;

    padding: 5px 7px;

    border: 1px solid rgba(255,255,255,.20);
    border-radius: 999px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.18),
            rgba(255,255,255,.045) 42%,
            rgba(116,0,8,.12)
        ),
        rgba(227,6,19,.92);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.28),
        0 8px 22px rgba(227,6,19,.20),
        0 3px 10px rgba(0,0,0,.28);

    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
}

.mgx-viewer-zoom button {
    height: 32px;
    border: 0;
    color: #fff;
    cursor: pointer;
}

.mgx-viewer-zoom-in,
.mgx-viewer-zoom-out {
    width: 32px;

    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 50%;

    background: rgba(255,255,255,.10);

    color: #fff;
    font-size: 18px;
    line-height: 1;
}

.mgx-viewer-zoom-value {
    min-width: 48px;

    color: #fff;

    font-size: 10px;
    font-weight: 800;
    line-height: 1;

    text-align: center;
}

.mgx-viewer-zoom-reset {
    padding: 0 9px;

    border-left: 1px solid rgba(255,255,255,.18) !important;
    border-radius: 0 999px 999px 0;

    background: transparent;

    color: rgba(255,255,255,.88) !important;

    font-size: 8px;
    font-weight: 800;
    letter-spacing: .6px;
}

@media (hover:hover) and (pointer:fine) {
    .mgx-viewer-zoom-in:hover,
    .mgx-viewer-zoom-out:hover {
        background: rgba(255,255,255,.22);
    }

    .mgx-viewer-zoom-reset:hover {
        color: #fff !important;
    }
}


/* =========================================================
   MINIATURAS
   ========================================================= */

.mgx-viewer-thumbs {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 40;

    transform: translateX(-50%);

    width: min(560px, calc(100% - 130px));
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 4px 6px;
    box-sizing: border-box;
    overflow: hidden;

    border: 1px solid rgba(255,255,255,.075);
    border-radius: 16px;
    background: rgba(7,7,10,.30);

    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.mgx-viewer-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 43px;
    padding: 2px;
    overflow: hidden;

    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    background: rgba(255,255,255,.035);

    opacity: .50;
    cursor: pointer;

    transition: opacity .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mgx-viewer-thumb.is-active {
    opacity: 1;
    border-color: rgba(255,45,58,.82);
    box-shadow:
        0 0 0 1px rgba(227,6,19,.14),
        0 6px 18px rgba(227,6,19,.12);
}

.mgx-viewer-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-thumb:hover {
        opacity: .86;
        transform: translateY(-2px);
    }
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.mgx-viewer-sidebar {
    position: relative;
    min-width: 0;

    padding: 24px 24px 28px;
    box-sizing: border-box;
    overflow-y: auto;

    border-left: 1px solid rgba(255,255,255,.075);

    background:
        linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)),
        rgba(10,10,13,.58);

    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.14) transparent;
}

.mgx-viewer-sidebar-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    margin-bottom: 10px;
    padding: 0 10px;

    border: 1px solid rgba(255,45,58,.28);
    border-radius: 999px;
    background: rgba(227,6,19,.11);

    color: #fff;
    font-size: 8px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 1.3px;
}

.mgx-viewer-sidebar-code {
    width: 100%;
    margin: 0 0 10px;

    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 3px;

    color: #fff;
    font-size: 13px;
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: -.10px;
    white-space: nowrap;
}

.mgx-viewer-sidebar-model,
.mgx-viewer-sidebar-separator,
.mgx-viewer-sidebar-code-label,
.mgx-viewer-sidebar-design-code {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mgx-viewer-sidebar-model,
.mgx-viewer-sidebar-design-code { color: #fff; }
.mgx-viewer-sidebar-separator { color: rgba(255,255,255,.30); }
.mgx-viewer-sidebar-code-label {
    color: var(--mgx-viewer-red-bright);
    font-size: .76em;
    letter-spacing: .45px;
}

.mgx-viewer-sidebar-text {
    margin: 0 0 22px;
    color: rgba(255,255,255,.55);
    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   CONFIGURACIÓN / PRECIOS
   ========================================================= */

.mgx-viewer-pricing {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mgx-viewer-price-loading,
.mgx-viewer-price-error {
    min-height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;

    border: 1px dashed rgba(255,255,255,.13);
    border-radius: 20px;
    background: rgba(255,255,255,.018);

    color: rgba(255,255,255,.34);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
}

.mgx-viewer-config-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mgx-viewer-config-label {
    color: rgba(255,255,255,.48);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.25px;
}

.mgx-viewer-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mgx-viewer-mode-button {
    min-height: 60px;
    padding: 10px 11px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    border: 1px solid rgba(255,255,255,.09);
    border-radius: 17px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
        rgba(255,255,255,.018);

    color: #fff;
    cursor: pointer;
    text-align: center;

    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mgx-viewer-mode-button.is-active {
    border-color: rgba(255,45,58,.58);
    background:
        linear-gradient(180deg, rgba(255,255,255,.06), transparent),
        rgba(227,6,19,.13);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 8px 22px rgba(227,6,19,.08);
}

.mgx-viewer-mode-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .35px;
}

.mgx-viewer-mode-button small {
    color: rgba(255,255,255,.45);
    font-size: 8px;
    font-weight: 500;
}

.mgx-viewer-mode-button--shipping strong {
    color: #ff5962;
    font-size: 10px;
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-mode-button:hover {
        transform: translateY(-1px);
        border-color: rgba(255,255,255,.18);
    }
}


/* =========================================================
   ACABADO / MATERIAL
   ========================================================= */

.mgx-viewer-finish-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;

    padding: 11px 12px;

    border: 1px solid rgba(255,255,255,.075);
    border-radius: 17px;

    background:
        linear-gradient(100deg, rgba(227,6,19,.12), rgba(255,255,255,.028) 62%, rgba(255,255,255,.015));
}

.mgx-viewer-finish-heading-copy {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.mgx-viewer-finish-label {
    width: 100%;
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.mgx-viewer-finish-hint {
    color: rgba(255,255,255,.48);
    font-size: 8px;
    line-height: 1.35;
    font-weight: 500;
}

.mgx-viewer-discount-note {
    flex: 0 0 auto;
    color: #ff5962;
    font-size: 7px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: .45px;
    text-align: center;
}

.mgx-viewer-finish-select {
    position: relative;
}

.mgx-viewer-finish-toggle {
    position: relative;
    width: 100%;
    min-height: 60px;
    padding: 0 52px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border: 1px solid rgba(255,255,255,.11);
    border-radius: 18px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.022)),
        rgba(12,12,15,.44);

    color: #fff;
    cursor: pointer;
    text-align: center;

    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mgx-viewer-finish-current {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.mgx-viewer-finish-current-price {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.mgx-viewer-finish-toggle i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;

    border: 1px solid rgba(255,45,58,.32);
    border-radius: 50%;
    background: rgba(227,6,19,.12);
    color: #ff5962;
    font-size: 10px;

    transition: transform .2s ease, background .2s ease;
}

.mgx-viewer-finish-toggle[aria-expanded="true"] i {
    transform: translateY(-50%) rotate(180deg);
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-finish-toggle:hover {
        border-color: rgba(255,45,58,.50);
        background: rgba(227,6,19,.075);
    }
}


/* =========================================================
   PRECIO FINAL
   ========================================================= */

.mgx-viewer-price-summary {
    margin-top: 8px;
    min-height: 92px;
    padding: 15px 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    text-align: center;

    border: 1px solid rgba(255,45,58,.32);
    border-radius: 21px;

    background:
        radial-gradient(circle at 88% 18%, rgba(227,6,19,.18), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.018)),
        rgba(12,12,15,.55);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.07),
        0 12px 34px rgba(0,0,0,.18);
}

.mgx-viewer-price-summary > span {
    color: rgba(255,255,255,.58);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.mgx-viewer-price-summary > strong {
    color: #fff;
    font-size: 40px;
    line-height: .95;
    font-weight: 900;
    letter-spacing: -1px;
}

.mgx-viewer-price-summary > strong small {
    color: var(--mgx-viewer-red-bright);
    font-size: .50em;
    font-weight: 700;
}

.mgx-viewer-price-summary > em {
    color: #ff5962;
    font-size: 8px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.mgx-viewer-price-summary--standalone {
    margin-top: 8px;
}


/* =========================================================
   CONFIANZA / EMPRESA
   ========================================================= */

.mgx-viewer-trust {
    margin-top: 20px;
    padding-top: 17px;

    border-top: 1px solid rgba(255,255,255,.075);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    text-align: center;
}

.mgx-viewer-trust > strong {
    color: rgba(255,255,255,.86);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.mgx-viewer-trust-ruc {
    color: rgba(255,255,255,.40);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .7px;
}

.mgx-viewer-trust-items {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.mgx-viewer-trust-items span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.57);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .4px;
}

.mgx-viewer-trust-items i {
    color: var(--mgx-viewer-red-bright);
    font-size: 11px;
}

.mgx-viewer-trust > small:not(.mgx-viewer-trust-ruc) {
    color: rgba(255,255,255,.34);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: .6px;
}


/* =========================================================
   POPUP DE ACABADOS — MODAL GLASS
   ========================================================= */

.mgx-viewer-finish-menu {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    z-index: 13080;

    width: min(420px, calc(100vw - 40px));
    max-height: min(540px, calc(100dvh - 56px));

    display: none;
    padding: 14px;
    overflow: hidden;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.16);
    border-radius: 24px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.025)),
        rgba(13,13,17,.94);

    box-shadow:
        0 0 0 100vmax rgba(0,0,0,.34),
        inset 0 1px 0 rgba(255,255,255,.11),
        0 30px 90px rgba(0,0,0,.72);

    transform: translate(-50%, -50%);

    -webkit-backdrop-filter: blur(30px) saturate(150%);
    backdrop-filter: blur(30px) saturate(150%);
}

.mgx-viewer-finish-menu.is-open {
    display: flex;
    flex-direction: column;
}

.mgx-viewer-finish-popup-head {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 4px 2px 13px;
    border-bottom: 1px solid rgba(255,255,255,.075);
}

.mgx-viewer-finish-popup-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mgx-viewer-finish-popup-kicker {
    color: #ff5962;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.2px;
}

.mgx-viewer-finish-popup-head strong {
    color: #fff;
    font-size: 14px;
    line-height: 1.15;
    font-weight: 700;
}

.mgx-viewer-finish-popup-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
}

.mgx-viewer-finish-popup-list {
    min-height: 0;
    max-height: min(420px, calc(100dvh - 170px));
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 11px;
    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
}

.mgx-viewer-finish-option {
    width: 100%;
    min-height: 50px;
    padding: 7px 8px 7px 12px;

    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;

    border: 1px solid rgba(255,255,255,.085);
    border-radius: 16px;

    background: rgba(255,255,255,.035);
    color: #fff;
    cursor: pointer;
    text-align: left;

    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mgx-viewer-finish-option.is-active {
    border-color: rgba(255,45,58,.60);
    background:
        linear-gradient(180deg, rgba(255,255,255,.055), transparent),
        rgba(227,6,19,.13);
}

.mgx-viewer-finish-option-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.mgx-viewer-finish-option-price {
    min-width: 74px;
    padding: 7px 9px;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%),
        linear-gradient(135deg, var(--mgx-viewer-red-bright), var(--mgx-viewer-red));

    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;

    box-shadow: 0 6px 16px rgba(227,6,19,.18);
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-finish-option:hover {
        transform: translateY(-1px);
        border-color: rgba(255,255,255,.18);
        background: rgba(255,255,255,.06);
    }
}


/* =========================================================
   DOCK DEL VIEWER — LIQUID GLASS
   ========================================================= */

.mgx-viewer-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 13040;

    transform: translateX(-50%);

    width: min(460px, calc(100% - 24px));
    min-height: 68px;
    padding: 7px;

    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 5px;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.15);
    border-radius: 32px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.025)),
        rgba(13,13,17,.70);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.11),
        0 20px 58px rgba(0,0,0,.56);

    -webkit-backdrop-filter: blur(28px) saturate(165%) brightness(1.03);
    backdrop-filter: blur(28px) saturate(165%) brightness(1.03);
}

.mgx-viewer-bottom-nav__item {
    min-width: 0;
    min-height: 54px;
    padding: 5px 7px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    border: 1px solid transparent;
    border-radius: 22px;
    background: transparent;
    color: rgba(255,255,255,.88);

    font: inherit;
    cursor: pointer;

    transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}

.mgx-viewer-bottom-nav__item.is-primary {
    color: #fff;
    border-color: rgba(255,255,255,.16);
    background:
        linear-gradient(180deg, rgba(255,255,255,.14), transparent 40%),
        linear-gradient(150deg, #ff2534, #c4000d 72%);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        0 9px 26px rgba(227,6,19,.28);
}

.mgx-viewer-bottom-nav__item > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1;
    font-weight: 600;
}

.mgx-viewer-nav-icon {
    width: 24px;
    height: 24px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55 !important;
}

.mgx-viewer-nav-icon use {
    stroke-width: 1.55 !important;
}

.mgx-viewer-bottom-nav__dots {
    width: 27px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mgx-viewer-bottom-nav__dots i {
    width: 4px;
    height: 4px;
    display: block;
    border-radius: 50%;
    background: currentColor;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-bottom-nav__item:hover,
    .mgx-viewer-bottom-nav__item:focus-visible {
        transform: translateY(-1px);
        background: rgba(255,255,255,.07);
        color: #fff;
        outline: 0;
    }

    .mgx-viewer-bottom-nav__item.is-primary:hover {
        background:
            linear-gradient(180deg, rgba(255,255,255,.16), transparent 40%),
            linear-gradient(150deg, #ff3140, #d0000f 72%);
    }
}


/* =========================================================
   OVERLAY + BOTTOM SHEETS
   ========================================================= */

.mgx-viewer-more-overlay {
    position: fixed;
    inset: 0;
    z-index: 13050;

    background: rgba(0,0,0,.58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);

    transition: opacity .22s ease, visibility .22s ease;
}

.mgx-viewer-more-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mgx-viewer-more-sheet {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 13060;

    transform: translate(-50%, calc(100% + 120px));

    width: min(620px, calc(100% - 28px));
    max-height: min(72vh, 680px);
    overflow: auto;

    padding: 10px 18px 18px;
    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 28px;

    background:
        linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.025)),
        rgba(15,15,19,.88);

    color: #fff;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 28px 85px rgba(0,0,0,.68);

    -webkit-backdrop-filter: blur(32px) saturate(160%);
    backdrop-filter: blur(32px) saturate(160%);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        transform .30s cubic-bezier(.22,.72,.22,1),
        opacity .2s ease,
        visibility .2s ease;
}

.mgx-viewer-more-sheet.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mgx-viewer-more-sheet__handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.24);
}

.mgx-viewer-more-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.mgx-viewer-more-sheet__head small,
.mgx-viewer-more-sheet__head strong {
    display: block;
}

.mgx-viewer-more-sheet__head small {
    color: #ff5962;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.2px;
}

.mgx-viewer-more-sheet__head strong {
    margin-top: 3px;
    color: #fff;
    font-size: 27px;
    line-height: 1;
    font-weight: 900;
}

.mgx-viewer-more-sheet__close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    padding: 0;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    background: rgba(255,255,255,.055);
    color: #fff;
    cursor: pointer;
}

.mgx-viewer-more-sheet__close .mgx-viewer-nav-icon {
    width: 19px;
    height: 19px;
}

.mgx-viewer-more-sheet__list {
    display: grid;
    gap: 8px;
}

.mgx-viewer-more-sheet__list button {
    width: 100%;
    min-height: 66px;
    padding: 10px 12px;

    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 20px;
    align-items: center;
    gap: 10px;

    border: 1px solid rgba(255,255,255,.085);
    border-radius: 17px;
    background: rgba(255,255,255,.03);
    color: #fff;

    text-align: left;
    font: inherit;
    cursor: pointer;

    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mgx-viewer-more-sheet__list button > .mgx-viewer-nav-icon:first-child {
    width: 25px;
    height: 25px;
    color: #ff5962;
}

.mgx-viewer-more-sheet__list button > .mgx-viewer-nav-icon:last-child {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,.46);
}

.mgx-viewer-more-sheet__list span,
.mgx-viewer-more-sheet__list strong,
.mgx-viewer-more-sheet__list small {
    display: block;
}

.mgx-viewer-more-sheet__list strong {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.mgx-viewer-more-sheet__list small {
    margin-top: 2px;
    color: rgba(255,255,255,.52);
    font-size: 9px;
    line-height: 1.25;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-viewer-more-sheet__list button:hover {
        transform: translateY(-1px);
        border-color: rgba(255,45,58,.38);
        background: rgba(227,6,19,.075);
    }
}


/* =========================================================
   INFORMACIÓN DEL MATERIAL
   ========================================================= */

.mgx-viewer-material-info {
    padding: 14px;

    border: 1px solid rgba(255,255,255,.085);
    border-radius: 20px;

    background:
        linear-gradient(135deg, rgba(227,6,19,.09), rgba(255,255,255,.022)),
        rgba(0,0,0,.10);
}

.mgx-viewer-material-info__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mgx-viewer-material-info__title > .mgx-viewer-nav-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    color: #ff5962;
}

.mgx-viewer-material-info__title small,
.mgx-viewer-material-info__title strong {
    display: block;
}

.mgx-viewer-material-info__title small {
    color: rgba(255,255,255,.42);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1px;
}

.mgx-viewer-material-info__title strong {
    margin-top: 3px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.mgx-viewer-material-info > p {
    margin: 14px 0 0;
    color: rgba(255,255,255,.66);
    font-size: 11px;
    line-height: 1.55;
}

.mgx-viewer-material-info__grid {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.mgx-viewer-material-info__grid > div {
    padding: 11px 12px;
    display: grid;
    grid-template-columns: 92px minmax(0,1fr);
    gap: 10px;

    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(0,0,0,.20);
}

.mgx-viewer-material-info__grid span {
    color: rgba(255,255,255,.38);
    font-size: 9px;
    font-weight: 600;
}

.mgx-viewer-material-info__grid strong {
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
}


/* =========================================================
   ESCRITORIO — PROPORCIÓN COMPACTA / CONTENIDO CENTRADO
   ========================================================= */

@media (min-width: 900px) {
    .mgx-viewer-shell {
        max-height: 760px;
    }

    .mgx-viewer-sidebar {
        display: flex;
        flex-direction: column;
    }

    .mgx-viewer-pricing {
        gap: 12px;
    }

    .mgx-viewer-sidebar-text {
        margin-bottom: 16px;
    }

    .mgx-viewer-trust {
        margin-top: 15px;
        padding-top: 14px;
    }

    .mgx-viewer-mode-title,
    .mgx-viewer-mode-button small,
    .mgx-viewer-finish-label,
    .mgx-viewer-finish-hint,
    .mgx-viewer-finish-current,
    .mgx-viewer-finish-current-price,
    .mgx-viewer-price-summary > span,
    .mgx-viewer-price-summary > em {
        text-align: center;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) and (min-width: 900px) {
    .mgx-viewer-content {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .mgx-viewer-sidebar {
        padding-left: 20px;
        padding-right: 20px;
    }
}


/* =========================================================
   MÓVIL / TABLET VERTICAL
   ========================================================= */

@media (max-width: 899px) {
    .mgx-viewer {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;

        overflow-y: auto;
        overflow-x: hidden;

        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .mgx-viewer-shell {
        width: 100%;
        height: auto;
        min-height: 100dvh;
        flex: 0 0 auto;

        overflow: visible;
        border: 0;
        border-radius: 0;
        background: #050507;
    }

    .mgx-viewer-header {
        position: sticky;
        top: 0;
        z-index: 200;
        flex: 0 0 58px;

        grid-template-columns: auto minmax(0,1fr) auto;
        gap: 10px;
        padding: 0 11px 0 13px;

        background:
            linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.018)),
            rgba(8,8,11,.78);

        -webkit-backdrop-filter: blur(24px) saturate(150%);
        backdrop-filter: blur(24px) saturate(150%);
    }

    .mgx-viewer-brand { font-size: 9px; }
    .mgx-viewer-title { max-width: 58vw; font-size: 9px; }
    .mgx-viewer-close { width: 38px; height: 38px; }

    .mgx-viewer-content {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: visible;
    }

    .mgx-viewer-stage {
        width: 100%;
        height: min(56svh, 470px);
        min-height: 360px;
        flex: 0 0 auto;
        overflow: hidden;
        touch-action: pan-y;
    }

    .mgx-viewer-bike-identity {
        top: 11px;
        max-width: calc(100% - 92px);
        min-height: 31px;
        gap: 7px;
        padding: 4px 9px;
    }

    .mgx-viewer-bike-brand-logo {
        height: 24px;
        max-height: 24px;
        max-width: 132px;
    }

    .mgx-viewer-bike-model-logo {
        height: 21px;
        max-height: 21px;
        max-width: 132px;
    }

    .mgx-viewer-bike-logo-separator { height: 21px; }

    .mgx-viewer-bike-identity:not(.has-brand-logo) .mgx-viewer-bike-model-logo,
    .mgx-viewer-bike-identity:not(.has-model-logo) .mgx-viewer-bike-brand-logo {
        max-width: 155px;
    }

    .mgx-viewer-image-wrap {
        left: 14px;
        right: 14px;
        top: 50px;
        bottom: 86px;
        touch-action: pan-y;
    }

    .mgx-viewer-image-wrap.is-zoomed {
        touch-action: none;
        overscroll-behavior: contain;
    }

    .mgx-viewer-image {
        width: 96%;
        height: 96%;
        max-width: none;
        max-height: none;
    }

    .mgx-viewer-image-wrap::after { opacity: .15; }

    .mgx-viewer-counter {
        top: 10px;
        left: 10px;
        min-height: 28px;
        padding: 0 9px;
        font-size: 8px;
    }

    .mgx-viewer-arrow {
        width: 42px;
        height: 42px;
        font-size: 12px;
    }

    .mgx-viewer-prev { left: 8px; }
    .mgx-viewer-next { right: 8px; }

    .mgx-viewer-zoom {
        bottom: 58px;
    }

    .mgx-viewer-thumbs {
        bottom: 8px;
        width: calc(100% - 78px);
        min-height: 45px;

        justify-content: flex-start;
        padding: 3px 5px;

        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .mgx-viewer-thumbs::-webkit-scrollbar { display: none; }

    .mgx-viewer-thumb {
        flex: 0 0 54px;
        width: 54px;
        height: 38px;
        border-radius: 9px;
    }

    .mgx-viewer-sidebar {
        width: 100%;
        flex: 0 0 auto;
        max-height: none;

        padding: 20px 15px calc(120px + env(safe-area-inset-bottom));

        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.075);

        overflow: visible;
        background:
            linear-gradient(180deg, rgba(255,255,255,.035), transparent 22%),
            #070709;
    }

    .mgx-viewer-sidebar-code {
        font-size: 14px;
        line-height: 1.25;
        gap: 4px;
    }

    .mgx-viewer-sidebar-text {
        margin-bottom: 15px;
        font-size: 10px;
    }

    .mgx-viewer-pricing { gap: 14px; }
    .mgx-viewer-mode-button { min-height: 54px; }
    .mgx-viewer-finish-label { font-size: 10px; }
    .mgx-viewer-finish-hint { font-size: 8px; }
    .mgx-viewer-finish-toggle { min-height: 60px; }
    .mgx-viewer-finish-current { font-size: 12px; }
    .mgx-viewer-finish-current-price { font-size: 13px; }
    .mgx-viewer-price-summary { min-height: 88px; }
    .mgx-viewer-price-summary > strong { font-size: 35px; }

    .mgx-viewer-trust > strong { font-size: 12px; }
    .mgx-viewer-trust-ruc { font-size: 10px; }
    .mgx-viewer-trust-items span { font-size: 10px; }
    .mgx-viewer-trust > small:not(.mgx-viewer-trust-ruc) { font-size: 9px; }

    .mgx-viewer-finish-menu {
        width: min(430px, calc(100vw - 24px));
        max-height: min(560px, calc(100dvh - 34px));
        padding: 13px;
        border-radius: 24px;
    }

    .mgx-viewer-finish-popup-list {
        max-height: min(430px, calc(100dvh - 150px));
    }

    .mgx-viewer-finish-option { min-height: 52px; }
    .mgx-viewer-finish-option-name { font-size: 11px; }
    .mgx-viewer-finish-option-price { min-width: 80px; font-size: 11px; }

    .mgx-viewer-bottom-nav {
        left: 10px;
        right: 10px;
        bottom: max(8px, env(safe-area-inset-bottom));
        transform: none;

        width: auto;
        min-height: 68px;
        border-radius: 30px;
    }

    .mgx-viewer-more-sheet {
        bottom: 0;
        width: 100%;
        max-height: 74vh;
        padding: 10px 16px calc(22px + env(safe-area-inset-bottom));

        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 28px 28px 0 0;

        transform: translate(-50%, 105%);
    }

    .mgx-viewer-more-sheet.is-open {
        transform: translate(-50%, 0);
    }

    .mgx-viewer-more-sheet__head strong { font-size: 25px; }
}


/* =========================================================
   MÓVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 420px) {
    .mgx-viewer-brand { display: none; }

    .mgx-viewer-header {
        grid-template-columns: minmax(0,1fr) auto;
    }

    .mgx-viewer-title {
        justify-self: start;
        max-width: 76vw;
        text-align: left;
    }

    .mgx-viewer-stage {
        height: min(52svh, 430px);
        min-height: 330px;
    }

    .mgx-viewer-bike-identity {
        top: 10px;
        max-width: calc(100% - 78px);
        gap: 6px;
    }

    .mgx-viewer-bike-brand-logo {
        height: 21px;
        max-height: 21px;
        max-width: 112px;
    }

    .mgx-viewer-bike-model-logo {
        height: 18px;
        max-height: 18px;
        max-width: 112px;
    }

    .mgx-viewer-bike-logo-separator { height: 18px; }

    .mgx-viewer-bike-identity:not(.has-brand-logo) .mgx-viewer-bike-model-logo,
    .mgx-viewer-bike-identity:not(.has-model-logo) .mgx-viewer-bike-brand-logo {
        max-width: 132px;
    }

    .mgx-viewer-image-wrap {
        top: 43px;
        bottom: 84px;
    }

    .mgx-viewer-zoom-reset { display: none; }

    .mgx-viewer-finish-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .mgx-viewer-discount-note { text-align: left; }

    .mgx-viewer-price-summary > strong { font-size: 31px; }

    .mgx-viewer-bottom-nav {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .mgx-viewer-bottom-nav__item {
        padding-left: 4px;
        padding-right: 4px;
    }
}


/* =========================================================
   ENTRADA COMPARTIDA MÓVIL (?design=XXX)
   ========================================================= */

@media (max-width: 899px) {
    html:has(body.mgx-viewer-shared-body) {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: #050507;
    }

    body.mgx-viewer-shared-body {
        margin: 0 !important;
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: #050507;
        touch-action: manipulation !important;
        overscroll-behavior-y: auto !important;
    }

    body.mgx-viewer-shared-body > *:not(.mgx-viewer) {
        display: none !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry {
        position: relative !important;
        inset: auto !important;

        width: 100% !important;
        height: auto !important;
        min-height: 100dvh !important;

        padding: 0 !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow: visible !important;
        touch-action: manipulation !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 0;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-shell {
        position: relative;
        z-index: 2;
        width: 100% !important;
        height: auto !important;
        min-height: 100dvh !important;
        flex: 0 0 auto;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-content {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-stage,
    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-sidebar,
    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-image-wrap {
        touch-action: pan-y !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-image-wrap.is-zoomed {
        touch-action: none !important;
    }

    body.mgx-viewer-shared-body .mgx-viewer.is-shared-entry .mgx-viewer-sidebar {
        padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
    }
}


/* =========================================================
   FOCUS / ACCESIBILIDAD
   ========================================================= */

.mgx-viewer button:focus-visible {
    outline: 2px solid rgba(255,45,58,.92);
    outline-offset: 2px;
}


/* =========================================================
   MOVIMIENTO REDUCIDO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .mgx-viewer *,
    .mgx-viewer *::before,
    .mgx-viewer *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   MOTOGRAPHIX V9 — VIEWER FINAL
   Header limpio + X flotante.
   Escritorio: 3 miniaturas verticales.
   Móvil/tablet: 5 miniaturas horizontales grandes.
   ========================================================= */

.mgx-viewer-header {
    display: block !important;
    position: absolute !important;
    top: 12px;
    right: 12px;
    left: auto;
    width: 42px;
    height: 42px;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    z-index: 80;
    pointer-events: none;
}

.mgx-viewer-brand,
.mgx-viewer-title,
.mgx-viewer-sidebar-kicker {
    display: none !important;
}

.mgx-viewer-close {
    display: grid !important;
    position: absolute !important;
    inset: 0 !important;
    width: 42px !important;
    height: 42px !important;
    pointer-events: auto;
    z-index: 81;
}

@media (min-width: 900px) {

    .mgx-viewer-sidebar {
        padding-top: 54px;
    }

    .mgx-viewer-image-wrap {
        left: 104px;
        right: 24px;
        top: 54px;
        bottom: 58px;
    }

    .mgx-viewer-thumbs {
        left: 14px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 76px;
        min-height: 0;
        max-height: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 9px;
        padding: 8px;
        overflow: visible;
        border-radius: 18px;
        background:
            linear-gradient(
                180deg,
                rgba(255,255,255,.055),
                rgba(255,255,255,.018)
            ),
            rgba(7,7,10,.42);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.06),
            0 12px 30px rgba(0,0,0,.18);
        -webkit-backdrop-filter:
            blur(16px) saturate(135%);
        backdrop-filter:
            blur(16px) saturate(135%);
    }

    .mgx-viewer-thumb {
        flex: 0 0 58px;
        width: 58px;
        height: 58px;
        padding: 3px;
        border-radius: 13px;
        opacity: .46;
        background: rgba(255,255,255,.025);
    }

    .mgx-viewer-thumb img {
        border-radius: 9px;
    }

    .mgx-viewer-thumb.is-active {
        opacity: 1;
        border-color: rgba(255,45,58,.95);
        box-shadow:
            0 0 0 1px rgba(227,6,19,.24),
            0 0 18px rgba(227,6,19,.20),
            0 8px 18px rgba(0,0,0,.24);
        transform: scale(1.035);
    }

    .mgx-viewer-thumb.is-prev,
    .mgx-viewer-thumb.is-next {
        opacity: .48;
    }

    .mgx-viewer-prev {
        left: 94px;
    }

    .mgx-viewer-next {
        right: 12px;
    }

    .mgx-viewer-zoom {
        bottom: 44px;
    }

    @media (hover: hover) and (pointer: fine) {
        .mgx-viewer-thumb:hover {
            opacity: .90;
            transform: scale(1.035);
        }

        .mgx-viewer-thumb.is-active:hover {
            transform: scale(1.055);
        }
    }
}

@media (max-width: 899px) {

    .mgx-viewer-header {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .mgx-viewer-close {
        width: 40px !important;
        height: 40px !important;
    }

    .mgx-viewer-sidebar {
        padding-top: 10px !important;
    }

    .mgx-viewer-zoom {
        bottom: 78px !important;
        padding: 5px 8px !important;
    }

    .mgx-viewer-zoom button {
        height: 32px !important;
    }

    .mgx-viewer-zoom-in,
    .mgx-viewer-zoom-out {
        width: 32px !important;
    }

    .mgx-viewer-thumbs {
        bottom: 8px !important;
        width: calc(100% - 44px) !important;
        min-height: 58px !important;
        padding: 6px 8px !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    .mgx-viewer-thumb {
        flex: 0 0 64px !important;
        width: 64px !important;
        height: 46px !important;
        padding: 2px !important;
        border-radius: 11px !important;
    }

    .mgx-viewer-thumb img {
        border-radius: 8px !important;
    }
}

@media (max-width: 420px) {

    .mgx-viewer-zoom {
        bottom: 76px !important;
    }

    .mgx-viewer-thumbs {
        width: calc(100% - 30px) !important;
        min-height: 54px !important;
        padding: 5px 6px !important;
        gap: 6px !important;
    }

    .mgx-viewer-thumb {
        flex: 0 0 58px !important;
        width: 58px !important;
        height: 42px !important;
    }
}

