/* Use Font Awesome only for generic marketplace controls. Fixonic branding,
   theme artwork and product-specific icons remain untouched. The Save, Share
   and More controls are populated by fixonic-fontawesome-controls.js, so do
   not also draw the same icons with CSS pseudo-elements. */
.app-route-detail .app-listing-actions > a:first-child::before {
    display: inline-block;
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    line-height: 1;
}

.app-route-detail .app-listing-actions > a:first-child { font-size: 0 !important; }
.app-route-detail .app-listing-actions > a:first-child::before { content: "\f060"; font-size: 20px; font-weight: 900; }
.app-route-detail .app-listing-actions [data-share-listing] svg,
.app-route-detail .app-listing-actions [data-watch-button] svg,
.app-listing-card .watch-button svg { display: none !important; }
.app-card-menu { font-size: 0 !important; }

@media (max-width: 767px) {
    .app-route-detail .app-listing-actions.mobile-only {
        position: relative !important;
        inset: auto !important;
        z-index: 12 !important;
        display: flex !important;
        width: min(100% - 28px, 760px) !important;
        min-height: 52px !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin: 10px auto 12px !important;
        padding: 0 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    .app-route-detail .app-listing-actions > div {
        position: static !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        min-width: 0 !important;
    }
    .app-route-detail .app-listing-actions > a,
    .app-route-detail .app-listing-actions button,
    .app-route-detail .app-listing-actions .fx-theme-toggle {
        position: relative !important;
        inset: auto !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
    }

    /* Phone cards keep the primary Save control only. The overflow menu is a
       desktop affordance; hiding the wrapper also prevents an empty 38px hitbox. */
    .app-listing-card .app-card-actions {
        display: none !important;
    }
}

/* Listing cards: Save stays top-right. More remains directly underneath on
   desktop/tablet layouts where the overflow menu is intentionally available. */
.app-listing-card {
    position: relative !important;
    isolation: isolate !important;
}
.app-listing-card .listing-card-media {
    position: relative !important;
    isolation: isolate !important;
}
.app-listing-card .watch-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 20 !important;
    display: inline-flex !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(127,145,170,.32) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--fx-panel, #fff) 92%, transparent) !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.12) !important;
    backdrop-filter: blur(8px);
}

.app-listing-card .listing-card-title-row {
    position: relative !important;
    display: block !important;
    min-width: 0 !important;
}
.app-listing-card .listing-card-title-row h3,
.app-listing-card .listing-card-title-row h3 a {
    min-width: 0 !important;
    max-width: 100% !important;
    padding-right: 0 !important;
}

.app-listing-card .app-card-actions {
    position: absolute !important;
    top: 52px !important;
    right: 8px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 21 !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    pointer-events: auto !important;
}
.app-listing-card .app-card-menu {
    position: relative !important;
    inset: auto !important;
    z-index: 22 !important;
    display: inline-flex !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--fx-text, #191919) !important;
    border: 1px solid rgba(127,145,170,.32) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--fx-panel, #fff) 92%, transparent) !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.12) !important;
    backdrop-filter: blur(8px);
}
.app-listing-card .app-card-menu:hover,
.app-listing-card .app-card-menu[aria-expanded="true"] {
    background: var(--fx-panel-2, #f1f4f8) !important;
}
.app-listing-card .app-card-popover {
    top: 44px !important;
    right: 0 !important;
    z-index: 80 !important;
}
.app-listing-card.has-open-card-menu { z-index: 70 !important; }

html[data-theme="dark"] body .app-listing-card .watch-button,
html[data-theme="dark"] body .app-listing-card .app-card-menu {
    color: var(--fx-text, #f5f8fc) !important;
    border-color: rgba(161,183,214,.28) !important;
    background: rgba(16,22,32,.9) !important;
}

@media (max-width: 430px) {
    .app-listing-card .watch-button,
    .app-listing-card .app-card-menu {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }
}
