/* Wejście nowego widoku: animowane są wyłącznie elementy nad pierwszym ekranem. */
@keyframes pageArrival {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.page.page-enter .hero-text,
.page.page-enter .allegro-premium,
.page.page-enter > section > .container > .overlap-grid,
.page.page-enter > section > .container > .section-tag,
.page.page-enter > section > .container > h1,
.page.page-enter > section > .container > h2,
.page.page-enter #productGrid .cat-card-premium:nth-child(-n+4) {
  animation: pageArrival .42s cubic-bezier(.2,.7,.2,1) both;
}
.page.page-enter #productGrid .cat-card-premium:nth-child(2) { animation-delay: .05s; }
.page.page-enter #productGrid .cat-card-premium:nth-child(3) { animation-delay: .1s; }
.page.page-enter #productGrid .cat-card-premium:nth-child(4) { animation-delay: .15s; }
.category-modal-item, .offer-cat-item { font: inherit; }
.category-modal-item:focus-visible, .offer-cat-item:focus-visible, .bottom-nav-mobile .nav-tab:focus-visible { outline: 3px solid #d67b40; outline-offset: 2px; }

@media (max-width: 768px) {
  :root { --mobile-gutter: clamp(16px, 5vw, 24px); }
  html { scroll-padding-top: 72px; }
  body { min-width: 0; background: #f8f4ed; }
  main, .page, .page > section { min-width: 0; }
  .container { width: 100%; max-width: 100%; padding-inline: var(--mobile-gutter) !important; }
  section { padding-block: 48px; }
  .page > section:first-child:not(.hero-section) { padding-top: 88px !important; }
  .page, main { padding-bottom: 0 !important; }
  h1, h2, h3, p { overflow-wrap: anywhere; }
  h2 { font-size: clamp(1.65rem, 7vw, 2.2rem); line-height: 1.15; }
  p { line-height: 1.6; }

  .sticky-header { background: #fffaf2 !important; border-bottom: 1px solid #eadfce; box-shadow: none !important; }
  .sticky-header .nav-container { min-height: 62px !important; padding: 8px var(--mobile-gutter) !important; }
  .sticky-header .logo-img { height: 40px !important; max-height: 40px !important; }
  .sticky-header .logo-text { font-size: 1.08rem; }

  .hero-section { padding: 94px 0 64px !important; min-height: 0 !important; background-position: center; }
  .hero-content-wrapper { padding: 0 !important; gap: 0 !important; }
  .hero-text .hero-h1 { max-width: 32ch; font-size: .72rem; letter-spacing: .12em; line-height: 1.45; }
  .hero-text .hero-tagline { max-width: 10ch; font-size: clamp(3rem, 13vw, 4.6rem); line-height: .98; margin-bottom: 22px; }
  .hero-text p:not(.hero-tagline) { max-width: 58ch; font-size: .98rem; margin-bottom: 24px; }
  .hero-buttons { gap: 10px; }
  .hero-buttons .btn { min-height: 52px; }
  .hero-buttons .btn-outline-white { background: rgba(255,255,255,.09); }
  .hero-visual { display: none !important; }

  .allegro-premium { margin: -30px 0 42px !important; padding: 22px !important; border: 1px solid #eee3d5; box-shadow: 0 8px 24px rgba(48,35,22,.1) !important; }
  .allegro-premium h3 { font-size: 1.28rem !important; }
  .section-tag { font-size: .72rem; letter-spacing: .16em; }
  .overlap-grid { display: block; }
  .overlap-image { height: clamp(200px, 58vw, 310px) !important; border-radius: 20px !important; }
  .overlap-card { width: calc(100% - 20px); margin: -28px auto 0 !important; padding: 24px 20px !important; border-radius: 18px !important; box-shadow: 0 9px 26px rgba(47,32,18,.1) !important; }
  .overlap-card h2, .cat-title { font-size: clamp(1.55rem, 6vw, 2rem) !important; }
  .overlap-card p, #catDesc { font-size: .94rem; line-height: 1.58; }
  #categoryPage .overlap-card .btn { width: 100%; justify-content: center; }
  #categoryPage .overlap-image { height: 220px !important; }
  #categoryPage #productGrid { margin-top: 26px !important; }

  .category-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cat-card-premium { min-width: 0; border: 1px solid #ece2d6; box-shadow: 0 2px 9px rgba(32,26,20,.05) !important; }
  .cat-card-img { height: clamp(105px, 29vw, 150px); }
  .cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
  .cat-card-body { min-width: 0; padding: 13px !important; }
  .cat-card-body h3 { font-size: .95rem !important; }
  .cat-card-body p { font-size: .82rem; }
  #productGrid.category-masonry { grid-template-columns: 1fr !important; gap: 12px !important; }
  #productGrid .cat-card-premium { grid-template-columns: minmax(104px, 32%) minmax(0, 1fr); min-height: 138px; }
  #productGrid .cat-card-img { min-height: 138px; }
  #productGrid .cat-card-body { padding: 14px !important; }
  #productGrid .cat-card-body h3 { font-size: .98rem !important; }
  #productGrid .cat-card-body .product-short-desc { font-size: .8rem; }
  #productGrid .btn-small-allegro { min-height: 42px !important; }
  .cat-card-premium:hover, .gallery-tile:hover, .feature-item:hover { transform: none; }
  .cat-card-premium:hover img, .gallery-tile:hover img, .overlap-grid:hover .overlap-image img { transform: none; }

  .feature-item { border: 1px solid #eee5d9; box-shadow: none !important; }
  .reviews-grid, .poradniki-grid { grid-template-columns: 1fr !important; }
  .review-card, .poradnik-card { box-shadow: 0 2px 10px rgba(32,26,20,.05) !important; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .contact-card, .privacy-content { box-shadow: 0 4px 18px rgba(32,26,20,.06); }
  .contact-card input, .contact-card textarea { max-width: 100%; }
  .wholesale-section .highlight-box { padding: 18px !important; }
  footer { margin: 0 !important; padding: 38px var(--mobile-gutter) calc(96px + env(safe-area-inset-bottom, 0px)) !important; }

  .bottom-nav-mobile { height: calc(66px + env(safe-area-inset-bottom, 0px)) !important; background: #fffaf2 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: 0 -4px 16px rgba(41,27,15,.08) !important; }
  .bottom-nav-mobile .nav-tab { min-width: 0; gap: 3px; color: #655d54; }
  .bottom-nav-mobile .nav-tab span { font-size: .66rem; }
  .bottom-nav-mobile .nav-tab.active { background: #f8ede3; color: #a32925; }
  .bottom-nav-mobile .nav-tab.active i { transform: none; }
  .bottom-nav-indicator { display: none; }
  .grzybekbot-fab { width: 54px !important; height: 54px !important; bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important; right: 12px !important; }
  .grzybekbot-fab .grzybekbot-mascot { width: 44px; height: 44px; animation: none; }
  .cookie-banner { max-height: min(65dvh, 480px); overflow-y: auto; padding: 18px var(--mobile-gutter) calc(82px + env(safe-area-inset-bottom, 0px)) !important; }
  .cookie-banner .cookie-actions { flex-wrap: wrap; }
  .cookie-banner .cookie-btn { flex: 1 1 45%; }

  .offer-expand-panel { max-height: min(78dvh, 680px) !important; overscroll-behavior: contain; box-shadow: 0 -12px 36px rgba(26,18,10,.2) !important; }
  .category-modal, .product-detail-panel { max-height: 91dvh !important; overscroll-behavior: contain; animation-duration: .28s !important; }
  .category-modal-close, .product-detail-close { min-width: 44px !important; min-height: 44px !important; }
  .product-detail-image { min-height: 180px !important; max-height: 220px !important; }
  .grzybekbot-window { height: 100dvh !important; max-height: 100dvh !important; }
  .grzybekbot-messages { overscroll-behavior: contain; }

  /* Małe ekrany nie zyskują na ciężkich filtrach i animacji wielu kart. */
  .page.page-enter #productGrid .cat-card-premium { animation: none; }
  .fade-up.visible .cat-card-premium, .fade-up.visible .feature-item, .fade-up.visible .review-card { animation: none; }
  .cat-card-premium, .gallery-tile, .feature-item { transition-duration: .18s; }
}

@media (max-width: 380px) {
  :root { --mobile-gutter: 14px; }
  .hero-text .hero-tagline { font-size: 2.75rem; }
  .category-masonry { gap: 9px; }
  .cat-card-body { padding: 10px !important; }
  #productGrid .cat-card-premium { grid-template-columns: 96px minmax(0,1fr); }
  #productGrid .cat-card-img { min-height: 128px; }
  .bottom-nav-mobile .nav-tab span { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .page.page-enter *, .page.page-enter *::before, .page.page-enter *::after { animation: none !important; }
}
