/* Main menu (home page) styles */

body.page-main-menu {
  overflow-x: clip;
  min-height: 100dvh;
}

.page-main-menu > header {
  flex-shrink: 0;
}

.page-main-menu > .site-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Below 1720px: header hides on scroll down; filters scroll normally */
@media (max-width: 1719px) {
  html {
    --shop-header-height: 5.5rem;
  }

  body.page-main-menu {
    padding-top: calc(var(--shop-header-height) + 10px);
  }

  .page-main-menu > header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    margin-bottom: 0;
    transform: translate3d(0, 0, 0);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    backface-visibility: hidden;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .page-main-menu > header.is-scroll-hidden {
    transform: translate3d(0, -100%, 0);
    pointer-events: none;
  }
}

.shop-content-zone {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
}

.shop-content-zone::after {
  content: "";
  display: table;
  clear: both;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

main h1,
main h1,
main h2 {
  font-size: 28px;
  margin: 8px 0 24px;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Home header without home-link column */
.page-main-menu .container-header-main {
  grid-template-areas: "logo Search Account";
  grid-template-columns: auto 1fr auto;
  gap: 24px;
}

.page-main-menu .header-account {
  gap: 12px;
  flex-wrap: nowrap;
  min-height: 44px;
}

/* Shop filter panel */
.shop-filters-nav {
  max-width: 1240px;
  margin: 0 auto 28px;
  padding: 0 24px;
}

.shop-filters-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr minmax(200px, 240px);
  gap: 0;
  padding: 18px 21px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.filter-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.filter-section--price {
  padding-right: 28px;
  border-right: 1px solid var(--border);
}

.filter-section--price .filter-section-title {
  margin-bottom: 11px;
}

.filter-section--categories {
  padding-left: 28px;
  padding-right: 28px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.filter-section--custom {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-custom-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
}

.filter-custom-cta {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-top: 3px;
}

/* Mobile filter toggle — panel always visible on tablet+ and desktop */
.shop-filters-mobile-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-hover);
  cursor: pointer;
  text-align: left;
}

.shop-filters-mobile-toggle::after {
  content: "Show";
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.shop-filters-mobile-toggle[aria-expanded="true"]::after {
  content: "Hide";
}

/* Wide screens: sticky header + filters beside product grid */
@media (min-width: 1720px) {
  .shop-filters-panel {
    display: flex !important;
  }

  body.page-main-menu {
    --shop-filter-gap: 12px;
    --shop-sticky-top: calc(
      var(--shop-header-height, 4.5rem) + var(--shop-filter-gap)
    );
    padding-top: 0;
  }

  .page-main-menu > header {
    position: sticky;
    top: 0;
    z-index: 200;
    margin-bottom: 0;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .page-main-menu > header.is-scroll-hidden {
    transform: none;
    pointer-events: auto;
  }

  .shop-content-zone {
    margin-top: var(--shop-filter-gap);
    max-width: 1240px;
  }

  .shop-content-zone .shop-filters-nav {
    position: sticky;
    top: var(--shop-sticky-top);
    width: 240px;
    max-width: 240px;
    margin: 0 0 28px;
    margin-left: calc(-1 * (240px + 24px));
    padding: 0;
    height: 0;
    overflow: visible;
    z-index: 150;
    background: transparent;
    box-sizing: border-box;
  }

  .shop-content-zone .shop-filters-panel {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    width: 240px;
    box-sizing: border-box;
    padding: 12px 11px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .shop-content-zone .filter-section-title {
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .shop-content-zone .filter-section--price {
    padding-right: 0;
    padding-bottom: 11px;
    margin-bottom: 11px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .shop-content-zone .filter-section--price .filter-section-title {
    margin-bottom: 8px;
  }

  .shop-content-zone .filter-section--price .slider-track-container {
    margin: 9px 0 8px;
  }

  .shop-content-zone .filter-section--categories {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 11px;
    margin-bottom: 11px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .shop-content-zone .filter-section-header {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 6px;
    margin-bottom: 8px;
  }

  .shop-content-zone .filter-section-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .shop-content-zone .filter-section--custom {
    padding-left: 0;
    gap: 6px;
    min-width: 0;
  }

  .shop-content-zone .filter-custom-text {
    font-size: 12px;
    line-height: 1.4;
  }

  .shop-content-zone .filter-custom-cta {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
  }

  .shop-content-zone .category-chip-row {
    gap: 6px;
  }

  .shop-content-zone .category-chip {
    padding: 5px 11px;
    font-size: 12px;
    max-width: 100%;
  }

  .shop-content-zone .price-filter-container {
    min-width: 0;
  }

  .shop-content-zone .price-labels {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-size: 12px;
  }

  .shop-content-zone .price-label-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .shop-content-zone .price-input-wrap {
    flex: 1;
    min-width: 0;
    max-width: 10rem;
  }

  .shop-content-zone .price-manual-input {
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }

  .shop-content-zone .filter-selection-count {
    font-size: 11px;
    padding: 3px 8px;
  }

  .shop-content-zone .category-clear-btn {
    font-size: 11px;
  }

  .shop-content-zone main {
    position: relative;
    z-index: 0;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 60px;
    box-sizing: border-box;
  }

  .shop-content-zone main h1,
  .shop-content-zone main h2 {
    margin-top: 0;
  }
}

@media (max-width: 900px) {
  .shop-filters-panel {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .filter-section--price {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
  }

  .filter-section--categories {
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    padding-top: 0;
  }

  .filter-section--custom {
    padding-left: 0;
    padding-top: 0;
  }
}

@media (min-width: 901px) {
  .shop-filters-mobile-toggle {
    display: none !important;
  }

  .shop-filters-panel,
  .shop-filters-panel.is-mobile-open {
    display: grid !important;
  }
}

@media (max-width: 900px) {
  .shop-filters-mobile-toggle {
    display: flex;
  }

  .shop-filters-panel {
    display: none !important;
  }

  .shop-filters-panel.is-mobile-open {
    display: grid !important;
  }
}

@media (max-width: 768px) {
  html {
    --shop-header-height: 11.5rem;
  }

  .shop-filters-nav {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  .shop-filters-mobile-toggle {
    display: flex;
  }

  main {
    padding: 0 16px 48px;
  }

  main h1,
  main h2 {
    font-size: 22px;
    margin: 4px 0 16px;
  }

  .page-main-menu .container-header-main {
    grid-template-areas:
      "logo Account"
      "Search Search";
    grid-template-columns: auto minmax(0, 1fr);
  }

  .price-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
  }

  .price-label-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
  }

  .price-input-wrap {
    padding: 5px 8px;
  }

  .price-manual-input {
    width: 56px;
    font-size: 12px;
  }

  .filter-section--custom {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .filter-section--custom .filter-section-title {
    flex: 1 1 100%;
    margin-bottom: 0;
  }

  .filter-custom-text {
    flex: 1 1 160px;
    font-size: 12px;
    margin: 0;
  }

  .filter-custom-cta {
    flex-shrink: 0;
    margin-top: 0;
    padding: 8px 12px;
    font-size: 12px;
  }

  .shop-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .product-card p {
    padding: 0 10px;
  }

  .product-card .title {
    font-size: 13px;
    min-height: 36px;
    line-height: 1.35;
  }

  .product-card .price {
    font-size: 14px;
  }

  .category-chip {
    padding: 6px 11px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .filter-custom-text {
    display: none;
  }

  .filter-section--custom {
    justify-content: space-between;
  }

  .filter-section--custom .filter-section-title {
    flex: 1 1 auto;
    margin-bottom: 0;
  }

  .filter-custom-cta {
    width: auto;
  }
}

.filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 11px;
}

.filter-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.filter-section-header .filter-section-title {
  margin-right: 0;
}

.filter-selection-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
}

.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.category-chip-row.is-loading {
  align-items: center;
}

.category-loading-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-mute);
}

.category-chip-row.is-empty {
  align-items: center;
}

.category-empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.category-chip {
  border: 1px solid var(--border);
  background: var(--bg, #fff);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent);
}

.category-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-clear-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
}

.category-clear-btn:hover {
  color: var(--danger);
}

nav {
  max-width: none;
  margin: 0;
  padding: 0;
}

.shop-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px 24px;
  padding: 8px 0 40px;
  min-height: 360px;
}

.shop-catalog--loading {
  min-height: 360px;
}

.shop-catalog--fetching {
  opacity: 0.72;
  pointer-events: none;
}

.shop-catalog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  color: var(--text-dim);
}

.shop-catalog-empty--error {
  color: var(--danger);
}

.product-card--skeleton {
  min-height: 318px;
  border-color: var(--border);
  background: linear-gradient(90deg, var(--soft-bg) 0%, #f6f8f5 45%, var(--soft-bg) 90%);
  background-size: 200% 100%;
  animation: shop-skeleton-shimmer 1.35s ease-in-out infinite;
  pointer-events: none;
}

.product-card--skeleton::after {
  content: "";
  display: block;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.35);
}

@keyframes shop-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Product cards */
.product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product-card a {
  display: block;
  line-height: 0;
  background: var(--soft-bg);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: block;
  border-radius: 0;
  margin: 0;
  object-fit: cover;
  background: var(--soft-bg);
  transition: transform 0.4s ease;
}

.product-card:hover img {
  transform: scale(1.04);
}

.product-card p {
  margin: 0;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.45;
}

.product-card .title {
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  margin-top: 14px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.product-card .price {
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 16px;
  margin-top: 4px;
}

/* Price range slider */
.price-filter-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 3px 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.slider-track-container {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 14px 0 11px;
}

.slider-track {
  position: absolute;
  height: 100%;
  background: var(--text);
  border-radius: 4px;
  z-index: 1;
}

.price-range-input {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 100%;
  height: 22px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
  margin: 0;
  padding: 0;
  outline: none;
  border: none;
}

.price-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 2px solid var(--text);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

.price-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.price-range-input::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

.price-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 2px solid var(--text);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

.price-range-input::-moz-range-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.price-range-input::-moz-range-thumb:active {
  transform: scale(0.95);
}

.price-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

.price-label-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: text;
}

.price-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg, #fff);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.price-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.price-currency {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

.price-manual-input {
  width: 64px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 0;
  margin: 0;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.price-manual-input::-webkit-outer-spin-button,
.price-manual-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Mobile product grid — must come after base .shop-catalog */
@media (max-width: 768px) {
  .shop-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px 12px;
  }
}
