/* Mobile storefront. Existing links, buttons and form handlers own all actions. */
@media (max-width: 640px) {
  body .site-main {
    --listing-gap: 4px;
    --listing-price: #c52140;
    --listing-side: 6px;
    --cart-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h3l2.4 11.1a2 2 0 0 0 2 1.6h8.4a2 2 0 0 0 2-1.5L21.4 7H6'/%3E%3Ccircle cx='10' cy='20' r='1.15'/%3E%3Ccircle cx='18' cy='20' r='1.15'/%3E%3C/svg%3E");
  }

  body .site-main :is(.pl-grid, .promo-home-grid45, .home-carousel-page) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px var(--listing-gap);
  }
  body .site-main .home-carousel-track,
  body .site-main .recent24-track {
    column-gap: var(--listing-gap);
    padding-inline: 0;
    margin-inline: 0;
  }
  body .site-main .recent24-track {
    grid-auto-columns: calc((100% - var(--listing-gap)) / 2);
  }
  body .site-main .home-carousel[data-feed-mode="promotions"] .pl-card {
    flex-basis: calc((100% - var(--listing-gap)) / 2);
  }
  body .site-main .home-page :is(.home-product-section, .recent24) {
    margin-inline: -10px;
  }
  body .site-main .catalog-page > .pl-grid {
    margin-inline: -10px;
  }

  body .site-main .pl-card {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-content: start;
    align-items: start;
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    min-height: 0;
    padding: 0 0 7px;
    border: 0;
    border-radius: 13px;
    box-shadow: none;
    background: #fff;
  }
  body .site-main .pl-card > * { grid-column: 1 / -1; min-width: 0; }
  body .site-main .pl-card .pl-link { display: contents; }
  body .site-main .pl-card .pl-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 13px;
  }
  /* The primary product link still owns the photo and the accessible title.
     This hit area covers both text rows, including their margins and right edge. */
  body .site-main :is(.home-carousel-track, .recent24-track) .pl-card > .pl-rail-link {
    grid-area: 2 / 1 / 4 / -1;
    place-self: stretch;
    z-index: 3;
    position: relative;
    touch-action: pan-x pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
  }
  body .site-main :is(.home-carousel-track, .recent24-track).is-price-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }
  body .site-main .pl-card .pl-link:focus-visible::after {
    outline: 2px solid #197b73;
    outline-offset: -2px;
  }
  body .site-main .pl-card .pl-media {
    grid-area: 1 / 1 / 2 / -1;
    z-index: 2;
    height: auto;
    width: 100%;
    aspect-ratio: 3 / 4;
    margin: 0;
    border: 0;
    border-radius: 13px;
    background: #f7f8f8;
  }
  body .site-main .pl-card .pl-media > a {
    display: block;
    width: 100%;
    height: 100%;
  }
  body .site-main .pl-card .card-photo-track { bottom: 0; }
  body .site-main .pl-card .pl-media img, body .pdp-refined #pdpMainImage {
    object-view-box: inset(0 var(--photo-side-inset, 0%));
  }
  body .site-main .pl-card .pl-media img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: contain;
  }
  body .site-main .pl-card .pl-price {
    grid-area: 2 / 1 / 3 / -1;
    align-self: baseline;
    padding-left: var(--listing-side);
    margin: 7px 0 0;
    font-size: clamp(17px, 4.7vw, 21px);
    font-weight: 750;
    line-height: 1.25;
    color: var(--listing-price);
    letter-spacing: -.035em;
  }
  body .site-main .pl-card:has(> .promo-saving45 del) > .pl-price { grid-column-end: 2; }
  body .site-main .pl-card > .promo-saving45 {
    grid-area: 2 / 2 / 3 / 3;
    align-self: baseline;
    display: block;
    margin: 0;
    padding: 0 3px 0 5px;
    line-height: 1.1;
  }
  body .site-main .pl-card > .promo-saving45 del {
    font-size: clamp(11px, 3vw, 14px);
    color: #20252a;
    text-decoration-thickness: 1px;
  }
  body .site-main .pl-card > .promo-saving45 span { display: none; }
  body .site-main .pl-card .pl-title {
    grid-area: 3 / 1 / 4 / -1;
    display: block;
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 3px var(--listing-side) 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.42;
    color: #172b3c;
  }
  body .site-main .pl-card .pl-meta { grid-row: 4; margin: 3px var(--listing-side) 0; }
  body .site-main .pl-card .pl-meta a { position: relative; z-index: 2; }
  body .site-main .pl-card .promo-admin45 {
    justify-self: start;
    position: relative;
    z-index: 2;
    width: auto;
    max-width: calc(100% - 12px);
    margin: 4px var(--listing-side) 0;
    min-height: 30px;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.2;
  }
  body .site-main .pl-card .pl-actions,
  body .site-main .pl-card > .compare-toggle26 {
    grid-area: 1 / 1 / 2 / -1;
    justify-self: end;
    align-self: end;
    position: relative;
    z-index: 6;
    width: auto;
    padding: 0;
    margin: 0 3px 3px 0;
  }
  body .site-main .pl-card .pl-add,
  body .site-main .pl-card .variant-choice20 {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid white;
    border-radius: 14px;
    background: #197b73;
    font-size: 0;
    line-height: 0;
    color: white;
  }
  body .site-main .pl-card .pl-add::before,
  body .site-main .pl-card .variant-choice20::before {
    content: "";
    width: 24px;
    height: 24px;
    background: currentColor;
    mask: var(--cart-mark) center / contain no-repeat;
    -webkit-mask: var(--cart-mark) center / contain no-repeat;
  }
  body .site-main .pl-card .variant-choice20::after {
    content: "…";
    position: absolute;
    right: 1px;
    top: 1px;
    border-radius: 8px;
    padding: 0 2px 3px;
    font: 700 12px/8px sans-serif;
    background: white;
    color: #155e58;
  }
  body .site-main .pl-card .pl-qty { width: auto; border: 2px solid white; border-radius: 13px; }
  body .site-main .pl-card .pl-qty button { flex-basis: 37px; min-width: 37px; width: 37px; }
  body .site-main .pl-card .pl-qty-value { min-width: 25px; padding-inline: 2px; }
  body .site-main .pl-card > .compare-toggle26 {
    align-self: start;
    margin: 42px 0 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    font-size: 0;
    line-height: 0;
  }
  body .site-main .pl-card > .compare-toggle26::before {
    content: "⇄";
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    border: 1px solid #d9e4e1;
    border-radius: 50%;
    background: #fffffff2;
    color: #31564e;
    font: 600 17px/1 sans-serif;
  }
  body .site-main .pl-card > .compare-toggle26[aria-pressed="true"]::before {
    background: #197b73;
    color: #fff;
  }
  body .site-main .pl-card .card-photo-dots {
    left: 4px;
    bottom: 5px;
    transform: none;
    max-width: calc(100% - 55px);
  }
  body .site-main .pl-card:has(.pl-qty:not([hidden])) .card-photo-dots { bottom: 50px; }
  body .site-main .pl-card .promo-badges45 { top: 5px; left: 5px; gap: 3px; right: 43px; }

  /* Bring the gallery up, retaining breadcrumbs, the complete title and all purchase controls. */
  body .site-main:has(> .pdp-refined), body .site-main > .pdp-refined { padding-top: 0; }
  body .pdp-refined > .container { display: flex; flex-direction: column; min-width: 0; padding-top: 5px; }
  body .pdp-refined .product-admin20 { order: 2; }
  body .pdp-refined .product-path20 {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    margin-bottom: 7px;
  }
  body .pdp-refined .pdp-grid { display: contents !important; }
  body .pdp-refined .pdp-gallery {
    order: 0;
    width: calc(100% + 24px);
    margin-inline: -12px;
    gap: 6px;
  }
  body .pdp-refined .pdp-main {
    box-sizing: border-box;
    height: auto !important;
    aspect-ratio: 3 / 4;
    max-height: 720px;
    padding: 0;
    border: 0;
    border-radius: 14px;
  }
  body .pdp-refined #pdpMainImage { padding: 0; }
  body .pdp-refined .pdp-mtop { display: flex !important; top: 8px; right: 8px; gap: 5px; }
  body .pdp-refined .pdp-micon {
    width: 44px;
    height: 44px;
    background: #fffffff0;
    color: #163e3b;
    font-size: 21px;
  }
  body .pdp-refined .pdp-micon[data-share] span { display: none; }
  body .pdp-refined .pdp-micon[data-share]::before {
    content: "";
    width: 22px;
    height: 22px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23163e3b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 10.5 6.8-4m-6.8 7 6.8 4'/%3E%3C/svg%3E");
  }
  body .pdp-refined .pdp-zoom-button {
    left: 8px;
    bottom: 8px;
    transform: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background: #fffffff0;
    font-size: 0;
  }
  body .pdp-refined .pdp-zoom-button::after { content: "⤢"; font: 22px/1 sans-serif; }
  body .pdp-refined .pdp-dots {
    bottom: 9px !important;
    max-width: calc(100% - 116px);
    overflow-x: auto;
  }
  body .pdp-refined .pdp-dots:empty { display: none; }
  body .pdp-refined .pdp-dot { flex-shrink: 0; }
  body .pdp-refined .pdp-heading { order: 1; margin: 12px 0; }
  body .pdp-refined .pdp-title-row { font-size: 21px !important; }
  body .pdp-refined .pdp-buy { order: 2; }
  body .pdp-refined .pdp-info { order: 3; margin-top: 12px; }
  body .pdp-refined .pdp-guides, body .pdp-refined .pdp-reco { order: 4; }
  body .pdp-refined .pdp-price, body .pdp-refined .pdp-mobile-dock strong { color: var(--listing-price); }
  body .pdp-refined .pdp-buy-card { display: flex; flex-wrap: wrap; align-items: baseline; }
  body .pdp-refined .pdp-buy-card > * { order: 3; flex: 0 0 100%; min-width: 0; box-sizing: border-box; }
  body .pdp-refined .pdp-buy-card [data-promo-variant-info] { display: contents; }
  body .pdp-refined .pdp-buy-card [data-promo-variant-info] > .promo-badges45 { order: 0; flex-basis: 100%; }
  body .pdp-refined .pdp-buy-card .pdp-price { flex: 0 1 auto; order: 1; margin-right: 8px; }
  body .pdp-refined .pdp-buy-card [data-promo-variant-info] > .promo-saving45 { order: 2; align-items: baseline; }
  body .pdp-refined .pdp-buy-card .promo-saving45 del { color: #20252a; font-size: 15px; }
}
