/* Compact phone layout for the single-product gallery, identity and purchase form. */
@media (width < 600px) {
  body.single-product .sp-product-purchase { gap: 4px; }

  body.single-product .sp-gallery__viewport,
  body.single-product .sp-gallery__slide {
    block-size: clamp(218px, 69vw, 304px);
    min-block-size: 0;
  }
  body.single-product .sp-gallery__slide img { padding-inline: 12px; }
  body.single-product .sp-gallery__zoom {
    inset-block-end: 6px;
    inset-inline-end: 12px;
    padding: 7px;
  }
  body.single-product .sp-gallery__controls {
    gap: 4px;
    padding-block: 4px 6px;
  }
  body.single-product .sp-gallery__thumbs { gap: 5px; }
  body.single-product .sp-gallery__thumbs button {
    flex-basis: 44px;
    inline-size: 44px;
    min-inline-size: 44px;
    block-size: 44px;
    padding: 3px;
  }

  body.single-product .sp-purchase-panel { padding-block: 6px 8px; }
  body.single-product .sp-purchase-panel > .sp-product-identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 8px;
    padding: 9px 11px;
    margin-block: 0 5px;
  }
  body.single-product .sp-product-identity .sp-product-brand {
    grid-area: 1 / 1;
    justify-self: start;
    min-height: 32px;
    margin: 0;
    padding: 0;
    gap: 5px;
  }
  body.single-product .sp-product-identity .sp-product-brand img {
    inline-size: 22px;
    block-size: 22px;
  }
  body.single-product .sp-product-identity .sp-product-badges {
    grid-area: 1 / 2;
    justify-self: end;
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    align-items: center;
    max-inline-size: min(134px, 38vw);
    margin: 0;
  }
  body.single-product .sp-product-identity .sp-product-label {
    display: block;
    max-inline-size: 100%;
    margin: 0;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.45;
    box-shadow: none;
    overflow-wrap: anywhere;
  }
  body.single-product .sp-product-identity .sp-product-label::before,
  body.single-product .sp-product-identity .sp-product-label::after { content: none; }
  body.single-product .sp-product-identity > :not(.sp-product-brand, .sp-product-badges, .sp-product-updated, .sp-meta) { grid-column: 1 / -1; }
  body.single-product .sp-product-identity > h1 {
    grid-row: 2;
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
  }
  body.single-product .sp-product-identity > .sp-product-subtitle {
    grid-row: 3;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.45;
  }
  body.single-product .sp-product-identity > :is(.sp-meta, .sp-product-updated) {
    margin: 0;
    min-inline-size: 0;
    font-size: 11px;
    line-height: 1.45;
  }
  body.single-product .sp-product-identity > .sp-meta { grid-column: 1; }
  body.single-product .sp-product-identity > .sp-product-updated { grid-column: 2; justify-self: end; }
  body.single-product .sp-product-identity > .sp-meta:last-of-type { align-self: center; }

  body.single-product .sp-purchase-panel .variations { margin-block: 2px 3px; }
  body.single-product .sp-purchase-panel .sp-variations-enhanced td.value { padding-block-end: 4px; }
  body.single-product .sp-purchase-panel :is(.sp-option-title, .sp-swatch-label) {
    margin: 0 0 3px;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: start;
  }
  body.single-product .sp-purchase-panel td.value:has(> .sp-swatches) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label swatches";
    align-items: center;
    gap: 5px 8px;
  }
  body.single-product .sp-purchase-panel td.value:has(> .sp-swatches, > .sp-chipset).sp-mobile-reset-target {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label reset" "swatches swatches";
    display: grid;
    align-items: center;
    gap: 3px 8px;
  }
  body.single-product .sp-purchase-panel td.value:has(> .sp-swatches).sp-mobile-reset-target {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "label swatches reset";
  }
  body.single-product .sp-purchase-panel td.value:has(> .sp-swatches, > .reset_variations) > .sp-option-title {
    grid-area: label;
    margin: 0;
  }
  body.single-product .sp-purchase-panel td.value > .sp-swatches {
    grid-area: swatches;
    justify-content: flex-start;
    gap: 4px;
    min-inline-size: 0;
    margin: 0;
  }
  body.single-product .sp-purchase-panel .sp-swatches > .sp-swatch {
    inline-size: 36px;
    min-inline-size: 36px;
    block-size: 36px;
    min-block-size: 36px;
  }
  body.single-product .sp-purchase-panel .sp-swatch__disc {
    inline-size: 26px;
    block-size: 26px;
  }
  body.single-product .sp-purchase-panel .sp-reset-row--moved { display: none !important; }
  body.single-product .sp-purchase-panel .sp-mobile-reset-target > .reset_variations {
    grid-area: reset;
    position: static;
    display: inline-flex;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    margin: 0;
    padding: 0 7px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--muted, #59677a);
    font-size: 11px;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
  }

  body.single-product .sp-purchase-panel .sp-family--configuration { margin-block: 0 3px; }
  body.single-product .sp-purchase-panel .sp-family-axis { margin-block-start: 5px; }
  body.single-product .sp-purchase-panel .sp-family-axis > legend {
    margin-block-end: 2px;
    font-size: 12.5px;
    line-height: 1.45;
    text-align: start;
  }
  body.single-product .sp-purchase-panel:not(#sp-chip-pattern) :is(.sp-family-axis__options, .sp-chipset.sp-variation-chips) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
  }
  body.single-product .sp-purchase-panel:not(#sp-chip-pattern) :is(.sp-family-axis__options, .sp-chipset.sp-variation-chips) > :is(.sp-family-axis__choice, .sp-chipbtn, details),
  body.single-product .sp-purchase-panel:not(#sp-chip-pattern) .sp-family-axis__options details > summary {
    flex: 0 1 auto;
    inline-size: fit-content;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
  body.single-product .sp-purchase-panel:not(#sp-chip-pattern) :is(.sp-family-axis__options, .sp-chipset.sp-variation-chips) :is(.sp-family-axis__choice, .sp-chipbtn, details > summary) {
    min-height: 40px;
    padding: 3px 8px;
    font-size: 12px;
    line-height: 1.35;
  }
  body.single-product .sp-purchase-panel .sp-family-models { margin-block: 6px 2px; }
  body.single-product .sp-purchase-panel .sp-family-models > summary { min-height: 36px; padding-block: 4px; }
  body.single-product .sp-purchase-panel .sp-chipset.sp-variation-chips { grid-area: swatches; }
  body.single-product .sp-purchase-panel form .sp-purchase-price,
  body.single-product .sp-purchase-panel form .sp-purchase-price.is-variable:has(.price) {
    margin-block: 5px;
    text-align: start;
  }
  body.single-product .sp-purchase-panel .woocommerce-variation.single_variation:empty { margin: 0; }
  body.single-product .sp-purchase-panel :is(.woocommerce-variation-add-to-cart, form.cart:not(.variations_form)) { gap: 6px; }
  body.single-product .sp-purchase-panel fieldset.sp-purchase-options {
    gap: 5px;
    margin-block: 3px 4px;
    padding-block-start: 4px;
  }
  body.single-product .sp-purchase-panel .sp-purchase-options > legend {
    margin-block-end: 1px;
    font-size: 13px;
    line-height: 1.45;
  }
  body.single-product .sp-purchase-panel .sp-purchase-options .sp-choice {
    min-height: 42px;
    padding: 4px 8px;
  }
  body.single-product .sp-purchase-panel .single_add_to_cart_button { min-height: 44px; }
  body.single-product .sp-purchase-panel .sp-buyrow__icons { gap: 6px; }
  body.single-product .sp-purchase-panel .sp-buyrow__icons > :is(button, a) {
    inline-size: 44px;
    min-inline-size: 44px;
    block-size: 44px;
    min-block-size: 44px;
  }
  body.single-product .sp-purchase-panel .sp-delivery-strip { margin-block: 8px 2px; }
  body.single-product .sp-purchase-panel .sp-delivery-strip li {
    gap: 7px;
    padding: 6px 10px;
    line-height: 1.5;
  }
  body.single-product .sp-section-nav {
    margin-block-start: 10px;
    padding-block: 2px;
  }
  body.single-product .sp-mobile-buybar {
    gap: 8px;
    min-height: 55px;
    padding: 5px 12px max(5px, env(safe-area-inset-bottom));
  }
  body.single-product .sp-mobile-buybar > .sp-button { min-height: 44px; }

  @media (width < 360px) {
    body.single-product .sp-product-identity > .sp-product-updated {
      grid-column: 1 / -1;
      justify-self: start;
    }
  }
}
