/* Home marketplace redesign (post-search) — keep above-search sections untouched */

.home-section {
  margin-top: 1.35rem;
}

.home-market-shell > #categories {
  margin-top: 1.15rem;
}

/* Categories — 3 × 2 grid, no horizontal scroll */
.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.home-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.7rem 0.4rem 0.65rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-cat-card:hover {
  border-color: rgba(255, 45, 120, 0.28);
  background: rgba(255, 45, 120, 0.05);
}

.home-cat-card:active {
  transform: scale(0.97);
}

.home-cat-card__media {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.home-cat-card__icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.home-cat-card__icon .category-svg {
  width: 1.65rem;
  height: 1.65rem;
}

.home-cat-card__image,
.home-cat-card__media .category-thumb,
.home-cat-card__media .category-thumb--fluid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

.home-cat-card:not(.home-cat-card--icon) .home-cat-card__icon {
  opacity: 0;
}

.home-cat-card__label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--text);
  max-width: 100%;
}

/* Best sellers — 3 visible cards on mobile, native horizontal scroll */
.home-bestsellers-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  padding-bottom: 0.15rem;
}

.home-bestsellers-scroll::-webkit-scrollbar {
  display: none;
}

.home-bestsellers-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 1.3rem) / 3);
  grid-template-columns: none;
  width: max-content;
  max-width: none;
  gap: 0.65rem;
}

.home-bestsellers-track .product-card {
  scroll-snap-align: start;
  min-width: 0;
  height: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease;
}

.home-bestsellers-track .product-card:active {
  transform: scale(0.98);
}

.home-bestsellers-track .product-media {
  aspect-ratio: 1;
  border-radius: 14px 14px 0 0;
}

.home-bestsellers-track .product-card-caption,
.home-bestsellers-track .product-card-body {
  padding: 0.55rem 0.55rem 0.7rem;
}

.home-bestsellers-track .product-card h3 {
  font-size: 0.78rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-bestsellers-track .product-card-package {
  font-size: 0.68rem;
  margin: 0.15rem 0 0;
}

.home-bestsellers-track .product-card-price strong {
  font-size: 0.88rem;
}

.home-bestsellers-track .product-card-delivery {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Last orders */
.home-orders-list {
  display: grid;
  gap: 0.55rem;
}

.home-order-row--premium {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-order-row--premium:hover {
  border-color: rgba(255, 45, 120, 0.22);
  background: rgba(255, 45, 120, 0.05);
}

.home-order-row--premium:active {
  transform: scale(0.985);
}

.home-order-row--premium .home-order-row-leading img,
.home-order-row--premium .account-order-item-media,
.home-order-row--premium .account-order-item-image,
.home-order-row--premium .home-order-row-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.home-order-row--premium .home-order-row-body {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.home-order-row-name {
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-order-row-id {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.home-order-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.home-order-row-status {
  flex-shrink: 0;
  align-self: start;
  padding-top: 0.1rem;
}

.home-order-row-status .profile-status-badge {
  font-size: 0.62rem;
  padding: 0.2rem 0.48rem;
  white-space: nowrap;
}

/* FAQ */
.home-faq-head {
  margin-bottom: 0.85rem;
}

.home-faq-head .faq-title {
  margin: 0;
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  line-height: 1.1;
}

.home-auth-faq-wrap {
  margin-top: 0.5rem;
}

.home-faq .faq-chevron {
  transition: transform 0.2s ease;
}

.home-faq .faq-item.is-open .faq-chevron,
.home-faq .faq-trigger[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

/* Compact footer */
.site-footer--compact .footer-grid--compact {
  gap: 1.5rem;
  padding: 1.75rem 0 1.25rem;
}

.site-footer--compact .footer-brand p {
  max-width: 42ch;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.site-footer--compact .footer-col h2 {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.site-footer--compact .footer-col a {
  font-size: 0.88rem;
  padding: 0.18rem 0;
}

.site-footer--compact .footer-bottom {
  padding: 0.85rem 0 1.15rem;
  font-size: 0.78rem;
}

/* Scroll reveal */
[data-home-reveal] {
  --reveal-i: 0;
}

.home-reveal-ready [data-home-reveal],
.home-reveal-ready .home-cat-card,
.home-reveal-ready .home-bestsellers-track .product-card,
.home-reveal-ready .home-order-row--premium,
.home-reveal-ready .home-faq .faq-item {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.42s ease, transform 0.42s ease;
  transition-delay: calc(var(--reveal-i, 0) * 45ms);
}

.home-reveal-ready [data-home-reveal].is-inview,
.home-reveal-ready [data-home-reveal].is-inview .home-cat-card,
.home-reveal-ready [data-home-reveal].is-inview .home-bestsellers-track .product-card,
.home-reveal-ready [data-home-reveal].is-inview .home-order-row--premium,
.home-reveal-ready [data-home-reveal].is-inview .home-faq .faq-item,
.home-reveal-ready .site-footer--compact.is-inview {
  opacity: 1;
  transform: none;
}

.home-bestsellers-track .product-card:nth-child(1) { --reveal-i: 0; }
.home-bestsellers-track .product-card:nth-child(2) { --reveal-i: 1; }
.home-bestsellers-track .product-card:nth-child(3) { --reveal-i: 2; }
.home-bestsellers-track .product-card:nth-child(4) { --reveal-i: 3; }
.home-bestsellers-track .product-card:nth-child(5) { --reveal-i: 4; }
.home-bestsellers-track .product-card:nth-child(6) { --reveal-i: 5; }
.home-bestsellers-track .product-card:nth-child(7) { --reveal-i: 6; }
.home-bestsellers-track .product-card:nth-child(8) { --reveal-i: 7; }

@media (prefers-reduced-motion: no-preference) {
  .floating-contact-btn::before,
  .floating-contact-btn::after {
    animation-duration: 2.4s;
  }
}

@media (min-width: 768px) {
  .home-cat-grid {
    gap: 0.85rem;
  }

  .home-cat-card {
    padding: 0.9rem 0.55rem 0.8rem;
  }

  .home-cat-card__media {
    width: 3.25rem;
    height: 3.25rem;
  }

  .home-bestsellers-track {
    grid-auto-columns: calc((100% - 2.55rem) / 4);
    gap: 0.85rem;
  }

  .home-order-row--premium {
    padding: 0.85rem 1rem;
  }
}

@media (min-width: 1024px) {
  .home-bestsellers-track {
    grid-auto-columns: calc((100% - 3.4rem) / 5);
  }
}

@media (min-width: 1280px) {
  .home-bestsellers-track {
    grid-auto-columns: calc((100% - 4.25rem) / 6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-cat-card,
  .home-bestsellers-track .product-card,
  .home-order-row--premium {
    transition: none !important;
  }

  .home-cat-card:active,
  .home-bestsellers-track .product-card:active,
  .home-order-row--premium:active {
    transform: none;
  }

  .home-reveal-ready [data-home-reveal],
  .home-reveal-ready .home-cat-card,
  .home-reveal-ready .home-bestsellers-track .product-card,
  .home-reveal-ready .home-order-row--premium,
  .home-reveal-ready .home-faq .faq-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .floating-contact-btn::before,
  .floating-contact-btn::after {
    animation: none !important;
  }
}

html[data-theme="light"] .home-cat-card,
html[data-theme="light"] .home-order-row--premium,
html[data-theme="light"] .home-bestsellers-track .product-card {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
