#cartCount {
  display: inline-block;
}

.headline-line, .headline-line > span { display: block; }
.headline-line { overflow: clip; padding-bottom: .09em; margin-bottom: -.09em; }

@keyframes headline-rise {
  from { transform: translateY(108%) rotate(2deg); }
  to { transform: translateY(0); }
}

@keyframes photo-unveil {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0); }
}

@keyframes confirm-added {
  0%, 100% { opacity: 0; transform: translateY(4px); }
  15%, 85% { opacity: 1; transform: translateY(0); }
}

@keyframes shop-appear {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes shop-hero-photo {
  from { opacity: .65; scale: 1.035; }
  to { opacity: 1; scale: 1; }
}

@keyframes cart-slide-in {
  from { translate: 100% 0; }
  to { translate: 0 0; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .shop-editorial-hero { overflow: hidden; }
  .shop-editorial-photo { animation: shop-hero-photo 850ms ease-out; }
  .shop-editorial-photo { animation-name: shop-hero-photo, photo-unveil; }
  .headline-line > span { animation: headline-rise 660ms cubic-bezier(.2,.75,.2,1) backwards; }
  .headline-line + .headline-line > span { animation-delay: 105ms; }
  .shop-editorial-copy > h1:first-child { animation: none; }

  .shop-nav a { position: relative; }
  .shop-nav a::after {
    content: ''; position: absolute; inset: auto 0 -3px; height: 2px;
    background: currentColor; transform: scaleX(0); transform-origin: left;
    transition: transform 180ms ease-out;
  }
  .shop-nav a:is(:hover, :focus-visible)::after { transform: scaleX(1); }

  [data-add] { position: relative; }
  [data-add].just-added::after {
    content: '✓  Đã thêm'; position: absolute; inset: 0;
    display: grid; place-items: center; border-radius: inherit;
    background: #205746; color: white; pointer-events: none;
    animation: confirm-added 1000ms ease-out both;
  }
  .shop-editorial-copy > * { animation: shop-appear 520ms ease-out backwards; }
  .shop-editorial-copy > :nth-child(2) { animation-delay: 65ms; }
  .shop-editorial-copy > :nth-child(3) { animation-delay: 130ms; }
  .shop-editorial-copy > :nth-child(4) { animation-delay: 195ms; }

  .enter-catalog { animation: shop-appear 370ms ease-out var(--reveal-delay) backwards; }
  #customerPage, #toast, dialog[open]:not(.drawer) { animation: shop-appear 220ms ease-out; }
  #cartDialog[open] { animation: cart-slide-in 320ms cubic-bezier(.2,.8,.2,1); }
  dialog[open]::backdrop { animation: backdrop-in 220ms ease-out; }

  #shop button, .shop-item { transition: transform 180ms ease-out, box-shadow 180ms ease-out; }
  #shop button:active { transform: scale(.97); }

  @media (hover: hover) and (pointer: fine) {
    .shop-item:hover, .shop-category:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 20px rgb(32 61 50 / 12%);
    }
    .shop-photo, .category-photo { transition: scale 320ms ease-out; }
    .shop-item:hover .shop-photo, .shop-category:hover .category-photo { scale: 1.035; }
  }
}
