/* Shared interaction layer. Load after style.css and category-showcase.css. */
.storefront {
  --ui-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-ring: #c51b2d;
}

.storefront :is(button, a, select) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Keep the category trigger the same size in both header layouts. */
.storefront .header-discovery .category-menu-button {
  box-sizing: border-box;
  flex: none;
  width: 126px;
  min-width: 126px;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  gap: 7px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 5px 13px rgba(181, 22, 43, .13);
  transition: background-color .2s ease, border-color .2s ease,
    box-shadow .24s var(--ui-ease), transform .24s var(--ui-ease);
}
.storefront .header-discovery .category-menu-button svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.storefront .header-discovery .category-menu-button > span {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.storefront .header-discovery .category-menu-button[aria-expanded="true"] {
  background: #a91429;
  border-color: #a91429;
  box-shadow: 0 0 0 4px rgba(197, 27, 45, .13);
}
@media (max-width: 800px) {
  .storefront .header-discovery {
    grid-template-columns: 126px minmax(0, 1fr) 72px;
  }
  .storefront .header-discovery .category-menu-button {
    grid-column: 1;
    width: 126px;
    min-width: 126px;
    font-size: 12px;
    gap: 7px;
  }
}
@media (max-width: 650px) {
  .storefront .header-discovery {
    grid-template-columns: 126px minmax(0, 1fr) 44px;
  }
}
@media (max-width: 360px) {
  .storefront .header-discovery {
    grid-template-columns: 126px minmax(0, 1fr) 44px;
    gap: 7px;
  }
  /* The two preceding stylesheets disagree between 351 and 360 pixels. */
  .storefront .showcase-grid > .showcase-tile,
  .storefront .showcase-grid > .showcase-browse {
    flex-basis: 100%;
    min-height: 88px;
    flex-direction: row;
    align-items: center;
    gap: 11px;
  }
  .storefront .showcase-grid .showcase-label {
    flex: 1;
    justify-content: center;
    width: auto;
    margin: 0;
  }
  .storefront .showcase-grid .showcase-arrow,
  .storefront .showcase-browse-arrow {
    position: static;
    width: 30px;
    height: 30px;
  }
  .storefront .showcase-browse-copy { flex: 1; }
}

/* An interaction should feel immediate without shifting the surrounding layout. */
.storefront :is(.header-tool, .header-cart, .locale-button, .category-all,
  .mega-card, .mega-back, .mega-pagination button, .showcase-back,
  .showcase-browse, .showcase-child-link, .subcategory-chip,
  .product-card-link, .product-favorite, .product-info-box, .product-add,
  .button, .cart-continue, .cart-item-quantity button, .cart-remove,
  .cart-support-link, .support-float, .support-telegram) {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    box-shadow .24s var(--ui-ease), transform .24s var(--ui-ease), opacity .2s ease;
}
.storefront .showcase-grid > .showcase-tile {
  transition: border-color .22s ease, background-color .22s ease,
    box-shadow .26s var(--ui-ease), transform .26s var(--ui-ease);
}
.storefront .product-add.is-added,
.storefront .product-add.is-added:hover:not(:disabled) {
  background: #168652;
  border-color: #168652;
  color: #fff;
  box-shadow: 0 5px 15px rgba(22, 134, 82, .2);
}
.storefront .product-add.is-added svg { display: none; }
.storefront .product-add.is-added::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font: 800 12px/1 var(--font);
}
.storefront :is(.showcase-arrow, .showcase-browse-arrow, .mega-card-arrow,
  .showcase-child-link > svg, .product-favorite svg) {
  transition: transform .22s var(--ui-ease), color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .storefront .header-discovery .category-menu-button:hover {
    box-shadow: 0 8px 19px rgba(181, 22, 43, .19);
    transform: translateY(-1px);
  }
  .storefront .showcase-grid > .showcase-tile:hover,
  .storefront .showcase-grid > .showcase-browse:hover {
    transform: translateY(-3px);
  }
  .storefront .showcase-child-link:hover > svg,
  .storefront .mega-card:hover .mega-card-arrow {
    transform: translateX(3px);
  }
  .storefront .product-favorite:hover svg { transform: scale(1.12); }
  .storefront .product-add:hover:not(:disabled),
  .storefront .button:hover:not(:disabled),
  .storefront .cart-continue:hover:not(:disabled) {
    transform: translateY(-1px);
  }
}

.storefront .header-discovery .category-menu-button:active,
.storefront :is(.header-tool, .header-cart, .locale-button, .category-all,
  .mega-card, .mega-back, .mega-pagination button, .showcase-back,
  .showcase-browse, .showcase-child-link, .subcategory-chip,
  .product-card-link, .product-favorite, .product-info-box, .product-add,
  .button, .cart-continue, .cart-item-quantity button, .cart-remove,
  .cart-support-link, .support-float, .support-telegram):active:not(:disabled),
.storefront .showcase-grid > .showcase-tile:active {
  transform: scale(.975);
  box-shadow: 0 2px 8px rgba(51, 30, 38, .1);
}
.storefront :is(.category-menu-button, .header-tool, .header-cart,
  .locale-button, .category-all, .mega-card, .mega-back,
  .mega-pagination button, .showcase-back, .showcase-browse,
  .showcase-child-link, .subcategory-chip, .product-card-link,
  .product-favorite, .product-info-box, .product-add, .button,
  .cart-continue, .cart-item-quantity button, .cart-remove,
  .cart-support-link, .support-float, .support-telegram):focus-visible,
.storefront .showcase-grid > .showcase-tile:focus-visible {
  outline: 3px solid var(--ui-ring);
  outline-offset: 3px;
}
.storefront .showcase-back:focus-visible { outline-color: #fff; }

/* The support and document headers use a separate markup for the same action. */
.storefront .legal-catalog-button,
.support-page .legal-catalog-button {
  box-sizing: border-box;
  flex: none;
  width: 126px;
  min-width: 126px;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  gap: 7px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 5px 13px rgba(181, 22, 43, .13);
}
.storefront .legal-catalog-button svg,
.support-page .legal-catalog-button svg {
  width: 18px;
  height: 18px;
}
.storefront :is(.legal-catalog-button, .legal-header-tool, .legal-aside a,
  .pd-favorite, .pd-stepper button, .pd-support-telegram, .pd-related-item,
  .favorites-cart-link, .favorite-open, .favorite-remove, .favorite-empty a,
  .orders-hero-link, .orders-lookup-row button, .orders-recent button,
  .orders-primary-link, .orders-refresh, .orders-download, .orders-secondary-link),
.support-page :is(.legal-catalog-button, .legal-header-tool, .telegram-card,
  .support-shortcut, .form-actions button) {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    box-shadow .24s cubic-bezier(.22, 1, .36, 1),
    transform .24s cubic-bezier(.22, 1, .36, 1);
}
.storefront :is(.legal-catalog-button, .legal-header-tool, .pd-favorite,
  .pd-stepper button, .pd-support-telegram, .favorites-cart-link,
  .favorite-open, .favorite-remove, .orders-hero-link,
  .orders-lookup-row button, .orders-recent button, .orders-primary-link,
  .orders-refresh, .orders-download, .orders-secondary-link):active:not(:disabled),
.support-page :is(.legal-catalog-button, .legal-header-tool,
  .telegram-card, .support-shortcut, .form-actions button):active:not(:disabled) {
  transform: scale(.975);
}
.storefront :is(.legal-catalog-button, .legal-header-tool, .pd-favorite,
  .pd-stepper button, .pd-support-telegram, .favorites-cart-link,
  .favorite-open, .favorite-remove, .orders-hero-link,
  .orders-lookup-row button, .orders-recent button, .orders-primary-link,
  .orders-refresh, .orders-download, .orders-secondary-link):focus-visible,
.support-page :is(.legal-catalog-button, .legal-header-tool,
  .telegram-card, .support-shortcut, .form-actions button):focus-visible {
  outline: 3px solid #c51b2d;
  outline-offset: 3px;
}
.storefront #categoryShowcaseChildren:not([hidden]) {
  animation: category-stage-in .32s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes category-stage-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (hover: none) {
  .storefront .product-card:hover { transform: none; }
  .storefront .showcase-grid > .showcase-tile:hover:not(:active) { transform: none; }
  .storefront .showcase-grid > .showcase-browse:hover:not(:active) { transform: none; }
  .storefront .mega-card:hover:not(:active) { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .storefront #categoryShowcaseChildren:not([hidden]) { animation: none !important; }
  .storefront :is(.legal-catalog-button, .legal-header-tool, .legal-aside a,
    .pd-favorite, .pd-stepper button, .pd-support-telegram, .pd-related-item,
    .favorites-cart-link, .favorite-open, .favorite-remove, .favorite-empty a,
    .orders-hero-link, .orders-lookup-row button, .orders-recent button,
    .orders-primary-link, .orders-refresh, .orders-download, .orders-secondary-link),
  .support-page :is(.legal-catalog-button, .legal-header-tool, .telegram-card,
    .support-shortcut, .form-actions button) { transition: none !important; }
  .storefront :is(.legal-catalog-button, .legal-header-tool, .pd-favorite,
    .pd-stepper button, .pd-support-telegram, .favorites-cart-link,
    .favorite-open, .favorite-remove, .orders-hero-link,
    .orders-lookup-row button, .orders-recent button, .orders-primary-link,
    .orders-refresh, .orders-download, .orders-secondary-link):active,
  .support-page :is(.legal-catalog-button, .legal-header-tool,
    .telegram-card, .support-shortcut, .form-actions button):active {
    transform: none !important;
  }
  .storefront .header-discovery .category-menu-button,
  .storefront .showcase-grid > .showcase-tile,
  .storefront :is(.header-tool, .header-cart, .locale-button, .category-all,
    .mega-card, .mega-back, .mega-pagination button, .showcase-back,
    .showcase-browse, .showcase-child-link, .subcategory-chip,
    .product-card-link, .product-favorite, .product-info-box, .product-add,
    .button, .cart-continue, .cart-item-quantity button, .cart-remove,
    .cart-support-link, .support-float, .support-telegram),
  .storefront :is(.showcase-arrow, .showcase-browse-arrow, .mega-card-arrow,
    .showcase-child-link > svg, .product-favorite svg) {
    transition: none !important;
  }
  .storefront .header-discovery .category-menu-button:hover,
  .storefront .header-discovery .category-menu-button:active,
  .storefront .showcase-grid > .showcase-tile:hover,
  .storefront .showcase-grid > .showcase-tile:active,
  .storefront .showcase-grid > .showcase-browse:hover,
  .storefront .mega-card:hover,
  .storefront .mega-card:active,
  .storefront :is(.header-tool, .header-cart, .locale-button, .category-all,
    .mega-back, .mega-pagination button, .showcase-back, .showcase-browse,
    .showcase-child-link, .subcategory-chip, .product-card-link,
    .product-favorite, .product-info-box, .product-add, .button,
    .cart-continue, .cart-item-quantity button, .cart-remove,
    .cart-support-link, .support-float, .support-telegram):active,
  .storefront :is(.showcase-arrow, .showcase-browse-arrow, .mega-card-arrow,
    .showcase-child-link > svg, .product-favorite svg) {
    transform: none !important;
  }
}
