/* The hint is decorative; cards remain ordinary keyboard-accessible links. */
.category-carousel-hint { display: none; }

/* Category spacing and view selector, scoped to the mobile category page. */
@media (max-width: 760px) {
  body[data-static-layout].is-category-page {
    padding-top: calc(64px + var(--admin-toolbar-offset, 0px));
  }
  body.is-category-page .group-main > .static-page-intro {
    margin-bottom: 0 !important;
    gap: 12px;
  }
  body.is-category-page .static-page-intro > .group-breadcrumbs {
    margin-bottom: 0 !important;
  }
  body.is-category-page .group-main > .category-view-switch {
    box-sizing: border-box;
    width: min(100%, 320px);
    max-width: 320px;
    margin: 12px auto 0 !important;
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(154, 199, 222, .42);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(231,244,250,.72));
    box-shadow: 0 8px 24px rgba(35,87,115,.08), inset 0 1px 0 rgba(255,255,255,.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  body.is-category-page .category-view-switch:not([hidden])::after,
  body.is-category-page .category-view-switch:not([hidden]) button[data-category-view="grid"]::after {
    content: none;
    animation: none;
  }
  body.is-category-page .category-view-switch:not([hidden]) button[data-category-view] {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #61778a;
    font-size: 13px;
    font-weight: 650;
    animation: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
  }
  body.is-category-page .category-view-switch:not([hidden]) button[data-category-view][aria-pressed="true"] {
    color: #006fae;
    border-color: rgba(131,194,224,.45);
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(220,242,251,.84));
    animation: category-control-soft-pulse 4s ease-in-out infinite;
  }
  body.is-category-page .category-view-switch button:focus-visible {
    outline: 2px solid #0073b9;
    outline-offset: 2px;
  }
  body.is-category-page .group-main > .group-series-strip,
  body.is-category-page .group-main > .category-bestsellers {
    margin-top: 12px !important;
  }
  body.is-category-page .group-main > .category-flow:not(:empty) {
    margin-top: 12px;
  }
  body.is-category-page.category-view-carousel .group-main:has(> .group-series-strip > .category-link-card:nth-child(3):not(.category-skeleton-card)) > .category-carousel-hint {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #66869a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    pointer-events: none;
    position: relative;
    z-index: 3;
    animation: category-hint-glide 2.8s ease-in-out infinite;
  }
  .category-carousel-hint .category-carousel-hint__arrow {
    color: #0878b6;
    font-size: 16px;
    line-height: 1;
  }
  .category-carousel-hint .category-carousel-hint__gesture {
    position: absolute;
    top: calc(100% + 64px);
    left: calc(50% - 32px);
    width: 64px;
    height: 64px;
    fill: rgba(255, 255, 255, .9);
    stroke: #0878b6;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 5px rgba(16, 85, 122, .18));
    pointer-events: none;
    animation: category-swipe-gesture 4.8s ease-in-out 1s infinite;
  }
  html.category-swipe-seen .category-carousel-hint .category-carousel-hint__gesture {
    display: none;
  }
  /* Match the two-column grid cards while keeping horizontal scrolling. */
  body.is-category-page:not(.category-view-grid) .group-series-strip {
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    padding: 0;
    margin-inline: 0;
    grid-auto-columns: calc((100% - 10px) / 2);
    gap: 10px;
    scroll-padding-inline: 0;
  }
  body.group-page.is-category-page:not(.category-view-grid) .category-link-card {
    box-sizing: border-box;
    height: 208px;
    min-height: 208px;
    padding: 12px;
    grid-template-rows: 10px 92px minmax(0, 1fr);
    row-gap: 8px;
    border-radius: 20px;
  }
  body.group-page.group-data-loading.is-category-page .group-series-strip:not([data-server-category-cards]) .category-link-card {
    height: 208px;
    min-height: 208px;
    grid-template-rows: 10px 92px minmax(0, 1fr);
  }
  body.is-category-page:not(.category-view-grid) .category-link-card img,
  body.is-category-page:not(.category-view-grid) .category-skeleton-card__image {
    height: 96px;
  }
  body.is-category-page:not(.category-view-grid) .category-link-card strong {
    width: 100%;
    min-height: 0;
    font-size: 12px;
    line-height: 1.22;
  }
  @keyframes category-control-soft-pulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 2px 8px rgba(0,111,186,.06); }
    50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 13px rgba(0,111,186,.16); }
  }
  @keyframes category-hint-glide {
    0%, 100% { transform: translateX(-12px); }
    50% { transform: translateX(0); }
  }
  @keyframes category-swipe-gesture {
    0%, 12%, 78%, 100% { opacity: 0; transform: translateX(12px); }
    22% { opacity: .75; transform: translateX(12px); }
    55% { opacity: .75; transform: translateX(-24px); }
    68% { opacity: 0; transform: translateX(-24px); }
  }
  @media (prefers-reduced-motion: reduce) {
    body.is-category-page .category-view-switch button[data-category-view] { animation: none !important; transition: none; }
    body.is-category-page .category-carousel-hint { animation: none !important; }
    .category-carousel-hint .category-carousel-hint__gesture { display: none; animation: none; }
  }
}
