/* ViewPager Inicio ↔ Deseos + directorio del mall (solo móvil). */

.mdc-pager {
    overflow: hidden;
    width: 100%;
}

.mdc-pager-track {
    display: block;
    width: 100%;
}

.mdc-pager-page[data-page="wish"] {
    display: none;
}

.mdc-dir-overlay {
    display: none;
}

.mdc-filter-chip-wrap {
    display: none;
}

@media (max-width: 767px) {
    .mdc-pager-track {
        display: flex;
        align-items: flex-start;
        width: 200%;
        height: auto;
        transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }

    .mdc-pager.is-dragging .mdc-pager-track {
        transition: none;
    }

    .mdc-pager-page {
        width: 50%;
        flex-shrink: 0;
        min-width: 0;
        min-height: 0;
        height: auto;
        align-self: flex-start;
    }

    .mdc-pager-page[data-page="wish"] {
        display: block;
    }

    /* La página inactiva no suma altura (evita el scroll infinito al filtrar). */
    .mdc-pager:not(.is-dragging):not(.is-wish) .mdc-pager-page[data-page="wish"],
    .mdc-pager:not(.is-dragging).is-wish .mdc-pager-page[data-page="home"] {
        height: 0 !important;
        overflow: hidden;
        visibility: hidden;
        pointer-events: none;
    }

    .mdc-pager-page[data-page="home"] .mdc-wish-only,
    .mdc-pager-page[data-page="wish"] .mdc-home-only {
        display: none;
    }

    .mdc-filter-chip-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        margin: 0 auto 1rem;
        min-height: 2rem;
    }

    .mdc-filter-chip-wrap[hidden] {
        display: none !important;
    }

    .mdc-filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        max-width: 16rem;
        padding: 0.4rem 0.85rem;
        border: 1px solid rgba(255, 104, 0, 0.28);
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        font-size: 12px;
        font-weight: 700;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
        cursor: pointer;
    }

    .mdc-filter-chip i {
        color: #FF6800;
        font-size: 11px;
    }

    .mdc-filter-chip span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mdc-filter-chip-clear {
        width: 1.75rem;
        height: 1.75rem;
        border: 0;
        border-radius: 999px;
        background: #e2e8f0;
        color: #475569;
        font-size: 14px;
        line-height: 1;
        cursor: pointer;
    }

    .mdc-wish-head {
        text-align: center;
        padding: 0.25rem 1.5rem 1.25rem;
    }

    .mdc-wish-head h2 {
        font-size: 1.85rem;
        font-weight: 900;
        letter-spacing: -0.03em;
        color: #0f172a;
        line-height: 1.15;
        margin-bottom: 0.5rem;
    }

    .mdc-wish-head p {
        color: #64748b;
        font-size: 0.875rem;
        font-weight: 500;
    }

    .mdc-dir-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1988;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .mdc-dir-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .mdc-dir {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 10px;
        display: flex;
        flex-direction: column;
        background: #f3f4f6;
        border-radius: 1.25rem 0 0 1.25rem;
        box-shadow: -18px 0 50px rgba(15, 23, 42, 0.2);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        padding-bottom: var(--mdc-tabbar-h, 3.65rem);
    }

    .mdc-dir-overlay.show .mdc-dir {
        transform: translateX(0);
    }

    .mdc-dir-overlay.is-dragging .mdc-dir {
        transition: none;
    }

    .mdc-dir-head {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1.1rem 0.85rem;
        background: rgba(255, 255, 255, 0.92);
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
        backdrop-filter: blur(16px);
    }

    .mdc-dir-back {
        width: 2.35rem;
        height: 2.35rem;
        border: 0;
        border-radius: 999px;
        background: #f1f5f9;
        color: #0f172a;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mdc-dir-head h2 {
        font-size: 1.15rem;
        font-weight: 900;
        letter-spacing: -0.03em;
        color: #0f172a;
        line-height: 1.2;
    }

    .mdc-dir-head p {
        font-size: 11px;
        font-weight: 600;
        color: #94a3b8;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        margin-top: 0.1rem;
    }

    .mdc-dir-scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }

    .mdc-dir-conds.mdc-cond-seg {
        display: grid;
        margin: 0 0 1.1rem;
        max-width: none;
    }

    .mdc-dir-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .mdc-dir-tile {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
        min-height: 7.2rem;
        padding: 1rem 0.95rem 0.9rem;
        border: 1px solid #e8edf3;
        border-radius: 1.25rem;
        background: #fff;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
        animation: mdcDirIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .mdc-dir-tile:nth-child(1) { animation-delay: 0.02s; }
    .mdc-dir-tile:nth-child(2) { animation-delay: 0.05s; }
    .mdc-dir-tile:nth-child(3) { animation-delay: 0.08s; }
    .mdc-dir-tile:nth-child(4) { animation-delay: 0.11s; }
    .mdc-dir-tile:nth-child(5) { animation-delay: 0.14s; }
    .mdc-dir-tile:nth-child(6) { animation-delay: 0.17s; }
    .mdc-dir-tile:nth-child(7) { animation-delay: 0.2s; }
    .mdc-dir-tile:nth-child(8) { animation-delay: 0.23s; }
    .mdc-dir-tile:nth-child(9) { animation-delay: 0.26s; }
    .mdc-dir-tile:nth-child(10) { animation-delay: 0.29s; }
    .mdc-dir-tile:nth-child(11) { animation-delay: 0.32s; }

    .mdc-dir-tile--all {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        min-height: 0;
        padding: 1rem 1.1rem;
    }

    .mdc-dir-tile-ico {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 104, 0, 0.1);
        color: #FF6800;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .mdc-dir-tile-name {
        font-size: 0.95rem;
        font-weight: 800;
        color: #0f172a;
        letter-spacing: -0.02em;
    }

    .mdc-dir-tile-n {
        margin-top: auto;
        font-size: 11px;
        font-weight: 700;
        color: #94a3b8;
    }

    .mdc-dir-tile--all .mdc-dir-tile-n {
        margin-top: 0;
        margin-left: auto;
    }

    .mdc-dir-tile.is-on {
        border-color: #FF6800;
        box-shadow: 0 0 0 1px #FF6800, 0 10px 28px rgba(255, 104, 0, 0.12);
    }

    .mdc-dir-tile.is-on .mdc-dir-tile-ico {
        background: #FF6800;
        color: #fff;
    }

    .mdc-dir-stores {
        margin-top: 1.5rem;
    }

    .mdc-dir-stores h3 {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #94a3b8;
        margin-bottom: 0.75rem;
    }

    .mdc-dir-vitrinas {
        display: flex;
        gap: 0.65rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .mdc-dir-vitrinas::-webkit-scrollbar {
        display: none;
    }

    .mdc-dir-store {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.45rem;
        width: 4.75rem;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        color: #334155;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.25;
        text-align: center;
    }

    .mdc-dir-store-logo {
        width: 3.35rem;
        height: 3.35rem;
        border-radius: 1.1rem;
        background: #fff;
        border: 1px solid #e8edf3;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        color: #FF6800;
        font-size: 0.95rem;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .mdc-dir-store-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mdc-dir-store.is-on .mdc-dir-store-logo {
        border-color: #FF6800;
        box-shadow: 0 0 0 1px #FF6800;
    }

    .mdc-wish-empty {
        text-align: center;
        padding: 3rem 1.5rem;
        color: #64748b;
        font-weight: 600;
    }

    @keyframes mdcDirIn {
        from {
            opacity: 0;
            transform: translateX(18px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}
