/*
 * Mobile catalog contract.
 *
 * This file is intentionally loaded after styles.css on catalog.html. It is
 * the single final authority for the mobile product card and protects the
 * commerce surface from the older responsive layers in the shared stylesheet.
 */

@media (max-width: 760px) {
  body.catalog-products-first .catalog-result:not(.catalog-result-skeleton) {
    grid-template-columns: 108px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    min-width: 0;
    contain-intrinsic-size: auto 320px;
  }

  body.catalog-products-first .catalog-card-media,
  body.catalog-products-first .catalog-card-media.is-photo-placeholder {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 138px;
    height: auto;
    padding: 10px 8px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: #fff;
  }

  body.catalog-products-first .catalog-card-media img {
    width: 100%;
    max-width: 94px;
    max-height: 116px;
    object-fit: contain;
  }

  body.catalog-products-first .catalog-card-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 138px;
    align-content: start;
    gap: 7px;
    padding: 12px 12px 11px;
    overflow: visible;
  }

  body.catalog-products-first .catalog-card-category {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
  }

  body.catalog-products-first .catalog-result h3 {
    display: block;
    overflow: visible;
    margin: 0;
    font-size: 14px;
    line-height: 1.24;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
  }

  body.catalog-products-first .catalog-result h3 a {
    display: block;
    color: var(--ink);
  }

  body.catalog-products-first .catalog-card-summary,
  body.catalog-products-first .catalog-card-key,
  body.catalog-products-first .catalog-card-mobile-quick {
    display: none !important;
  }

  body.catalog-products-first .catalog-card-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    gap: 8px;
    min-width: 0;
    padding: 0 10px 10px;
  }

  body.catalog-products-first .catalog-card-actions .catalog-card-price {
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 9px 11px;
  }

  body.catalog-products-first .catalog-card-price strong {
    font-size: clamp(17px, 5vw, 20px);
    line-height: 1.1;
  }

  body.catalog-products-first .catalog-card-price .catalog-stock-status {
    font-size: 10px;
    line-height: 1.2;
  }

  body.catalog-products-first .catalog-cart-button,
  body.catalog-products-first .catalog-icon-action {
    min-height: 44px;
  }

  body.catalog-products-first .catalog-icon-action {
    width: 42px;
  }
}

@media (max-width: 360px) {
  body.catalog-products-first .catalog-result:not(.catalog-result-skeleton) {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  body.catalog-products-first .catalog-card-media,
  body.catalog-products-first .catalog-card-media.is-photo-placeholder {
    min-height: 148px;
    padding-inline: 6px;
  }

  body.catalog-products-first .catalog-card-media img {
    max-width: 84px;
    max-height: 118px;
  }

  body.catalog-products-first .catalog-card-body {
    min-height: 148px;
    padding-inline: 10px;
  }
}
