/* Stable touch controls and card heights on the public home page. */
@media (max-width: 760px) {
  /* A touch device can keep :hover stuck after a tap; the button's is-open state owns the menu. */
  .acct:not(.is-open) .acct-menu {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
  }

  .acct:not(.is-open):hover .acct-caret {
    transform: none;
  }

  .acct.is-open .acct-menu {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .cart-peek {
    top: calc(env(safe-area-inset-top, 0px) + var(--nav-h, 70px) + 48px);
    right: 82px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    width: auto;
    max-height: none;
    z-index: 960;
  }

  .cart-peek .cp-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #mobilenav {
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 150px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 150px);
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 950 !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 600px) {
  /* Compact, evenly sized segmented tabs for Catalogue / Nouveautés / Pack. */
  body[data-page="accueil"] #showcaseSection .showcase-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: hidden;
    padding: 4px;
    border-radius: 999px;
    cursor: default;
  }

  body[data-page="accueil"] #showcaseSection .showcase-tab {
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 10px 4px;
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* The rotating product set used to change the height above “Nos partenaires”. */
  body[data-page="accueil"] .showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, 230px);
    gap: 10px;
  }

  body[data-page="accueil"] .showcase-grid > * {
    box-sizing: border-box;
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 230px;
    min-height: 0;
  }

  body[data-page="accueil"] .showcase-grid .product-media {
    flex: 0 0 58%;
    min-height: 0;
    aspect-ratio: auto;
  }

  body[data-page="accueil"] .showcase-grid .product-body {
    min-height: 0;
    padding: 9px 11px 10px;
    gap: 4px;
  }

  body[data-page="accueil"] .showcase-grid .product-body .ref {
    display: none;
  }

  body[data-page="accueil"] .showcase-grid .product-body h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.25;
  }

  body[data-page="accueil"] .showcase-grid .product-body .desc,
  body[data-page="accueil"] .showcase-grid .product-body .stock-line {
    display: none;
  }

  body[data-page="accueil"] .showcase-grid .product-foot {
    gap: 5px;
    margin-top: 2px;
    padding-top: 6px;
  }

  body[data-page="accueil"] .showcase-grid .product-foot .price {
    font-size: 16px;
  }
}
