/* =========================================================
   Aromatic Category page — templates/category.jinja
   Specs from Aromatic Standalone (category screen)
   ========================================================= */

.aro-cat {
  --aro-navy: #1a428a;
  --aro-ink: #2b2f36;
  --aro-sub: #4a5563;
  --aro-muted: #9aa2ae;
  --aro-line: #eceef1;
  --aro-header-bg: #f2f6fb;
  --aro-header-border: #dbe3ee;
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.aro-cat__breadcrumb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aro-cat__header {
  background: var(--aro-header-bg);
  border-bottom: 1px solid var(--aro-header-border);
}

.aro-cat__header.has-cover {
  background: var(--aro-header-bg);
  border-bottom: 1px solid var(--aro-header-border);
}

.aro-cat__cover {
  width: 100%;
  line-height: 0;
}

.aro-cat__cover img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.aro-cat__header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 22px;
}

.aro-cat__title {
  font-family: var(--aro-font);
  font-size: 36px;
  font-weight: 700;
  color: var(--aro-navy);
  margin: 0 0 10px;
  line-height: 1.25;
}

.aro-cat__sub {
  font-size: 14.5px;
  color: var(--aro-sub);
  max-width: 480px;
  margin: 0;
  font-weight: 500;
  line-height: 1.65;
}

/* ---------- Toolbar ---------- */
.aro-cat__toolbar {
  max-width: 1280px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  border-bottom: 1px solid var(--aro-line);
}

.aro-cat__chips {
  display: flex;
  gap: 22px;
  flex-wrap: nowrap;
  align-items: center;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  position: relative;
  top: 3px;
}

.aro-cat__chips.is-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.aro-cat__chips.is-dragging .aro-cat__chip {
  cursor: grabbing;
}

.aro-cat__chips a {
  -webkit-user-drag: none;
}

.aro-cat__chips::-webkit-scrollbar {
  height: 0;
  display: none;
}

.aro-cat__chip {
  border: none;
  background: none;
  color: var(--aro-muted);
  border-radius: 0;
  padding: 0 0 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.aro-cat__chip:hover,
.aro-cat__chip:focus-visible {
  color: var(--aro-navy);
  outline: none;
}

.aro-cat__chip.is-active {
  color: var(--aro-navy);
  font-weight: 700;
  border-bottom-color: var(--aro-navy);
}

.aro-cat__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.aro-cat__action {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #4a4f54;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  box-shadow: none;
}

.aro-cat__action::after {
  display: none !important; /* kill Bootstrap caret */
}

.aro-cat__action b {
  color: var(--aro-navy);
  font-weight: 700;
}

.aro-cat__action:hover,
.aro-cat__action:focus-visible {
  color: var(--aro-navy);
  outline: none;
}

.aro-cat__action-sep {
  width: 1px;
  height: 16px;
  background: #e5e7eb;
  flex-shrink: 0;
}

.aro-cat__sort {
  position: relative;
}

.aro-cat__sort-menu {
  margin-top: 10px !important;
  border: 1px solid var(--aro-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 16px 40px rgba(15, 40, 86, 0.14) !important;
  min-width: 220px;
  padding: 0 !important;
  overflow: hidden;
  right: auto;
  left: 0;
}

.rtl .aro-cat__sort-menu,
html[dir="rtl"] .aro-cat__sort-menu {
  left: 0;
  right: auto;
}

.aro-cat__sort-menu .dropdown-item {
  display: block;
  width: 100%;
  text-align: start;
  background: #fff;
  border: none;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--aro-ink);
  cursor: pointer;
}

.aro-cat__sort-menu .dropdown-item:hover,
.aro-cat__sort-menu .dropdown-item:focus {
  background: #f7f7f5;
  color: var(--aro-ink);
}

/* Hide legacy Soft Theme filter bar / sidebar on category; keep Bootstrap modals */
.aro-cat__filter-engine > *:not(.modal) {
  display: none !important;
}

/* ---------- Grid ---------- */
.aro-cat__grid-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 72px;
  position: relative;
}

@media (min-width: 1280px) {
  .aro-cat__header-inner,
  .aro-cat__toolbar,
  .aro-cat__grid-section {
    padding-left: 0;
    padding-right: 0;
  }
}

.aro-cat__grid.products-list,
.aro-cat__grid.row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 12px;
  row-gap: 48px;
  align-items: start;
  margin: 0 !important;
  width: 100%;
}

.aro-cat__cell.prod-col,
.aro-cat__cell.prod-col-attr,
.aro-cat__cell.prod-col-tb {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0;
  float: none !important;
  flex: none !important;
}

.aro-cat__cell .product-item.aro-pc,
.aro-cat__cell .product-item {
  max-width: none !important;
  width: 100% !important;
}

.aro-cat__empty {
  text-align: center;
  color: var(--aro-muted);
  padding: 48px 16px;
  margin: 0;
}

/* Floating filter — mobile only */
.aro-cat__float-filter {
  display: none;
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--aro-navy);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 13px 26px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 40, 86, 0.28);
  align-items: center;
  gap: 8px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.aro-cat__float-filter:hover,
.aro-cat__float-filter:focus-visible {
  background: #0f2856;
  outline: none;
  color: #fff;
}

.aro-cat__pager {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 48px;
}

.aro-cat__pager .products-pagination .page-link {
  color: var(--aro-navy);
}

.aro-cat__pager .products-pagination .page-link.active {
  background-color: var(--aro-navy);
  border-color: var(--aro-navy);
  color: #fff;
}

.aro-cat__meta {
  padding-bottom: 24px;
}

/* ---------- Mobile ≤760 ---------- */
@media (max-width: 760px) {
  .aro-cat__header-inner {
    padding: 20px 16px 16px;
  }

  .aro-cat__title {
    font-size: 28px;
  }

  .aro-cat__sub {
    color: #6b7078;
    font-size: 13.5px;
    max-width: none;
  }

  .aro-cat__toolbar {
    padding: 14px 16px;
    gap: 10px;
  }

  .aro-cat__actions {
    display: none !important;
  }

  .aro-cat__chips {
    gap: 18px;
    flex: 1 1 auto;
    width: 100%;
  }

  .aro-cat__grid-section {
    padding: 18px 10px 88px;
  }

  .aro-cat__grid.products-list,
  .aro-cat__grid.row {
    grid-template-columns: 1fr 1fr !important;
    column-gap: 10px !important;
    row-gap: 32px !important;
  }

  .aro-cat__float-filter {
    display: inline-flex !important;
  }

  .aro-cat__pager {
    padding: 0 16px 96px;
  }
}

@media (min-width: 761px) and (max-width: 991px) {
  .aro-cat__grid.products-list,
  .aro-cat__grid.row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 40px;
  }
}

/* ---------- All products page extras ---------- */
.aro-cat--products .aro-cat__sub {
  max-width: 520px;
}

.aro-cat__pager--products {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 64px;
}

.aro-cat__load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  padding: 14px 36px;
  border: 1.5px solid var(--aro-navy);
  border-radius: 100px;
  color: var(--aro-navy);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.3;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.aro-cat__load-more[hidden] {
  display: none !important;
}

.aro-cat__load-more[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.aro-cat__load-more:hover,
.aro-cat__load-more:focus-visible {
  background: var(--aro-navy);
  color: #fff;
  outline: none;
  text-decoration: none;
}

/* ---------- Filter drawer (Aromatic Standalone parity) ---------- */
.aro-cat #filterModal.modal {
  padding: 0 !important;
}

body.modal-open .modal-backdrop {
  background-color: rgba(15, 26, 45, 0.5);
}

.aro-cat #filterModal .modal-dialog {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  margin: 0 !important;
  max-width: 560px;
  width: 100%;
  height: 100%;
  transform: none !important;
  pointer-events: auto;
}

/* Closed / opening: slide from the inline-start edge */
.aro-cat #filterModal.fade:not(.show) .modal-dialog,
html[dir="ltr"] .aro-cat #filterModal.fade:not(.show) .modal-dialog {
  transform: translateX(-100%) !important;
}

html[dir="rtl"] .aro-cat #filterModal.fade:not(.show) .modal-dialog,
.rtl .aro-cat #filterModal.fade:not(.show) .modal-dialog {
  transform: translateX(100%) !important;
}

.aro-cat #filterModal.fade .modal-dialog {
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Open: always visible — beat RTL closed rule specificity */
.aro-cat #filterModal.fade.show .modal-dialog,
html[dir="rtl"] .aro-cat #filterModal.fade.show .modal-dialog,
.rtl .aro-cat #filterModal.fade.show .modal-dialog,
html[dir="ltr"] .aro-cat #filterModal.fade.show .modal-dialog {
  transform: none !important;
}

.aro-cat #filterModal .modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #f7f6f3;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
}

html[dir="rtl"] .aro-cat #filterModal .modal-content,
.rtl .aro-cat #filterModal .modal-content {
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
}

.aro-filter-drawer__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 30px;
  background: #f7f6f3;
  border-bottom: 1px solid #e3ddd0;
}

.aro-filter-drawer__title {
  font-family: var(--aro-font);
  font-size: 24px;
  font-weight: 400;
  color: var(--aro-navy);
  line-height: 1.2;
}

.aro-filter-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--aro-ink);
  cursor: pointer;
  padding: 4px;
  opacity: 1;
}

.aro-filter-drawer__close:hover,
.aro-filter-drawer__close:focus-visible {
  color: var(--aro-navy);
  outline: none;
}

.aro-cat #filterModal .modal-body.aro-filter-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.aro-filter-form__section {
  padding: 22px 30px;
  border-bottom: 1px solid #e3ddd0;
}

.aro-filter-form__section-title {
  font-family: var(--aro-font);
  font-size: 19px;
  font-weight: 400;
  color: var(--aro-ink);
  margin: 0 0 18px;
}

.aro-filter-form__price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aro-filter-form__field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #6b7078;
  margin-bottom: 8px;
}

.aro-filter-form__field .form-control {
  height: 46px;
  border: 1px solid #cfc8bb;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  font-size: 14px;
  color: var(--aro-ink);
  padding: 10px 14px;
}

.aro-filter-form__field .form-control:focus {
  border-color: var(--aro-navy);
  box-shadow: 0 0 0 3px rgba(26, 66, 138, 0.12);
}

.aro-filter-form__slider {
  margin-top: 18px;
}

.aro-filter-form__check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  cursor: pointer;
  font-size: 14.5px;
  color: #4a4f54;
  text-align: start;
}

.aro-filter-form__check .custom-checkbox-label {
  font-size: 14.5px;
  color: #4a4f54;
}

.aro-filter-form__actions {
  display: flex;
  gap: 12px;
  padding: 24px 30px;
}

.aro-filter-form__btn {
  flex: 1 1 0;
  border-radius: 100px;
  padding: 14px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.3;
  text-align: center;
}

.aro-filter-form__btn--ghost {
  background: none;
  border: 1px solid #a19b8e;
  color: var(--aro-ink);
}

.aro-filter-form__btn--ghost:hover,
.aro-filter-form__btn--ghost:focus-visible {
  border-color: var(--aro-navy);
  color: var(--aro-navy);
  outline: none;
}

.aro-filter-form__btn--primary {
  background: var(--aro-navy);
  border: none;
  color: #fff;
}

.aro-filter-form__btn--primary:hover,
.aro-filter-form__btn--primary:focus-visible {
  background: #0f2856;
  color: #fff;
  outline: none;
}

@media (max-width: 760px) {
  .aro-cat__pager--products {
    padding: 0 16px 96px;
  }

  .aro-cat__load-more {
    min-width: 0;
    width: 100%;
    max-width: 320px;
    padding: 13px 24px;
    font-size: 13.5px;
  }

  .aro-cat #filterModal .modal-dialog {
    max-width: 100%;
  }

  .aro-filter-drawer__head,
  .aro-filter-form__section,
  .aro-filter-form__actions {
    padding-left: 20px;
    padding-right: 20px;
  }
}
