/* El Garage Gamer — integrado con computación AMONPUL */
.page.st-garage-page {
    --st-accent: #ff5800;
    --st-accent-dark: #e04e00;
    --st-bg-card: #fff;
    --st-border: #e8e8e8;
    --st-text-main: #333;
    --st-text-muted: #6c757d;
    --st-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    /* Recorte miniatura explore: nativo 736×1376; ocultar franja inferior (specs en la IA) */
    --st-img-w: 736;
    --st-img-h: 1376;
    --st-img-crop-bottom: 260;
    --st-img-visible-h: 1116;
    --st-spec-type-color: #1569af;
    --st-spec-pill-stack: 2.6rem;
}

html.story-view-active,
body.story-view-active {
    overflow: hidden;
}

.st-garage-intro {
    margin-bottom: 2rem;
}

.st-garage-hero-head {
    position: relative;
    display: inline-block;
    text-align: left;
    padding: 0.35rem 0 0.35rem 1rem;
    margin: 0 auto 0.5rem;
    border-left: 4px solid var(--st-accent);
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 88, 0, 0.06) 0%, transparent 72%);
}

@media (min-width: 768px) {
    .st-garage-hero-head {
        margin-left: 0;
        margin-right: 0;
    }
}

.st-garage-eyebrow {
    display: block;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--st-accent);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.st-garage-title {
    font-size: clamp(1.75rem, 4.2vw, 2.35rem);
    font-weight: 800;
    color: #1a1a1e;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.st-garage-title-accent {
    color: var(--st-accent);
}

.st-garage-lead {
    color: var(--st-text-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0.65rem 0 0;
    max-width: 40rem;
}

.st-garage-lead a {
    color: var(--st-accent-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.st-garage-lead a:hover {
    color: var(--st-accent);
}

.st-btn-cta-top {
    background-color: var(--st-accent);
    border: 1px solid var(--st-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.65rem 1.35rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.st-btn-cta-top:hover,
.st-btn-cta-top:focus {
    background-color: var(--st-accent-dark);
    border-color: var(--st-accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

.st-hero-ctas {
    width: 100%;
    max-width: 22rem;
}

@media (min-width: 576px) {
    .st-hero-ctas {
        width: auto;
        max-width: none;
    }
}

@keyframes stGarageRgbBorder {
    0% {
        border-color: #ff5800;
        box-shadow: 0 0 12px rgba(255, 88, 0, 0.45);
    }
    33% {
        border-color: #9333ea;
        box-shadow: 0 0 12px rgba(147, 51, 234, 0.4);
    }
    66% {
        border-color: #f97316;
        box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
    }
    100% {
        border-color: #ff5800;
        box-shadow: 0 0 12px rgba(255, 88, 0, 0.45);
    }
}

.st-btn-garage-rgb {
    background: linear-gradient(135deg, #1a1a1e 0%, #2d1f3d 50%, #1f1a14 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    border: 2px solid #ff5800;
    animation: stGarageRgbBorder 4.5s ease-in-out infinite;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.st-btn-garage-rgb:hover:not(:disabled),
.st-btn-garage-rgb:focus:not(:disabled) {
    color: #fff;
    transform: translateY(-1px) scale(1.02);
}

.st-btn-garage-rgb:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    animation: none;
    border-color: #ccc;
    box-shadow: none;
    background: #e9e9e9;
    color: #888;
}

.st-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

@keyframes stSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.st-thumb-card--skeleton {
    pointer-events: none;
    cursor: default;
}

.st-thumb-card--skeleton .st-thumb-img-box {
    background: linear-gradient(90deg, #ececec 0%, #f8f8f8 45%, #ececec 90%);
    background-size: 200% 100%;
    animation: stSkeletonShimmer 1.3s ease-in-out infinite;
}

.st-thumb-card--skeleton .st-thumb-specs-box {
    gap: 0.45rem;
}

.st-skeleton-line {
    display: block;
    height: 0.55rem;
    border-radius: 4px;
    background: linear-gradient(90deg, #ececec 0%, #f8f8f8 45%, #ececec 90%);
    background-size: 200% 100%;
    animation: stSkeletonShimmer 1.3s ease-in-out infinite;
}

.st-skeleton-line--short {
    width: 42%;
}

.st-skeleton-line--mid {
    width: 72%;
}

.st-skeleton-line--full {
    width: 100%;
}

.st-thumb-card {
    background-color: var(--st-bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--st-border);
    box-shadow: var(--st-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.st-thumb-card:hover,
.st-thumb-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255, 88, 0, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    outline: none;
}

/*
 * Explore: ventana = 736 × visible-h. La img llena un área más alta (ratio nativo)
 * y object-fit:cover + top recorta solo abajo (funciona aunque el .webp no sea 736×1376 exacto).
 */
.st-thumb-img-box {
    width: 100%;
    aspect-ratio: var(--st-img-w) / var(--st-img-visible-h);
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
    line-height: 0;
    isolation: isolate;
}

.st-thumb-img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% * var(--st-img-h) / var(--st-img-visible-h));
    object-fit: cover;
    object-position: top center;
    display: block;
    max-width: none;
}

.st-thumb-time-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--st-border);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--st-text-main);
    letter-spacing: 0.2px;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    line-height: 1.2;
    max-width: calc(100% - 1.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes stFreshBadgeGlow {
    0% {
        border-color: #ff5800;
        box-shadow: 0 0 0 1px rgba(255, 88, 0, 0.35), 0 0 14px rgba(255, 88, 0, 0.35);
    }
    33% {
        border-color: #9333ea;
        box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.4), 0 0 14px rgba(147, 51, 234, 0.35);
    }
    66% {
        border-color: #f97316;
        box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.4), 0 0 14px rgba(249, 115, 22, 0.35);
    }
    100% {
        border-color: #ff5800;
        box-shadow: 0 0 0 1px rgba(255, 88, 0, 0.35), 0 0 14px rgba(255, 88, 0, 0.35);
    }
}

.st-thumb-time-badge--fresh {
    border-width: 2px;
    border-style: solid;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 244, 235, 0.97) 100%);
    animation: stFreshBadgeGlow 4.5s ease-in-out infinite;
}

.st-story-header .st-thumb-time-badge {
    position: static;
    max-width: none;
    display: inline-block;
}

.st-story-header .st-thumb-time-badge--fresh {
    background: rgba(18, 18, 22, 0.88);
    color: #fff;
}

.st-thumb-specs-box {
    padding: 0.875rem;
    background-color: #fafafa;
    border-top: 1px solid var(--st-border);
    flex: 1;
    min-width: 0;
}

.st-thumb-specs-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

@media (min-width: 768px) {
    .st-thumb-card .st-thumb-specs-box {
        flex: 0 0 auto;
    }

    .st-thumb-specs-box--collapsible:not(.st-thumb-specs-box--fits) {
        position: relative;
        cursor: pointer;
    }

    .st-thumb-specs-box--collapsible:not(.st-thumb-specs-box--expanded):not(.st-thumb-specs-box--fits) {
        max-height: calc(2.35 * var(--st-spec-pill-stack) + 2.35rem);
        overflow: hidden;
        padding-bottom: 0.35rem;
    }

    .st-thumb-specs-box--collapsible:not(.st-thumb-specs-box--expanded):not(.st-thumb-specs-box--fits)::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2.85rem;
        background: linear-gradient(
            to bottom,
            rgba(250, 250, 250, 0) 0%,
            rgba(250, 250, 250, 0.72) 38%,
            #fafafa 72%
        );
        pointer-events: none;
        z-index: 1;
    }

    .st-specs-expand-indicator {
        position: absolute;
        left: 50%;
        bottom: 0.1rem;
        transform: translateX(-50%);
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border: 1px solid var(--st-border);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        color: var(--st-spec-type-color);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        pointer-events: none;
    }

    .st-specs-expand-indicator__chev {
        display: block;
        width: 0.58rem;
        height: 0.58rem;
        margin-top: -0.2rem;
        border-right: 2.5px solid currentColor;
        border-bottom: 2.5px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.2s ease, margin 0.2s ease;
    }

    .st-thumb-specs-box--expanded .st-specs-expand-indicator__chev {
        margin-top: 0.12rem;
        transform: rotate(-135deg);
    }

    .st-thumb-specs-box--expanded::before {
        display: none;
    }

    .st-thumb-specs-box--collapsible:not(.st-thumb-specs-box--fits):focus {
        outline: none;
    }

    .st-thumb-specs-box--collapsible:not(.st-thumb-specs-box--fits):focus-visible {
        outline: 2px solid rgba(21, 105, 175, 0.45);
        outline-offset: 2px;
    }

    .st-thumb-specs-box--fits .st-specs-expand-indicator,
    .st-thumb-specs-box--fits::before {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .st-specs-expand-indicator {
        display: none !important;
    }
}

.st-spec-pill {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.25;
    background: #fff;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--st-border);
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.st-spec-pill--empty {
    justify-content: center;
    align-items: center;
}

.st-spec-pill__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    filter: none;
    margin-top: 0.1rem;
}

.st-spec-pill__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.st-spec-label {
    color: var(--st-spec-type-color);
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.st-spec-name {
    color: #000;
    width: 100%;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-spec-pill--empty .st-spec-name {
    color: var(--st-text-muted);
    font-weight: 500;
}

.st-pagination-box {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2.5rem;
    width: 100%;
}

.st-page-btn {
    background-color: #fff;
    color: var(--st-text-main);
    border: 1px solid var(--st-border);
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: 0.2s;
}

.st-page-btn:hover:not(:disabled) {
    background-color: #fff;
    border-color: var(--st-accent);
    color: var(--st-accent);
}

.st-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.st-page-num {
    font-size: 0.875rem;
    color: var(--st-text-muted);
    font-weight: 600;
}

.st-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--st-text-muted);
}

/* Visor tipo stories (overlay oscuro; la grilla sigue el estilo del sitio) */
.st-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.94);
    z-index: 10550;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
    max-width: 100vw;
}

.st-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.st-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    z-index: 12;
    padding: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.st-modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.st-story-shell {
    position: relative;
    width: 100%;
    max-width: min(520px, calc(100vw - 1.5rem));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3.25rem;
    box-sizing: border-box;
    margin: 0 auto;
}

.st-story-viewport {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    height: min(90dvh, 900px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background-color: #111;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.st-story-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

.st-story-swiper {
    width: 100%;
    height: 100%;
}

.st-story-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    height: 100%;
    box-sizing: border-box;
}

.st-story-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.st-story-nav-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28%;
    z-index: 6;
    cursor: pointer;
}

.st-story-nav-left { left: 0; }
.st-story-nav-right { right: 0; }

.st-story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 1rem 2rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.st-progress-bar-container {
    display: flex;
    gap: 5px;
    width: 100%;
}

.st-progress-track {
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    flex: 1;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.st-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background-color: #fff;
    transition: width 0.05s linear;
}

.st-story-identity {
    display: flex;
    align-items: center;
}

.st-story-footer-pane {
    flex-shrink: 0;
    background-color: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.15rem;
    width: 100%;
    box-sizing: border-box;
    z-index: 9;
    text-align: center;
}

.st-action-btn {
    display: block;
    width: 100%;
    background-color: var(--st-accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

.st-action-btn:hover {
    background-color: var(--st-accent-dark);
    color: #fff;
}

.st-story-shell > .swiper-button-prev,
.st-story-shell > .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    transition: background 0.2s, opacity 0.2s;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    visibility: visible;
}

.st-story-shell > .swiper-button-prev::after,
.st-story-shell > .swiper-button-next::after {
    font-size: 1.1rem;
    font-weight: 700;
}

.st-story-shell > .swiper-button-prev:hover,
.st-story-shell > .swiper-button-next:hover {
    background: rgba(255, 255, 255, 0.22);
}

.st-story-shell > .swiper-button-prev {
    left: 0;
}

.st-story-shell > .swiper-button-next {
    right: 0;
}

.st-story-shell > .swiper-button-prev.swiper-button-disabled,
.st-story-shell > .swiper-button-next.swiper-button-disabled {
    opacity: 0.28;
    pointer-events: none;
    cursor: default;
    transform: translateY(-50%) scale(0.92);
}

@media (max-width: 1160px) {
    .st-story-shell {
        max-width: 100%;
        padding: 0 2.75rem;
    }
}

@media (max-width: 768px) {
    .st-grid {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
        gap: 1rem;
    }

    .st-modal {
        align-items: stretch;
        justify-content: stretch;
    }

    .st-story-shell {
        max-width: none;
        width: 100%;
        height: 100%;
        margin: 0;
    }

    .st-story-viewport {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .st-story-header {
        padding: max(1rem, env(safe-area-inset-top)) 1rem 1.75rem;
    }

    .st-story-footer-pane {
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    }

    .st-modal-close {
        top: max(0.75rem, env(safe-area-inset-top));
        right: 0.75rem;
    }

    .st-story-shell {
        padding: 0;
    }

    .st-story-shell > .swiper-button-prev,
    .st-story-shell > .swiper-button-next {
        display: flex !important;
        visibility: visible !important;
        width: 2.5rem;
        height: 2.5rem;
        z-index: 30;
        background: rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .st-story-shell > .swiper-button-prev.swiper-button-disabled,
    .st-story-shell > .swiper-button-next.swiper-button-disabled {
        opacity: 0.28;
        pointer-events: none;
    }

    .st-story-shell > .swiper-button-prev {
        left: max(0.35rem, env(safe-area-inset-left));
    }

    .st-story-shell > .swiper-button-next {
        right: max(0.35rem, env(safe-area-inset-right));
    }

    .st-story-shell > .swiper-button-prev::after,
    .st-story-shell > .swiper-button-next::after {
        font-size: 0.95rem;
    }

    /* Menos ancho en tap-zones para no tapar las flechas */
    .st-story-nav-overlay {
        width: 22%;
    }
}
