/* Load this layer before the standard catalogue and package styles. */
@layer molisani-solutions-narrow {
  @media (max-width: 390px) and (max-height: 700px) {
    body.solutions-compact #main .category-products > .product-card .card-image {
      height: calc(var(--mol-product-illustration-height) + 12px) !important;
      padding-block: 6px !important;
    }

    body.solutions-compact #main .category-products > .product-card .card-info > :is(h2, h3) {
      font-size: 18px !important;
      line-height: 1.2 !important;
      margin-block-end: 4px !important;
    }

    body.solutions-compact #main .category-products > .product-card .card-info:has(> .mol-pack-choice) > .card-description {
      order: 4 !important;
      margin-block: 8px 0 !important;
    }

    body.solutions-compact #main .category-products .mol-pack-choice:not(:has(> .mol-pack-native-row ~ .mol-pack-native-row ~ .mol-pack-native-row)) {
      grid-template-columns: repeat(var(--solution-pack-columns, 1), minmax(0, 1fr)) !important;
      gap: 4px 6px !important;

      &:has(> .mol-pack-native-row ~ .mol-pack-native-row) {
        --solution-pack-columns: 2;
      }

      & > .mol-pack-native-row ~ .mol-pack-native-row {
        --solution-pack-column: 2;
      }

      & > .mol-pack-native-row > :is(.mol-pack-option, .mol-pack-native-label, .mol-pack-native-price) {
        grid-column: var(--solution-pack-column, 1) !important;
        grid-row: 1 !important;
      }

      & .mol-pack-option {
        min-height: 44px !important;
      }

      & .mol-pack-option[aria-pressed="true"] {
        background: var(--owner-tonal, #dfeaf3) !important;
      }

      & > .mol-pack-native-row > :is(.mol-pack-native-label, .mol-pack-native-price) {
        align-self: center !important;
        padding: 0 8px !important;
        white-space: nowrap !important;
      }

      & .mol-pack-native-label {
        justify-self: start !important;
        font-size: 13px !important;
      }

      & .mol-pack-native-price {
        justify-self: end !important;
        font-size: 15px !important;
      }

      & :is(.mol-card-controls, .mol-pack-unavailable) {
        grid-row: 2 !important;
        margin-block-start: 0 !important;
      }

      & .mol-card-add-error {
        grid-row: 3 !important;
      }
    }
  }

  @media (max-width: 390px) and (max-height: 590px) {
    body.solutions-compact #main > .category-page-heading {
      padding-block: 2px !important;
    }

    body.solutions-compact #main .category-products > .product-card .card-image {
      height: calc(var(--mol-product-illustration-height) + 8px) !important;
      padding-block: 4px !important;
    }

    body.solutions-compact #main .category-products .mol-card-controls > a {
      height: 44px !important;
      min-height: 44px !important;
      padding-block: 8px !important;
    }
  }
}
