/* products.html — mobile compact category picker */

@media (max-width: 768px) {
  /* Hero height: 32% of default (prior 40% × 0.8) on products pages only */
  .page-header {
    --products-hero-scale: 0.32;
    --products-hero-inset-y: calc(var(--site-hero-inset-y) * var(--products-hero-scale));
    height: calc(var(--site-hero-min-height-md) * var(--products-hero-scale));
    min-height: calc(var(--site-hero-min-height-md) * var(--products-hero-scale));
    padding-top: calc(var(--site-header-height) + var(--products-hero-inset-y));
    padding-bottom: var(--products-hero-inset-y);
  }

  .page-header .page-header-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    margin-bottom: 0.5rem;
  }

  .page-header .page-header-icon svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .page-header .page-title {
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    margin-bottom: 0.375rem;
  }

  .page-header .page-subtitle {
    font-size: 0.75rem;
    line-height: 1.4;
    max-width: 92%;
  }
}

.products-mobile-category {
  display: none;
  position: relative;
  z-index: 20;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .products-mobile-category {
    display: block;
  }
}

.products-mobile-category__trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.25rem;
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--secondary-700);
  background: var(--white);
  border: 1px solid var(--secondary-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.products-mobile-category__trigger:hover,
.products-mobile-category__trigger[aria-expanded='true'] {
  border-color: var(--primary-300);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.products-mobile-category__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--primary-600);
}

.products-mobile-category__icon svg {
  width: 1rem;
  height: 1rem;
}

.products-mobile-category__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.products-mobile-category__chevron {
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--secondary-400);
  transition: transform 0.2s ease;
}

.products-mobile-category__trigger[aria-expanded='true'] .products-mobile-category__chevron {
  transform: rotate(180deg);
}

.products-mobile-category__menu {
  position: absolute;
  z-index: 200;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(50vh, 18rem);
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--secondary-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.25rem;
}

.products-mobile-category.is-open .products-mobile-category__menu {
  display: block;
}

.products-mobile-category__menu[hidden] {
  display: none !important;
}

.products-mobile-category__option {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.625rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  color: var(--secondary-700);
  transition: background 0.15s ease, color 0.15s ease;
}

.products-mobile-category__option:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.products-mobile-category__option.active {
  background: var(--primary-600);
  color: var(--white);
}

html[dir='rtl'] .products-mobile-category__trigger,
html[dir='rtl'] .products-mobile-category__option {
  text-align: right;
}
