/* SINH TỰ ĐỘNG bởi lanora/scope-css.py từ "giao_dien_hoan_chinh/css/category.css" — đừng sửa tay, sửa file gốc rồi chạy lại. */
/* =========================================================
   DANH MỤC SẢN PHẨM – Figma 292:3102
   ========================================================= */

/* ---------- Main ---------- */
:where(.lanora) .catalog {
  position: relative;
  min-height: 1580px;
  padding: 56px 80px 66px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--white);
}
:where(.lanora) .catalog__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
:where(.lanora) .catalog__bg-sticky {
  position: sticky;
  top: 0;
  width: 1440px;
  height: 810px;
  opacity: 0.3;
}
:where(.lanora) .catalog__bg-sticky img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:where(.lanora) .catalog__bg-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(231.08deg, rgba(255, 255, 255, 0.1) 0%, rgba(144, 106, 64, 0.1) 65.617%);
}

/* Bộ lọc (Figma Category-Menu 294:7490) */
:where(.lanora) .filter {
  position: relative;
  flex: none;
  width: 307px;
  --stroke: var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}
:where(.lanora) .filter__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 24px 16px;
  background: linear-gradient(to right, #f4ebe5, #fff);
}
:where(.lanora) .filter__title {
  flex: 1 0 0;
  min-width: 1px;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--secondary-02);
}
:where(.lanora) .filter__clear {
  font-size: 14px;
  line-height: 20px;
  text-decoration: underline;
  text-underline-position: from-font;
  white-space: nowrap;
  color: var(--text-primary);
}
:where(.lanora) .filter__clear:hover {
  color: var(--primary-01);
}
:where(.lanora) .filter__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}
:where(.lanora) .filter__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:where(.lanora) .filter__group:first-child {
  gap: 16px;
}
:where(.lanora) .filter__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  text-align: left;
  color: var(--text-primary);
}
:where(.lanora) .filter__toggle img {
  width: 20px;
  height: 20px;
  transition: transform 0.25s;
}
:where(.lanora) .filter__group.is-collapsed .filter__toggle img {
  transform: rotate(180deg);
}
:where(.lanora) .filter__group.is-collapsed .filter__options {
  display: none;
}
:where(.lanora) .filter__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:where(.lanora) .filter__line {
  display: block;
  width: 100%;
  height: 1px;
  margin-bottom: -1px;
}
:where(.lanora) .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  cursor: pointer;
}
:where(.lanora) .check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
:where(.lanora) .check__box {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--white);
  transition: background 0.2s, border-color 0.2s;
}
:where(.lanora) .check:hover .check__box {
  border-color: var(--primary-02);
}
:where(.lanora) .check input:checked + .check__box {
  border-color: var(--primary-02);
  background: var(--primary-02);
}
:where(.lanora) .check input:checked + .check__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
:where(.lanora) .check input:focus-visible + .check__box {
  outline: 2px solid var(--primary-03);
  outline-offset: 1px;
}

/* Danh sách sản phẩm */
:where(.lanora) .catalog__content {
  position: relative;
  flex: none;
  width: 949px;
  padding-left: 24px;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}
:where(.lanora) .catalog__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
:where(.lanora) .catalog__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
:where(.lanora) .catalog__count {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  white-space: nowrap;
}
:where(.lanora) .catalog__sort {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
:where(.lanora) .select {
  position: relative;
}
:where(.lanora) .select select {
  appearance: none;
  -webkit-appearance: none;
  width: 152px;
  height: 44px;
  padding: 0 40px 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  cursor: pointer;
  outline: 0;
}
:where(.lanora) .select select:focus-visible {
  border-color: var(--primary-02);
}
:where(.lanora) .select img {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  pointer-events: none;
}
:where(.lanora) .catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, 292px);
  grid-auto-rows: 418px;
  gap: 24px;
  width: 924px;
}
:where(.lanora) .catalog__empty {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
  color: var(--text-secondary);
}

/* Phân trang (Figma 370:4013) */
:where(.lanora) .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
}
:where(.lanora) .pagination button,
:where(.lanora) .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: url("../assets/images/page-default.svg") center / 40px 40px no-repeat;
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  color: #4a5163;
  transition: color 0.2s;
}
:where(.lanora) .pagination button:hover {
  color: var(--primary-02);
}
:where(.lanora) .pagination button.is-active {
  background-image: url("../assets/images/page-active.svg");
  color: var(--white);
}
:where(.lanora) .pagination > :first-child {
  border-radius: 8px 0 0 8px;
}
:where(.lanora) .pagination > :last-child {
  border-radius: 0 8px 8px 0;
}
:where(.lanora) .catalog {
  scroll-margin-top: 72px;
}

/* Phần tử chỉ có ở bản mobile */
:where(.lanora) .filter-backdrop,
:where(.lanora) .filter__close,
:where(.lanora) .filter__actions,
:where(.lanora) .catalog__filter-btn,
:where(.lanora) .msort {
  display: none;
}

/* =========================================================
   MOBILE – Figma 526:8027 "Danh mục sản phẩm" (393px)
   ========================================================= */
@media (max-width: 767px) {
  :where(.lanora) .catalog {
    display: block;
    min-height: 0;
    padding: 32px 16px 48px;
    scroll-margin-top: 64px;
  }
  :where(.lanora) .catalog__bg-sticky {
    width: 100%;
  }
  :where(.lanora) .catalog__bg-sticky img {
    object-position: 65% center;
  }
  :where(.lanora) .catalog__bg-sticky .pblur {
    display: none;
  }
  :where(.lanora) .catalog__bg-sticky::after {
    background: linear-gradient(257.57deg, rgba(255, 255, 255, 0.1) 0%, rgba(144, 106, 64, 0.1) 65.617%);
  }

  /* ---------- Thanh công cụ (Figma 532:10398) ---------- */
  :where(.lanora) .catalog__content {
    width: auto;
    padding-left: 0;
    border-left: 0;
    gap: 32px;
  }
  :where(.lanora) .catalog__toolbar {
    flex-wrap: wrap;
    row-gap: 16px;
  }
  :where(.lanora) .catalog__count-label {
    display: inline-block;
  }
  :where(.lanora) .catalog__count-label::first-letter {
    text-transform: uppercase;
  }
  :where(.lanora) .catalog__filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
  }
  :where(.lanora) .catalog__filter-btn img {
    width: 15.5px;
    height: 15.5px;
    margin: 2.25px; /* icon 14px (viền 20px), lật dọc như Figma */
    transform: scaleY(-1);
  }
  :where(.lanora) .catalog__sort {
    display: none;
  }

  /* Ô sắp xếp tùy chỉnh (Figma 532:10441 + Dropdown-Menu 535:11621) */
  :where(.lanora) .msort {
    position: relative;
    z-index: 5;
    display: block;
    width: 100%;
  }
  :where(.lanora) .msort__field {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--white);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    color: var(--text-primary);
  }
  :where(.lanora) .msort__field span {
    flex: 1 0 0;
    min-width: 1px;
  }
  :where(.lanora) .msort__field img {
    width: 20px;
    height: 20px;
  }
  :where(.lanora) .msort.is-open .msort__field {
    border-color: #c89bc8;
  }
  :where(.lanora) .msort.is-open .msort__field img {
    content: url("../assets/icons/chevron-up-purple.svg");
  }
  :where(.lanora) .msort__list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08);
  }
  :where(.lanora) .msort.is-open .msort__list {
    display: flex;
  }
  :where(.lanora) .msort__list li {
    position: relative;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    cursor: pointer;
  }
  :where(.lanora) .msort__list li + li {
    margin-top: 5px; /* gạch 1px + khoảng 4px */
  }
  :where(.lanora) .msort__list li + li::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: var(--border-subtle);
  }
  :where(.lanora) .msort__list li[aria-selected="true"] {
    color: var(--primary-01);
  }

  /* ---------- Lưới sản phẩm 2 cột (Figma 532:9774) ---------- */
  :where(.lanora) .catalog__grid {
    grid-template-columns: repeat(2, 174px); /* Figma: card 174px ở x=0 và x=186 */
    grid-auto-rows: 292px;
    gap: 12px;
    width: 100%;
  }
  /* Phân trang (Figma 532:9726) */
  :where(.lanora) .pagination button,
  :where(.lanora) .pagination span {
    font-size: 14px;
  }

  /* ---------- Bộ lọc dạng tấm trượt (Figma 540:12145) ---------- */
  :where(.lanora) .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: block;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0s 0.3s;
  }
  :where(.lanora) .catalog.is-filter-open .filter-backdrop {
    opacity: 0.4;
    visibility: visible;
    transition: opacity 0.3s;
  }
  :where(.lanora) .filter {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 141;
    display: flex;
    flex-direction: column;
    width: auto;
    max-height: calc(100% - 94px);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s 0.3s;
  }
  :where(.lanora) .catalog.is-filter-open .filter {
    transform: none;
    visibility: visible;
    transition: transform 0.3s ease;
  }
  :where(.lanora) .filter::after {
    display: none;
  }
  :where(.lanora) .filter__head {
    flex: none;
    padding: 16px 16px 12px;
  }
  :where(.lanora) .filter__clear {
    display: none;
  }
  :where(.lanora) .filter__close {
    display: block;
    width: 24px;
    height: 24px;
  }
  :where(.lanora) .filter__close img {
    width: 24px;
    height: 24px;
  }
  :where(.lanora) .filter__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    gap: 16px;
    padding: 16px 16px 16px;
  }
  :where(.lanora) .filter__group,
  :where(.lanora) .filter__group:first-child {
    gap: 12px;
  }
  :where(.lanora) .filter__toggle {
    font-size: 15px;
    line-height: 24px;
  }
  :where(.lanora) .filter__group:first-child .filter__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  :where(.lanora) .filter__group.is-collapsed .filter__options {
    display: none;
  }
  :where(.lanora) .filter__actions {
    flex: none;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--white);
    filter: drop-shadow(4px -4px 20px rgba(27, 27, 27, 0.06));
  }
  :where(.lanora) .filter__reset,
  :where(.lanora) .filter__apply {
    flex: 0 0 calc(50% - 6px); /* 2 nút rộng bằng nhau dù padding khác nhau */
    min-width: 1px;
    height: 44px;
  }
  :where(.lanora) .filter__reset {
    padding: 0 24px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    line-height: 24px;
    color: var(--text-primary);
  }
  html.filter-open {
    overflow: hidden;
  }
}

/* Màn rộng hơn 1440px: nền sticky tràn hết chiều ngang */
@media (min-width: 1441px) {
  :where(.lanora) .catalog__bg {
    left: calc(-1 * var(--bleed));
    right: calc(-1 * var(--bleed));
  }
  :where(.lanora) .catalog__bg-sticky {
    width: 100%;
  }
}
