/*
 * WEBDEV-2664 - Parts listing photo viewer: dark stage, Part / Vehicle photo sets, filmstrip, part bar.
 *
 * Loaded after listing-toolbar.css on /parts and /parts-condensed and after part-detail.css on the part detail
 * page, inside the APS-only Blade gates, so the six microsite templates keep the stock lightbox2 frame.
 * lightbox2 2.11.3 (cdnjs) still owns #lightbox and #lightboxOverlay; parts-photo-viewer.js appends one div.pv
 * inside #lightbox and moves .lb-outerContainer into the stage row of that grid. This file
 *   - repaints lightbox2's own nodes: full-viewport overlay and #lightbox at z 68 / 69 (under the toast at 70
 *     and every modal, over the toolbar at 58), the 600 x 505 rules in part-listing.css / part-detail.css
 *     (kept there for the microsite templates) beaten with #lightbox specificity plus !important, round pinned
 *     arrows in place of the 34% / 64% hover strips, a dim loader, the load guard's "Image not available";
 *   - lays out the chrome: top bar, stage, phone kind row, filmstrip (thumbs centred when they fit the strip),
 *     white part bar and the row clones in it;
 *   - phone portrait (under 768px wide), phone landscape (under 500px tall, written after the portrait block so it
 *     wins when both apply), wide screens (1440px and up: a centred 1280px panel over the frosted page) and reduced
 *     motion.
 *
 * Rules for lightbox2's nodes:
 *   - lightbox2 writes inline top / left on #lightbox, width / height on the overlay, an animated width / height
 *     on .lb-outerContainer and width / height on .lb-image, and the load guard writes inline sizes too, so every
 *     geometry rule on those nodes is !important;
 *   - display and opacity are never set here on #lightbox, .lightboxOverlay, .lb-image or .lb-loader: fadeIn /
 *     fadeOut / hide drive them inline and a stylesheet rule would break open or close. The only pins are the
 *     arrows (display: block, opacity: 1 - lightbox2 hides them on every change and shows them after the load),
 *     .lb-nav (display: block), .lb-cancel (display: block, hidden inline by the load guard), .lb-dataContainer
 *     (display: none) and the loader's opacity under reduced motion;
 *   - .lb-outerContainer and .lb-container are position: static so the absolute arrows, the loader and the load
 *     guard's message resolve against .pv__stage (position: relative) and the arrows sit in the 84px stage gutter,
 *     not over the photo.
 * Colours, sizes, radii, shadows and the chevrons come from docs/deploy/WEBDEV-2664/mockups/photo-viewer.html.
 */

/* ------------------------------------------------------------------ */
/* lightbox2 roots                                                     */
/* ------------------------------------------------------------------ */
#lightboxOverlay.lightboxOverlay {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: auto !important;
    z-index: 68 !important;
    background-color: rgba(8, 12, 16, .95) !important;
}

/* The overlay's stock opacity (.8) is the value fadeIn animates to and may not be changed here, so below 1440px the
   backdrop density comes from #lightbox itself (the wide block moves it to the panel); it fills the viewport and
   fades in with the overlay. */
#lightbox.lightbox {
    --pv-ink: #1a2433;
    --pv-muted: #687481;
    --pv-teal: #004d4f;
    --pv-teal-ink: #145b60;
    --pv-mint: #4de0ba;
    --pv-font-display: "Wix Madefor Display", "Segoe UI", Roboto, Arial, sans-serif;
    --pv-font-body: "Roboto", "Segoe UI", Arial, sans-serif;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: auto !important;
    z-index: 69 !important;
    overflow: hidden;
    background: rgba(8, 12, 16, .95);
    color: #fff;
    text-align: left;
    line-height: 1.4;
    font-weight: normal;
    outline: none;
}

/* The header wrap is fixed z-70 on these routes (sticky on phones) and would paint over the viewer. */
body.aps-photo-viewer-open .aps-main-header-wrap {
    visibility: hidden !important;
}

/* ------------------------------------------------------------------ */
/* Stage chain: stage row -> .lb-outerContainer -> .lb-container -> img */
/* ------------------------------------------------------------------ */
#lightbox .lb-outerContainer,
#lightbox .lb-container {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

/* lightbox.css's clearfix would become a flex item. */
#lightbox .lb-outerContainer::after {
    content: none;
}

#lightbox .lb-image {
    width: auto !important;
    height: auto !important;
    max-width: min(75vw, 100%) !important;
    max-height: min(75vh, 100%) !important;
    margin: 0 !important;
    object-fit: contain;
    border: 0 !important;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    background: transparent;
    cursor: zoom-in;
}

#lightbox.is-zoom .lb-image {
    max-width: 100% !important;
    max-height: 100% !important;
    cursor: zoom-out;
}

/* ------------------------------------------------------------------ */
/* Arrows: lightbox2's own .lb-prev / .lb-next, pinned to the stage    */
/* ------------------------------------------------------------------ */
#lightbox .lb-nav {
    display: block !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    flex: none;
    overflow: visible;
    pointer-events: none !important;
}

#lightbox .lb-nav a.lb-prev,
#lightbox .lb-nav a.lb-next {
    display: block !important;
    opacity: 1 !important;
    visibility: visible;
    pointer-events: auto !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%);
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    z-index: 4;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    cursor: pointer;
    outline: none;
    filter: none;
    transition: background-color .15s;
}

#lightbox .lb-nav a.lb-prev {
    left: 20px !important;
    right: auto !important;
}

#lightbox .lb-nav a.lb-next {
    right: 20px !important;
    left: auto !important;
}

#lightbox .lb-nav a.lb-prev:hover,
#lightbox .lb-nav a.lb-next:hover,
#lightbox .lb-nav a.lb-prev:focus-visible,
#lightbox .lb-nav a.lb-next:focus-visible {
    background: rgba(255, 255, 255, .22) !important;
}

#lightbox .lb-nav a.lb-prev::before,
#lightbox .lb-nav a.lb-next::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    margin: 14px auto 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
}

#lightbox .lb-nav a.lb-prev::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
}

#lightbox .lb-nav a.lb-next::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}

/* One photo: nothing to step to (lightbox2 would have hidden its arrows too). */
#lightbox.pv-single .lb-nav a.lb-prev,
#lightbox.pv-single .lb-nav a.lb-next {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ------------------------------------------------------------------ */
/* Loader: the dim placeholder while a photo loads                     */
/* ------------------------------------------------------------------ */
#lightbox .lb-loader {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: min(60%, 520px) !important;
    height: min(60%, 360px) !important;
    transform: translate(-50%, -50%);
    z-index: 1;
    border-radius: 10px;
    background: #1b2227;
    line-height: 0;
    pointer-events: none !important;
}

#lightbox .lb-loader .lb-cancel {
    /* The load guard's showUnavailable() hides .lb-cancel inline and nothing re-shows it; lightbox2 never sets
       display on this node, so the pin is safe. */
    display: block !important;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px !important;
    height: 32px !important;
    margin: -16px 0 0 -16px !important;
    box-sizing: border-box;
    background: none !important;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: var(--pv-mint);
    border-radius: 50%;
    animation: pv-spin .8s linear infinite;
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

/* The load guard's message (part-listing.js), light text on the dark stage on all three pages: a centred box the
   size of the loader placeholder it replaces (the guard hides .lb-loader), so a click on it does not close the
   viewer while the dark stage around it still does. The longhands beat part-listing.css's inset: 0. */
#lightbox .aps-lightbox-unavailable {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(60%, 520px);
    height: min(60%, 360px);
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 1rem 1.25rem;
    box-sizing: border-box;
    border-radius: 10px;
    text-align: center;
    font: 600 15px/1.4 var(--pv-font-body);
    color: #e3e9ec;
    background: #1b2227;
    cursor: default;
}

/* Caption, counter and the old close button: never shown (the chrome replaces them). */
#lightbox .lb-dataContainer {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Chrome                                                              */
/* ------------------------------------------------------------------ */
#lightbox .pv {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr) auto auto;
    grid-template-columns: minmax(0, 1fr);
    line-height: 1.4;
    text-align: left;
    font-weight: inherit;
    font-family: var(--pv-font-body);
    color: #fff;
    overscroll-behavior: contain;
    -webkit-font-smoothing: antialiased;
}

#lightbox .pv *,
#lightbox .pv *::before,
#lightbox .pv *::after {
    box-sizing: border-box;
}

/* The compiled Tailwind build emits .hidden before the display utilities (WEBDEV-2640): the chrome toggles the
   hidden attribute and pins it, and the fitment tooltip clones in the bar keep working. */
#lightbox .pv [hidden],
#lightbox .pv__bar .hidden {
    display: none !important;
}

#lightbox .pv__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

#lightbox .pv button,
#lightbox .pv a {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

#lightbox .pv button:focus-visible,
#lightbox .pv a:focus-visible,
#lightbox .lb-nav a:focus-visible {
    outline: 2px solid var(--pv-mint);
    outline-offset: 2px;
}

#lightbox .pv__bar button:focus-visible,
#lightbox .pv__bar a:focus-visible {
    outline-color: var(--pv-teal);
}

/* ---- Top bar ---- */
#lightbox .pv__top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-width: 0;
    background: rgba(0, 0, 0, .35);
}

/* The three children are pinned to their columns: when the set buttons are hidden (no kind split), .pv__topright
   must stay in column 3 instead of being auto-placed into the empty centre track. */
#lightbox .pv__topleft {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#lightbox .pv__count {
    font: 800 13px/1 var(--pv-font-display);
    letter-spacing: .3px;
    color: #cfd8dc;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#lightbox .pv__kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font: 800 11px/1 var(--pv-font-display);
    letter-spacing: .2px;
    text-transform: uppercase;
    background: rgba(77, 224, 186, .18);
    color: var(--pv-mint);
    white-space: nowrap;
}

#lightbox .pv__kind.is-vehicle {
    background: rgba(255, 255, 255, .12);
    color: #e3e9ec;
}

#lightbox .pv__kind i {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: currentColor;
    font-style: normal;
}

#lightbox .pv__tabs {
    grid-column: 2;
    display: inline-flex;
    justify-self: center;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
}

#lightbox .pv__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #cfd8dc;
    font: 800 12px/1 var(--pv-font-display);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#lightbox .pv__tab-n {
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
}

#lightbox .pv__tab[aria-pressed="true"] {
    background: #fff;
    color: var(--pv-teal);
}

#lightbox .pv__tab[aria-pressed="true"] .pv__tab-n {
    background: var(--pv-teal);
    color: #fff;
}

#lightbox .pv__tab[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

#lightbox .pv__topright {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
}

#lightbox .pv__ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: transparent;
    color: #fff;
    font: 700 12px/1 var(--pv-font-display);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color .15s;
}

#lightbox .pv__ghost:hover,
#lightbox .pv__ghost:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    text-decoration: none;
}

#lightbox .pv__ghost svg {
    width: 13px;
    height: 13px;
    flex: none;
}

#lightbox .pv__close {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    margin: 0 0 0 4px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color .15s;
}

#lightbox .pv__close:hover {
    background: rgba(255, 255, 255, .2);
}

#lightbox .pv__close svg {
    width: 14px;
    height: 14px;
}

/* ---- Stage wrapper (the grid's minmax(0, 1fr) row) ---- */
#lightbox .pv__stage {
    position: relative;
    min-height: 0;
    min-width: 0;
    padding: 0 84px;
    touch-action: none;
}

/* The note and the swipe hint take their own clicks (no pointer-events: none): a click that fell through to the
   container underneath would read as a backdrop click and close the viewer. */
#lightbox .pv__empty {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    max-width: calc(100% - 24px);
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(8, 12, 16, .78);
    color: #fff;
    font: 700 12px/1 var(--pv-font-display);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#lightbox .pv__empty svg {
    width: 13px;
    height: 13px;
    flex: none;
}

#lightbox .pv__empty-short {
    display: none;
}

#lightbox .pv__swipe {
    display: none;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(8, 12, 16, .6);
    color: #9fb0b8;
    font: 800 10px/1 var(--pv-font-display);
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---- Phone kind row (hidden on desktop) ---- */
#lightbox .pv__kindrow {
    display: none;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 0;
}

#lightbox .pv__arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#lightbox .pv__arrow svg {
    width: 18px;
    height: 18px;
}

#lightbox .pv__kindrow .pv__kind {
    justify-self: center;
}

#lightbox.pv-single .pv__arrow {
    visibility: hidden;
}

/* ---- Filmstrip ---- */
#lightbox .pv__film {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

#lightbox .pv__film::-webkit-scrollbar {
    display: none;
}

/* Auto margins on the first and last thumb centre the strip while the thumbs fit and compute to 0 once they
   overflow, so a long strip still starts at the left and scrolls (centreThumb() in the script scrolls the current
   thumb into view). The pseudo-class outranks .pv__thumb's margin: 0. */
#lightbox .pv__film > :first-child {
    margin-left: auto;
}

#lightbox .pv__film > :last-child {
    margin-right: auto;
}

#lightbox .pv__thumb {
    flex: none;
    width: 60px;
    height: 44px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid transparent;
    background: #1b2227;
    opacity: .62;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: opacity .15s;
}

#lightbox .pv__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#lightbox .pv__thumb:hover {
    opacity: .9;
}

#lightbox .pv__thumb[aria-current="true"] {
    border-color: var(--pv-mint);
    opacity: 1;
}

#lightbox .pv__divider {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: none;
    gap: 8px;
    padding: 0 6px;
    color: #9fb0b8;
    font: 800 10px/1 var(--pv-font-display);
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
}

#lightbox .pv__divider::before {
    content: "";
    width: 1px;
    height: 34px;
    background: rgba(255, 255, 255, .22);
}

/* ---- Part bar ---- */
#lightbox .pv__bar {
    /* Positioned (z-index auto) so it paints after .pv__stage in tree order and the photo's shadow never crosses its
       top edge. */
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "text price actions"
        "pills price actions";
    align-items: center;
    column-gap: 18px;
    row-gap: 0;
    min-width: 0;
    /* 7 + 8 of padding, the 1px border and the 74px two-button column (36 + 6 + 32) make the 90px bar budget
       of SPEC Correction 6 / AC8, which leaves the 600px stage a 4:3 photo needs at 1280 x 800. */
    padding: 7px 20px 8px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    color: var(--pv-ink);
    touch-action: pan-y;
}

#lightbox .pv__text {
    grid-area: text;
    align-self: end;
    min-width: 0;
}

#lightbox .pv__bar .pv__title {
    margin: 0;
    padding: 0;
    font: 900 17px/1.15 var(--pv-font-display);
    color: var(--pv-teal);
    overflow-wrap: anywhere;
}

#lightbox .pv__yard {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-top: 2px;
    font: 400 11.5px/1.4 var(--pv-font-body);
    color: var(--pv-muted);
}

#lightbox .pv__yard .fa-map-marker-alt {
    font-size: 11px;
    color: #9aa7ad;
}

/* listing-ui-redesign.css sets the row's separator dot to 28px with !important; the clone takes the yard line's size. */
#lightbox .pv__yard .part-card-place__dot {
    display: inline;
    font-size: inherit !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
    margin: 0 2px;
    color: #9aa7ad;
}

#lightbox .pv__yard .part-card-place__distance {
    color: #09998d;
    font-weight: 800;
}

#lightbox .pv__yard a {
    color: inherit;
}

#lightbox .pv__pills {
    grid-area: pills;
    align-self: start;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

#lightbox .pv__pills:empty {
    display: none;
}

#lightbox .pv__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    margin: 0;
    padding: 0 9px;
    border-radius: 12px;
    border: 1px solid #dfe4e8;
    background: #f3f6f8;
    font: 400 12px/22px var(--pv-font-body);
    color: #7a858e;
    white-space: nowrap;
}

#lightbox .pv__pill .part-card-tag__label {
    color: #7a858e;
    font-weight: 400;
}

#lightbox .pv__pill .part-card-tag__value,
#lightbox .pv__pill b {
    color: var(--pv-ink);
    font-weight: 800;
}

#lightbox .pv__price {
    grid-area: price;
    text-align: right;
    white-space: nowrap;
}

#lightbox .pv__price:empty {
    display: none;
}

#lightbox .pv__price-label {
    font: 800 10.5px/1.3 var(--pv-font-display);
    letter-spacing: .2px;
    text-transform: uppercase;
    color: var(--pv-muted);
}

#lightbox .pv__price-label-short,
#lightbox .pv__narrow {
    display: none;
}

#lightbox .pv__price-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
}

#lightbox .pv__amt {
    font: 900 24px/1.1 var(--pv-font-display);
    color: var(--pv-teal);
}

#lightbox .pv__was {
    font: 800 13px/1.1 var(--pv-font-display);
    color: var(--pv-teal);
    opacity: .7;
    text-decoration: line-through;
}

#lightbox .pv__sub {
    font: 400 11.5px/1.4 var(--pv-font-body);
    color: var(--pv-muted);
}

#lightbox .pv__sub b {
    color: #185c60;
    font-weight: 800;
}

#lightbox .pv__actions {
    grid-area: actions;
    display: grid;
    gap: 6px;
    min-width: 170px;
}

#lightbox .pv__actions:empty {
    display: none;
}

#lightbox .pv__action {
    position: relative;
    display: inline-flex;
    width: 100%;
    cursor: default;
}

/* The row's tooltip is a 224px box centred on its button (w-56, left-1/2, -translate-x-1/2; Tailwind v4 compiles the
   last to the translate property). On the bar's 170px column it overhangs the viewport, which #lightbox clips, so it
   spans its holder and wraps instead. */
#lightbox .pv__action .js-fitment-tooltip {
    left: 0;
    right: 0;
    width: auto;
    transform: none;
    translate: none;
}

/* The clones keep the row's Tailwind utilities; the rules below win on #lightbox specificity, and the two
   grey classes the row toggles are restated so the mirrored state still shows. */
#lightbox .pv__actions .pv__btn {
    display: block;
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--pv-mint);
    background: var(--pv-mint);
    color: #07585a;
    font: 900 13.5px/1 var(--pv-font-display);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    opacity: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: filter .15s;
}

#lightbox .pv__actions .pv__btn:hover {
    background: var(--pv-mint);
    color: #07585a;
    filter: brightness(.96);
}

#lightbox .pv__actions .pv__btn--buy,
#lightbox .pv__actions .pv__btn--buy:hover {
    height: 32px;
    border-color: var(--pv-teal-ink);
    background: var(--pv-teal-ink);
    color: #fff;
    font-size: 12.5px;
}

#lightbox .pv__actions .pv__btn.opacity-50,
#lightbox .pv__actions .pv__btn[disabled] {
    opacity: .5;
    filter: none;
}

#lightbox .pv__actions .pv__btn.cursor-not-allowed,
#lightbox .pv__actions .pv__btn[disabled] {
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Phone portrait: viewport under 768px wide                           */
/* ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
    #lightbox .pv {
        grid-template-rows: 48px minmax(0, 1fr) auto auto auto;
    }

    #lightbox .pv__top {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 0 8px 0 12px;
    }

    /* The live chip stays in the DOM, clip-hidden, so changes are still announced; the kind row shows a copy. */
    #lightbox .pv__topleft .pv__kind {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    #lightbox .pv__tab {
        height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }

    #lightbox .pv__ghost {
        display: none;
    }

    #lightbox .pv__close {
        width: 44px;
        height: 44px;
        margin-left: 0;
    }

    #lightbox .pv__stage {
        padding: 4px 0;
    }

    #lightbox .lb-image,
    #lightbox.is-zoom .lb-image {
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        box-shadow: none;
        cursor: default;
    }

    #lightbox .lb-nav a.lb-prev,
    #lightbox .lb-nav a.lb-next {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    #lightbox .pv__kindrow {
        display: grid;
    }

    #lightbox .pv__swipe {
        display: inline-block;
    }

    #lightbox .pv__empty-full {
        display: none;
    }

    #lightbox .pv__empty-short {
        display: inline;
    }

    #lightbox .pv__film {
        padding: 8px 12px;
    }

    #lightbox .pv__thumb {
        width: 52px;
        height: 40px;
    }

    #lightbox .pv__bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "text price"
            "pills pills"
            "actions actions";
        align-items: start;
        gap: 2px 10px;
        padding: 10px 12px 12px;
    }

    #lightbox .pv__text {
        align-self: auto;
    }

    #lightbox .pv__bar .pv__title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 14px;
    }

    #lightbox .pv__yard {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* /parts wraps the pin and the yard text in a Tailwind inline-flex span; text-overflow hides an atomic inline
       whole, so the clone's wrapper is made plain inline and the ellipsis truncates the text itself. */
    #lightbox .pv__yard > span {
        display: inline;
    }

    #lightbox .pv__yard .fa-map-marker-alt {
        margin-right: 4px;
    }

    #lightbox .pv__pills {
        gap: 4px;
        margin-top: 4px;
    }

    #lightbox .pv__pill {
        height: 22px;
        padding: 0 7px;
        font-size: 11px;
        line-height: 20px;
    }

    #lightbox .pv__price {
        align-self: start;
    }

    #lightbox .pv__amt {
        font-size: 20px;
    }

    #lightbox .pv__price-label-full,
    #lightbox .pv__wide,
    #lightbox .pv__sub-date {
        display: none;
    }

    #lightbox .pv__price-label-short,
    #lightbox .pv__narrow {
        display: inline;
    }

    #lightbox .pv__actions {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
        margin-top: 8px;
    }

    #lightbox .pv__actions.pv__actions--one {
        grid-template-columns: 1fr;
    }

    #lightbox .pv__actions .pv__btn,
    #lightbox .pv__actions .pv__btn--buy,
    #lightbox .pv__actions .pv__btn--buy:hover {
        height: 40px;
    }
}

/* ------------------------------------------------------------------ */
/* Phone landscape: viewport under 500px tall, any width (wins over    */
/* the portrait block above when both apply)                           */
/* ------------------------------------------------------------------ */
@media (max-height: 499.98px) {
    #lightbox .pv {
        grid-template-rows: 44px minmax(0, 1fr) auto;
    }

    #lightbox .pv__top {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 0 8px 0 12px;
    }

    #lightbox .pv__topleft .pv__kind {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    #lightbox .pv__tab {
        height: 26px;
        padding: 0 10px;
        font-size: 11px;
    }

    #lightbox .pv__ghost {
        display: none;
    }

    #lightbox .pv__close {
        width: 40px;
        height: 40px;
        margin-left: 0;
    }

    #lightbox .pv__stage {
        padding: 0 56px;
    }

    #lightbox .lb-image,
    #lightbox.is-zoom .lb-image {
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 6px;
        box-shadow: none;
        cursor: default;
    }

    #lightbox .lb-nav a.lb-prev,
    #lightbox .lb-nav a.lb-next {
        visibility: visible !important;
        pointer-events: auto !important;
        width: 40px !important;
        height: 40px !important;
    }

    #lightbox .lb-nav a.lb-prev::before,
    #lightbox .lb-nav a.lb-next::before {
        margin-top: 10px;
    }

    #lightbox .lb-nav a.lb-prev {
        left: 8px !important;
    }

    #lightbox .lb-nav a.lb-next {
        right: 8px !important;
    }

    #lightbox.pv-single .lb-nav a.lb-prev,
    #lightbox.pv-single .lb-nav a.lb-next {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    #lightbox .pv__kindrow,
    #lightbox .pv__film,
    #lightbox .pv__swipe,
    #lightbox .pv__pills {
        display: none;
    }

    #lightbox .pv__empty {
        top: 6px;
        height: 24px;
        font-size: 11px;
    }

    #lightbox .pv__empty-full {
        display: none;
    }

    #lightbox .pv__empty-short {
        display: inline;
    }

    #lightbox .pv__bar {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "text price actions";
        align-items: center;
        gap: 12px;
        padding: 6px 12px;
    }

    #lightbox .pv__text {
        align-self: center;
    }

    /* The phone block's align-self: start would otherwise carry into the one-line bar when both queries match. */
    #lightbox .pv__price {
        align-self: center;
    }

    #lightbox .pv__bar .pv__title {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 13px;
    }

    #lightbox .pv__yard {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        margin-top: 0;
        font-size: 11px;
    }

    /* /parts wraps the pin and the yard text in a Tailwind inline-flex span; text-overflow hides an atomic inline
       whole, so the clone's wrapper is made plain inline and the ellipsis truncates the text itself. */
    #lightbox .pv__yard > span {
        display: inline;
    }

    #lightbox .pv__yard .fa-map-marker-alt {
        margin-right: 4px;
    }

    #lightbox .pv__price-label,
    #lightbox .pv__sub {
        display: none;
    }

    #lightbox .pv__amt {
        font-size: 18px;
    }

    #lightbox .pv__actions {
        grid-template-columns: auto auto;
        min-width: 0;
        margin-top: 0;
    }

    #lightbox .pv__actions.pv__actions--one {
        grid-template-columns: auto;
    }

    #lightbox .pv__actions .pv__btn,
    #lightbox .pv__actions .pv__btn--buy,
    #lightbox .pv__actions .pv__btn--buy:hover {
        height: 34px;
        padding: 0 14px;
        font-size: 12.5px;
    }
}

/* ------------------------------------------------------------------ */
/* Wide screens: viewport 1440px and up                               */
/* ------------------------------------------------------------------ */
/* The full-width stage left too much dark space either side of the photo on a screen about 1900px wide, so from
   1440px the chrome is a centred 1280px panel, full height, and the page shows frosted and dimmed through the
   strips either side. A click on a strip lands on #lightbox itself, which lightbox2's own click handler closes
   (LB 145-149); the viewer's own click listeners only act inside the panel. */
@media (min-width: 1440px) {
    /* The base rule's left / right 0 plus a width and auto margins centre the box; top / bottom 0 keep it full
       height. */
    #lightbox .pv {
        width: min(100%, 1280px);
        margin: 0 auto;
        background: rgba(8, 12, 16, .95);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 80px rgba(0, 0, 0, .6);
    }

    /* #lightbox stays the full-viewport fixed element (the strips are its own area, so their clicks hit it);
       transparent here so the page blurs through either side of the panel. */
    #lightbox.lightbox {
        background: transparent;
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    /* lightbox2 fades the overlay to its stock .8 opacity, so .7 here leaves the strips about 56% dark and the
       blurred results recognisable; the base rule is !important at the same specificity, so this one is too. */
    #lightboxOverlay.lightboxOverlay {
        background-color: rgba(8, 12, 16, .7) !important;
    }

    /* The fixed z-70 header wrap shows as part of the frosted page under the overlay (68) instead of leaving a
       blank band at the top of the strips; 67 keeps it above the page's own sticky chrome, as 70 does today. The
       photo needs no new cap: the stage's 84px gutters make the base min(75vw, 100%) resolve to 1112px here. */
    body.aps-photo-viewer-open .aps-main-header-wrap {
        visibility: visible !important;
        z-index: 67 !important;
    }
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    /* lightbox2 fades the loader in over a hardcoded 600ms; pinning opacity stops the animation. */
    #lightbox .lb-loader {
        opacity: 1 !important;
    }

    #lightbox .lb-loader .lb-cancel {
        animation: none;
    }

    #lightbox .lb-nav a.lb-prev,
    #lightbox .lb-nav a.lb-next,
    #lightbox .pv__ghost,
    #lightbox .pv__close,
    #lightbox .pv__thumb,
    #lightbox .pv__actions .pv__btn {
        transition: none;
    }

    #lightbox .pv__film {
        scroll-behavior: auto;
    }
}
