/* Mobile-only refinements for the home category and discovery sections. */
.ij-shop-by__toggle,
.ij-monthly-bestsellers__toggle,
.ij-discovery-card__heading-link {
  display: none;
}

.ij-shop-by__card:focus-visible,
.ij-shop-by__toggle:focus-visible,
.ij-discovery a:focus-visible {
  outline: 3px solid var(--ij-green, #198b50);
  outline-offset: 3px;
}

@media (max-width: 767.98px) {
  .ij-shop-by {
    max-width: 100%;
    padding-inline: 0;
  }

  .ij-shop-by__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    padding-inline: 1rem;
    overflow: visible;
    scroll-snap-type: none;
  }

  .ij-shop-by__grid .ij-shop-by__card {
    position: relative;
    min-width: 0 !important;
    min-height: 148px !important;
    aspect-ratio: 1 / 1.03;
    overflow: hidden;
    border: 0;
    scroll-snap-align: none;
  }

  .ij-shop-by__grid .ij-shop-by__card:last-child {
    margin-right: 0;
  }

  .ij-shop-by__card::after {
    background: linear-gradient(180deg, rgba(16, 15, 11, 0.08) 28%, rgba(16, 15, 11, 0.88) 100%);
  }

  .ij-shop-by__card strong {
    max-width: calc(100% - 1.25rem);
    overflow-wrap: anywhere;
  }

  .ij-shop-by[data-collapsible-ready]:not([data-expanded="true"]) .ij-shop-by__card:nth-child(n + 5) {
    display: none;
  }

  .ij-shop-by[data-collapsible-ready] .ij-shop-by__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-width: 44px;
    min-height: 44px;
    margin: 0.85rem 1rem 0;
    padding: 0.7rem 1rem;
    border: 1px solid var(--ij-green, #198b50);
    background: #fff;
    color: #171813;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .ij-shop-by[data-expanded="true"] .ij-shop-by__toggle [aria-hidden="true"] {
    transform: rotate(180deg);
  }

  .ij-discovery__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    padding-inline: 1rem;
    overflow: visible;
    scroll-snap-type: none;
  }

  .ij-discovery-card {
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
    scroll-snap-align: none;
  }

  .ij-discovery-card--products {
    padding: 1rem;
  }

  .ij-discovery-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .ij-discovery-card__heading h3 {
    min-width: 0;
    margin-bottom: 0.7rem;
    overflow-wrap: anywhere;
  }

  .ij-discovery-card__heading-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    margin-top: -0.55rem;
    color: var(--ij-green, #198b50);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .ij-discovery-card--products .ij-discovery-card__link {
    display: none;
  }

  .ij-discovery-card__products {
    gap: 0.65rem;
  }

  .ij-discovery-product {
    min-width: 0;
  }

  .ij-discovery-product__image {
    height: clamp(54px, 16vw, 66px);
    background: #fff;
  }

  .ij-discovery-product__name {
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
  }

  .page-content--home .module-products .product-miniature__form .quantity-button__group,
  .page-content--home .module-products .product-miniature__form .quantity-button__group > .btn,
  .page-content--home .module-products .product-miniature__add {
    min-height: 44px;
  }

  .ij-monthly-bestsellers[data-collapsible-ready]:not([data-expanded="true"]) .ij-monthly-bestsellers__item:nth-child(n + 5) {
    display: none;
  }

  .ij-monthly-bestsellers[data-collapsible-ready] .ij-monthly-bestsellers__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-width: 44px;
    min-height: 44px;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--ij-green, #198b50);
    background: #fff;
    color: #171813;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .ij-monthly-bestsellers[data-expanded="true"] .ij-monthly-bestsellers__toggle [aria-hidden="true"] {
    transform: rotate(180deg);
  }
}

@media (max-width: 359.98px) {
  .ij-shop-by__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding-inline: 0.75rem;
  }

  .ij-shop-by__grid .ij-shop-by__card {
    min-height: 136px !important;
    aspect-ratio: 1 / 1.03;
  }

  .ij-shop-by__card strong {
    max-width: calc(100% - 0.9rem);
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .layout-full-width .page-content--home .module-products .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
    row-gap: 1.5rem;
  }

  .page-content--home .module-products .product-miniature__bottom {
    padding-inline: 0.25rem;
  }

  .page-content--home .module-products .product-miniature__title {
    overflow-wrap: anywhere;
    font-size: 0.84rem;
    line-height: 1.3;
  }

  .page-content--home .module-products .product-miniature__form {
    gap: 0.25rem;
  }

  .page-content--home .module-products .product-miniature__add {
    flex-basis: 2.5rem;
    width: 2.5rem;
    min-width: 2.5rem;
  }

  .page-content--home .module-products .product-miniature__form .quantity-button input {
    padding-inline: 0;
  }

  .ij-story__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-inline: 1rem;
  }

  .ij-story__visual {
    max-width: 220px;
  }

  .ij-story__content {
    min-width: 0;
  }

  .ij-story h2 {
    overflow-wrap: anywhere;
    font-size: clamp(2rem, 11vw, 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ij-shop-by__toggle *,
  .ij-monthly-bestsellers__toggle * {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
