/* =========================================================
   MOTOGRAPHIX V9
   CATÁLOGO
   ========================================================= */


/* =========================================================
   PÁGINA
   ========================================================= */

.mgx-catalog-page {
    width: 100%;
    min-height: 100vh;
    padding: 48px 0 110px;
    background: #000000;
    color: #ffffff;
}

.mgx-catalog-container {
    width: min(1500px, calc(100% - 48px));
    margin: 0 auto;
}


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

.mgx-catalog-header {
    max-width: 900px;
    margin: 0 auto 24px;
    text-align: center;
}

.mgx-catalog-kicker {
    display: block;
    margin-bottom: 10px;
    color: #e30613;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.mgx-catalog-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}

.mgx-catalog-header p {
    max-width: 650px;
    margin: 14px auto 0;
    color: rgba(255,255,255,.58);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}


/* =========================================================
   BUSCADOR
   ========================================================= */

.mgx-catalog-search-wrap {
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: center;
    margin-bottom: 38px;
}

.mgx-catalog-search {
    width: min(720px, 100%);
    min-height: 52px;
    padding: 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(0,0,0,.30);
}

.mgx-catalog-search-box {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 16px;
}

.mgx-catalog-search-box i {
    flex: 0 0 auto;
    color: #666666;
    font-size: 13px;
}

.mgx-catalog-search-box input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0;
    background: transparent;
    color: #111111;
    border: 0;
    outline: 0;
    font-family: var(--mgx-font-ui);
    font-size: 13px;
    font-weight: 700;
}

.mgx-catalog-search-box input::placeholder {
    color: #777777;
}


/* =========================================================
   BOTÓN MARCAS
   ========================================================= */

.mgx-catalog-brands-button {
    min-width: 132px;
    height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(
        135deg,
        #ff1825 0%,
        #e30613 55%,
        #c8000c 100%
    );
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    font-family: var(--mgx-font-ui);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .5px;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform .2s ease,
        filter .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-catalog-brands-button:hover {
        transform: translateY(-1px);
        filter: brightness(1.06);
        box-shadow: 0 8px 24px rgba(227,6,19,.24);
    }
}


/* =========================================================
   SECCIONES
   ========================================================= */

.mgx-catalog-section {
    margin-top: 32px;
}

.mgx-catalog-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.mgx-catalog-section-heading h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.mgx-catalog-section-heading h2 span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #e30613;
    border-radius: 999px;
}

.mgx-catalog-section-heading small {
    padding: 6px 11px;
    background: #ffffff;
    color: #111111;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .5px;
}


/* =========================================================
   TENDENCIAS
   ========================================================= */

.mgx-trending-carousel {
    position: relative;
    width: 100%;
}

.mgx-trending-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 2px 8px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mgx-trending-track::-webkit-scrollbar {
    display: none;
}

.mgx-trending-track .mgx-model-card {
    flex: 0 0 calc(20% - 10px);
    width: calc(20% - 10px);
    max-width: calc(20% - 10px);
    min-width: 0;
    scroll-snap-align: start;
}


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

.mgx-trending-arrow {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    background: rgba(10,10,10,.94);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease,
        opacity .2s ease;
}

.mgx-trending-prev {
    left: -22px;
}

.mgx-trending-next {
    right: -22px;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-trending-arrow:hover {
        background: #e30613;
        border-color: #e30613;
        transform: translateY(-50%) scale(1.05);
    }
}


/* =========================================================
   CATÁLOGO VACÍO
   ========================================================= */

.mgx-catalog-empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #0a0a0a;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 20px;
    color: #777777;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}


/* =========================================================
   POPUP MARCAS — BASE
   ========================================================= */

.mgx-brands-popup {
    position: fixed;
    z-index: 9998;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.mgx-brands-popup.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mgx-brands-popup-panel {
    overflow: hidden;
    background: rgba(20,20,20,.98);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    transition: transform .25s ease;
}

.mgx-brands-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.mgx-brands-popup-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.mgx-brands-popup-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: #ffffff;
    font-size: 17px;
    cursor: pointer;
    transition:
        background .2s ease,
        transform .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-brands-popup-close:hover {
        background: #e30613;
        transform: rotate(90deg);
    }
}

.mgx-brands-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 22px;
    overflow-y: auto;
    box-sizing: border-box;
}

.mgx-brands-popup-item {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0 18px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: #111111;
    color: #ffffff;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.mgx-brands-popup-item span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.mgx-brands-popup-item small {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(227,6,19,.16);
    border: 1px solid rgba(227,6,19,.65);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-brands-popup-item:hover {
        background: #e30613;
        border-color: #e30613;
        transform: translateY(-2px);
    }

    .mgx-brands-popup-item:hover small {
        background: #ffffff;
        border-color: #ffffff;
        color: #e30613;
    }
}

.mgx-brands-popup-item.active {
    background: #e30613;
    border-color: #e30613;
}

.mgx-brands-popup-item.active small {
    background: #ffffff;
    border-color: #ffffff;
    color: #e30613;
}

.mgx-brands-popup-grid::-webkit-scrollbar {
    width: 6px;
}

.mgx-brands-popup-grid::-webkit-scrollbar-track {
    background: transparent;
}

.mgx-brands-popup-grid::-webkit-scrollbar-thumb {
    background: #e30613;
    border-radius: 999px;
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 900px) {

    .mgx-catalog-page .mgx-catalog-container {
        width: 90%;
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .mgx-catalog-search-wrap {
        position: fixed;
        left: 50%;
        bottom: 22px;
        transform: translateX(-50%);
        width: min(760px, 72vw);
        z-index: 9000;
        margin: 0;
        padding: 0;
    }

    .mgx-catalog-search {
        width: 100%;
        min-height: 58px;
        padding: 6px;
        gap: 8px;
        box-shadow: 0 15px 45px rgba(0,0,0,.50);
    }

    .mgx-catalog-search-box {
        height: 46px;
        gap: 12px;
        padding: 0 18px;
    }

    .mgx-catalog-search-box i {
        font-size: 15px;
    }

    .mgx-catalog-search-box input {
        font-size: 14px;
        font-weight: 600;
    }

    .mgx-catalog-brands-button {
        min-width: 145px;
        height: 46px;
        padding: 0 18px;
        gap: 9px;
        font-size: 11px;
        letter-spacing: .6px;
    }

    .mgx-brands-popup {
        left: 50%;
        bottom: 94px;
        transform: translateX(-50%);
        width: min(760px, 72vw);
        background: transparent;
    }

    .mgx-brands-popup-panel {
        width: 100%;
        max-height: 70vh;
        margin: 0;
        transform: translateY(14px) scale(.98);
        transform-origin: center bottom;
    }

    .mgx-brands-popup.is-open .mgx-brands-popup-panel {
        transform: translateY(0) scale(1);
    }

    .mgx-brands-popup-grid {
        max-height: calc(70vh - 90px);
    }
}


/* =========================================================
   MOBILE / TABLET VERTICAL
   ========================================================= */

@media (max-width: 899px) {

    .mgx-catalog-page {
        padding: 28px 0 110px;
    }

    .mgx-catalog-container {
        width: calc(100% - 24px);
    }

    .mgx-catalog-header {
        margin-bottom: 22px;
    }

    .mgx-catalog-kicker {
        font-size: 10px;
        letter-spacing: 1.4px;
    }

    .mgx-catalog-header h1 {
        font-size: 34px;
        line-height: .98;
        letter-spacing: -.8px;
    }

    .mgx-catalog-header p {
        font-size: 13px;
        line-height: 1.55;
    }

    .mgx-catalog-search-wrap {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 9000;
        margin: 0;
    }

    .mgx-catalog-search {
        width: 100%;
        min-height: 56px;
        padding: 6px;
        gap: 7px;
        box-shadow: 0 12px 36px rgba(0,0,0,.45);
    }

    .mgx-catalog-search-box {
        padding: 0 12px;
    }

    .mgx-catalog-search-box input {
        font-size: 13px;
    }

    .mgx-catalog-brands-button {
        width: auto;
        min-width: 108px;
        height: 44px;
        padding: 0 14px;
        gap: 7px;
        font-size: 11px;
    }

    .mgx-catalog-brands-button span,
    .mgx-catalog-brands-button .fa-chevron-down {
        display: inline;
    }

    .mgx-catalog-brands-button .fa-chevron-down {
        font-size: 9px;
    }

    .mgx-catalog-section {
        margin-top: 26px;
    }

    .mgx-catalog-section-heading {
        margin-bottom: 14px;
    }

    .mgx-catalog-section-heading h2 {
        font-size: 13px;
    }

    .mgx-catalog-section-heading small {
        display: none;
    }

    .mgx-trending-track {
        gap: 10px;
    }

    .mgx-trending-track .mgx-model-card {
        flex: 0 0 calc(50% - 5px);
        width: calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    .mgx-trending-arrow {
        width: 38px;
        height: 38px;
        font-size: 12px;
        background: rgba(0,0,0,.90);
        border: 1px solid rgba(255,255,255,.20);
        box-shadow: 0 6px 20px rgba(0,0,0,.48);
    }

    .mgx-trending-prev {
        left: -8px;
    }

    .mgx-trending-next {
        right: -8px;
    }

    .mgx-catalog-empty {
        min-height: 180px;
        padding: 22px;
        border-radius: 16px;
        font-size: 12px;
    }

    .mgx-brands-popup {
        left: 12px;
        right: 12px;
        bottom: 82px;
        background: transparent;
    }

    .mgx-brands-popup-panel {
        width: 100%;
        max-height: 72vh;
        margin: 0;
        border-radius: 22px;
        transform: translateY(14px) scale(.98);
        transform-origin: center bottom;
    }

    .mgx-brands-popup.is-open .mgx-brands-popup-panel {
        transform: translateY(0) scale(1);
    }

    .mgx-brands-popup-header {
        padding: 18px;
    }

    .mgx-brands-popup-header h3 {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .mgx-brands-popup-close {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 15px;
    }

    .mgx-brands-popup-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        padding: 14px;
        max-height: calc(72vh - 74px);
    }

    .mgx-brands-popup-item {
        min-height: 52px;
        padding: 0 13px;
        border-radius: 12px;
    }

    .mgx-brands-popup-item span {
        font-size: 10px;
    }

    .mgx-brands-popup-item small {
        min-width: 27px;
        height: 27px;
        font-size: 9px;
    }
}


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

@media (max-width: 480px) {

    .mgx-catalog-page {
        padding-top: 24px;
    }

    .mgx-catalog-header h1 {
        font-size: 31px;
    }

    .mgx-catalog-search-wrap {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .mgx-catalog-search {
        min-height: 54px;
        padding: 5px;
    }

    .mgx-catalog-brands-button {
        min-width: 100px;
        height: 44px;
        padding: 0 12px;
        font-size: 10px;
    }

    .mgx-brands-popup {
        left: 8px;
        right: 8px;
        bottom: 74px;
    }
}
/* =========================================================
   GLASS UI — CATÁLOGO PRINCIPAL
   ========================================================= */

.mgx-catalog-page {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 12% 7%, rgba(227,6,19,.14), transparent 34rem),
        radial-gradient(circle at 88% 32%, rgba(255,255,255,.055), transparent 30rem),
        #050506;
}

.mgx-catalog-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 72% 82%, rgba(227,6,19,.08), transparent 28rem),
        linear-gradient(180deg, rgba(255,255,255,.015), transparent 45%);
}

.mgx-catalog-header {
    max-width: 980px;
    margin: 0 auto 34px;
    padding: 28px 34px 30px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
    box-shadow: 0 22px 65px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.07);
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.mgx-catalog-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 13px;
    border: 1px solid rgba(227,6,19,.42);
    border-radius: 999px;
    background: rgba(227,6,19,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.mgx-catalog-section-heading,
.mgx-catalog-brand-heading {
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.018));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

@media (max-width: 760px) {
    .mgx-catalog-header {
        padding: 22px 18px 24px;
        border-radius: 24px;
        margin-bottom: 26px;
    }

    .mgx-catalog-section-heading,
    .mgx-catalog-brand-heading {
        padding: 9px 10px;
        border-radius: 16px;
    }
}

/* =========================================================
   MOTOGRAPHIX V9 — MARCAS CON LOGOTIPO
   Usa assets/images/brands-menu/<slug>.svg
   Mantiene el filtro actual; solo cambia la presentación.
   ========================================================= */

.mgx-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mgx-brands-popup-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mgx-brands-popup-item {
    position: relative;
    min-height: 96px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.050), rgba(255,255,255,.018));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.035),
        0 10px 26px rgba(0,0,0,.16);
}

.mgx-brands-popup-logo-wrap {
    width: 100%;
    height: 52px;
    padding: 4px 28px 4px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mgx-brands-popup-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 138px;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.30));
    transition:
        transform .22s ease,
        opacity .22s ease,
        filter .22s ease;
}

.mgx-brands-popup-item small {
    position: absolute;
    top: 9px;
    right: 9px;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    z-index: 2;
    background: rgba(7,7,9,.66);
    border: 1px solid rgba(227,6,19,.60);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mgx-brands-popup-item.no-logo {
    padding-right: 48px;
}

.mgx-brands-popup-fallback {
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .65px;
    text-align: center;
    text-transform: uppercase;
}

/* TODOS / TODAS LAS MARCAS */
.mgx-brands-popup-item--all {
    flex-direction: column;
    gap: 8px;
}

.mgx-brands-popup-all-icon {
    width: 34px;
    height: 34px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
}

.mgx-brands-popup-all-icon i {
    display: block;
    border: 1.5px solid rgba(255,255,255,.90);
    border-radius: 4px;
}

.mgx-brands-popup-item--all .mgx-brands-popup-name {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    color: rgba(255,255,255,.78);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .65px;
    white-space: normal !important;
    text-align: center;
}

/* Activo: borde/glow rojo en vez de bloque rojo completo */
.mgx-brands-popup-item.active {
    background:
        linear-gradient(145deg, rgba(227,6,19,.13), rgba(255,255,255,.025));
    border-color: rgba(237,16,29,.92);
    box-shadow:
        0 0 0 1px rgba(227,6,19,.12),
        0 12px 34px rgba(227,6,19,.16),
        inset 0 1px 0 rgba(255,255,255,.055);
}

.mgx-brands-popup-item.active small {
    background: #e30613;
    border-color: rgba(255,255,255,.16);
    color: #fff;
}

.mgx-brands-popup-item.active .mgx-brands-popup-logo {
    transform: scale(1.035);
    filter:
        drop-shadow(0 5px 14px rgba(0,0,0,.30))
        drop-shadow(0 0 12px rgba(227,6,19,.14));
}

@media (hover: hover) and (pointer: fine) {
    .mgx-brands-popup-item:hover {
        background:
            linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
        border-color: rgba(255,255,255,.22);
        transform: translateY(-2px);
    }

    .mgx-brands-popup-item:hover small {
        background: rgba(227,6,19,.88);
        border-color: rgba(255,255,255,.14);
        color: #fff;
    }

    .mgx-brands-popup-item:hover .mgx-brands-popup-logo {
        transform: scale(1.045);
    }
}

/* Tablet/móvil: 2 columnas, logos un poco más compactos */
@media (max-width: 899px) {
    .mgx-brands-popup-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .mgx-brands-popup-item {
        min-height: 88px;
        padding: 12px;
        border-radius: 16px;
    }

    .mgx-brands-popup-logo-wrap {
        height: 48px;
        padding: 4px 24px 4px 8px;
    }

    .mgx-brands-popup-logo {
        max-width: 126px;
    }

    .mgx-brands-popup-item small {
        top: 8px;
        right: 8px;
        min-width: 24px;
        height: 24px;
        padding-inline: 6px;
        font-size: 8px;
    }
}

@media (max-width: 420px) {
    .mgx-brands-popup-item {
        min-height: 82px;
    }

    .mgx-brands-popup-logo-wrap {
        height: 44px;
        padding-right: 22px;
    }

    .mgx-brands-popup-logo {
        max-width: 112px;
    }
}

/* =========================================================
   MOTOGRAPHIX V9 — LAYOUT DE MARCAS
   Cuadrícula compacta 1:1, 3 columnas y logos centrados.
   ========================================================= */

/* Escritorio: popup compacto, 3 columnas. */
@media (min-width: 900px) {
    .mgx-brands-popup {
        width: min(460px, calc(100vw - 48px)) !important;
    }

    .mgx-brands-popup-header {
        padding: 16px 18px !important;
    }

    .mgx-brands-popup-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 9px !important;
        padding: 12px !important;
    }
}

/* Todas las tarjetas conservan proporción cuadrada. */
.mgx-brands-popup-item {
    position: relative !important;
    width: 100%;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

/* Las tarjetas con logo centran el recurso en ambos ejes. */
.mgx-brands-popup-item.has-logo {
    display: grid !important;
    place-items: center !important;
}

.mgx-brands-popup-item.has-logo .mgx-brands-popup-logo-wrap {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 17% !important;
    display: grid !important;
    place-items: center !important;
    box-sizing: border-box !important;
}

.mgx-brands-popup-item.has-logo .mgx-brands-popup-logo {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: 50% 50% !important;
    transform-origin: 50% 50% !important;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* El nombre sigue disponible para JS/accesibilidad, sin afectar el layout. */
.mgx-brands-popup-item.has-logo .mgx-brands-popup-name {
    position: absolute !important;
}

/* TODAS LAS MARCAS conserva su icono y texto centrados. */
.mgx-brands-popup-item--all {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    aspect-ratio: 1 / 1 !important;
    padding: 12px !important;
    gap: 7px !important;
}

.mgx-brands-popup-item--all .mgx-brands-popup-name {
    position: static !important;
    margin: 0 !important;
    font-size: 7px !important;
    line-height: 1.2 !important;
    letter-spacing: .35px !important;
}

.mgx-brands-popup-all-icon {
    width: 28px !important;
    height: 28px !important;
}

/* Móvil/tablet: mismo diseño, 3 columnas. */
@media (max-width: 899px) {
    .mgx-brands-popup {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
    }

    .mgx-brands-popup-header {
        padding: 13px 14px !important;
    }

    .mgx-brands-popup-header h3 {
        font-size: 11px !important;
    }

    .mgx-brands-popup-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
        padding: 10px !important;
    }

    .mgx-brands-popup-item {
        aspect-ratio: 1 / 1 !important;
        border-radius: 12px !important;
    }

    .mgx-brands-popup-item.has-logo .mgx-brands-popup-logo-wrap {
        padding: 16% !important;
    }

    .mgx-brands-popup-all-icon {
        width: 24px !important;
        height: 24px !important;
    }

    .mgx-brands-popup-item--all .mgx-brands-popup-name {
        font-size: 6px !important;
    }
}

@media (max-width: 380px) {
    .mgx-brands-popup-grid {
        gap: 6px !important;
        padding: 8px !important;
    }

    .mgx-brands-popup-item.has-logo .mgx-brands-popup-logo-wrap {
        padding: 15% !important;
    }
}


/* =========================================================
   MOTOGRAPHIX V9 — PÁGINA SEO DE MARCA
   ========================================================= */

.mgx-brand-page-copy {
    max-width: 980px;
    margin: 42px auto 0;
    padding: 28px 30px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.016));
    box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.04);
    text-align: center;
}

.mgx-brand-page-copy h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.35px;
}

.mgx-brand-page-copy p {
    margin: 0 0 12px;
    color: rgba(255,255,255,.70);
    font-size: 14px;
    line-height: 1.72;
}

.mgx-brand-page-back {
    min-height: 42px;
    margin-top: 8px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(227,6,19,.55);
    border-radius: 999px;
    background: rgba(227,6,19,.12);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .65px;
    text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .mgx-brand-page-back:hover {
        transform: translateY(-1px);
        background: rgba(227,6,19,.22);
        border-color: rgba(227,6,19,.85);
    }
}

@media (max-width: 760px) {
    .mgx-brand-page-copy {
        margin-top: 30px;
        padding: 22px 18px;
        border-radius: 20px;
    }
}
\n\n/* =========================================================\n   V9 — FIX POPUP MARCAS COMO CAPA GLOBAL\n   Evita que el stacking context del catálogo lo deje oculto.\n   ========================================================= */\n\nbody > .mgx-brands-popup {\n    z-index: 14050 !important;\n}\n\nbody > .mgx-brands-popup.is-open {\n    opacity: 1 !important;\n    visibility: visible !important;\n    pointer-events: auto !important;\n}\n\nbody > .mgx-brands-popup .mgx-brands-popup-panel {\n    position: relative;\n    z-index: 1;\n    opacity: 1 !important;\n    visibility: visible !important;\n    background:\n        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),\n        rgba(12,12,15,.985) !important;\n    box-shadow:\n        inset 0 1px 0 rgba(255,255,255,.08),\n        0 28px 80px rgba(0,0,0,.72) !important;\n}\n\n/* El dock debe seguir visible debajo del popup, pero sin taparlo. */\nbody.mgx-brands-popup-open .mgx-context-nav {\n    z-index: 9900 !important;\n}\n