/* ============================================================
   PRODUCT LIST & CARDS — UX refresh (2026-10)
   Loaded after site.css, so these rules refine the earlier .pl-* styles.
   ============================================================ */

:root {
  --pl-border: #e0ede5;
  --pl-radius: 14px;
  --pl-focus: 0 0 0 3px rgba(54, 176, 93, 0.35);
  --pl-sale-bg: #fff0c4;
  --pl-sale-text: #8a5500;
  --pl-skeleton-a: #eef4f0;
  --pl-skeleton-b: #f7faf8;
}

/* Cart / status toast — fixed so it is visible wherever the user has scrolled */
#ajaxCartMessage.alert {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1080;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  text-align: center;
  animation: pl-toast-in 0.2s ease-out;
}

body.mobile-cart-strip-visible #ajaxCartMessage.alert {
  bottom: 88px;
}

@keyframes pl-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Breadcrumb */
.pl-breadcrumb .breadcrumb {
  font-size: 0.85rem;
}

.pl-breadcrumb .breadcrumb a {
  color: var(--green-700);
  text-decoration: none;
}

.pl-breadcrumb .breadcrumb a:hover {
  text-decoration: underline;
}

/* Top bar */
.pl-topbar {
  align-items: center;
}

.pl-topbar .page-heading {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  overflow-wrap: anywhere;
}

.pl-topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pl-filter-toggle {
  white-space: nowrap;
}

/* Active filter chips */
.pl-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pl-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.8rem;
  border: 1px solid #b9e0c6;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pl-active-chip .bi {
  font-size: 0.7rem;
}

.pl-active-chip:hover {
  background: #d6f1df;
  border-color: var(--green-500);
}

/* Sidebar */
.pl-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.pl-sidebar-title {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
}

.pl-filter-heading {
  font-size: 0.78rem;
}

.pl-sidebar-inner {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.pl-filter-chip {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
}

.pl-filter-chip:has(input:focus-visible),
.pl-filter-chip:focus-visible,
.pl-active-chip:focus-visible,
.pl-add-btn:focus-visible,
.pl-back-to-top:focus-visible {
  outline: none;
  box-shadow: var(--pl-focus);
}

/* Brand facet list */
.pl-brand-search {
  position: relative;
  margin-bottom: 0.5rem;
}

.pl-brand-search .bi {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pl-brand-search .form-control {
  padding-left: 1.8rem;
  border-color: #c8e6d0;
}

.pl-brand-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.4rem;
}

.pl-brand-list:not(.is-expanded) .pl-brand-option.is-overflow {
  display: none;
}

.pl-brand-list.is-expanded {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.pl-brand-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  font-size: 0.86rem;
  cursor: pointer;
}

.pl-brand-option:hover {
  background: var(--green-100);
}

.pl-brand-option .form-check-input {
  margin: 0;
  flex-shrink: 0;
}

.pl-brand-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-brand-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f2;
  border-radius: 999px;
  padding: 0 0.45rem;
}

/* Price range inputs */
.pl-price-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.pl-price-field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.pl-price-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.pl-price-prefix {
  position: absolute;
  left: 0.55rem;
  bottom: 0.32rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.pl-price-field .form-control {
  padding-left: 1.4rem;
  border-color: #c8e6d0;
}

.pl-price-field .form-control:focus,
.pl-brand-search .form-control:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(54, 176, 93, 0.15);
}

.pl-price-sep {
  padding-bottom: 0.35rem;
  color: var(--text-muted);
}

/* Product card */
.pl-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--pl-radius);
}

.pl-card .pl-img-wrap {
  display: flex;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-bottom: 1px solid #eef5f0;
  padding: 0.75rem;
}

.pl-card .pl-img-wrap .product-image {
  object-fit: contain;
}

.pl-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0.75rem 0.85rem 0.85rem;
}

.pl-card .pl-cat-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-card-title {
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.pl-card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.pl-card-title a:hover {
  color: var(--green-700);
}

.pl-card .pl-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  align-self: flex-start;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: #fff7e6;
  color: #b7791f;
  font-size: 0.72rem;
  font-weight: 700;
}

.pl-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.pl-price-block {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.pl-price-block .price {
  font-size: 0.95rem;
}

.pl-mrp {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.pl-badge.sale {
  background: var(--pl-sale-bg);
  color: var(--pl-sale-text);
}

.pl-add-btn {
  min-width: 68px;
  height: 32px;
  padding: 0 0.9rem;
  border: 1.5px solid var(--green-700);
  border-radius: 8px;
  background: var(--green-100);
  color: var(--green-900);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.pl-add-btn:hover,
.pl-add-btn:active {
  background: var(--green-700) !important;
  border-color: var(--green-700) !important;
  color: #fff !important;
}

.pl-card .list-inline-qty {
  min-width: 80px;
  justify-content: space-between;
}

/* Skeleton loading */
.pl-skeleton {
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  background: #fff;
  padding: 0.75rem;
  overflow: hidden;
}

.pl-skeleton-img,
.pl-skeleton-line {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--pl-skeleton-a) 25%, var(--pl-skeleton-b) 50%, var(--pl-skeleton-a) 75%);
  background-size: 200% 100%;
  animation: pl-shimmer 1.2s infinite linear;
}

.pl-skeleton-img {
  aspect-ratio: 1 / 1;
  margin-bottom: 0.75rem;
}

.pl-skeleton-line {
  height: 10px;
  margin-bottom: 0.5rem;
}

@keyframes pl-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Empty state */
.pl-no-results {
  background: #fff;
  border: 1px dashed #c8e6d0;
  border-radius: var(--pl-radius);
}

/* Back to top */
.pl-back-to-top {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 1030;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 108, 46, 0.35);
}

body.mobile-cart-strip-visible .pl-back-to-top {
  bottom: 88px;
}

/* Mobile filter drawer */
.pl-sidebar-footer {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-top: 1px solid var(--pl-border);
}

body.pl-no-scroll {
  overflow: hidden;
}

@media (max-width: 991px) {
  .pl-sidebar {
    display: flex;
    flex-direction: column;
    width: min(320px, 88vw);
    left: calc(-1 * min(320px, 88vw) - 10px);
    z-index: 1045;
  }

  .pl-backdrop {
    z-index: 1040;
  }

  .pl-sidebar-inner {
    max-height: none;
    flex: 1 1 auto;
    overflow-y: auto;
  }
}

@media (max-width: 575px) {
  .pl-topbar-controls {
    width: 100%;
  }

  .pl-topbar-controls .pl-filter-toggle {
    width: auto;
    flex: 0 0 auto;
  }

  .pl-card .pl-img-wrap {
    padding: 0.5rem;
  }

  .pl-card-body {
    padding: 0.6rem 0.65rem 0.7rem;
  }

  .pl-card-footer {
    flex-wrap: wrap;
  }

  .pl-add-btn {
    min-width: 60px;
  }
}

/* Similar products strip (product page) */
.pd-similar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pd-similar-title {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
}

.pd-similar-link {
  color: var(--green-700);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.pd-similar-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 210px);
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.pd-similar-item {
  scroll-snap-align: start;
}

@media (prefers-reduced-motion: reduce) {
  .pl-skeleton-img,
  .pl-skeleton-line,
  #ajaxCartMessage.alert {
    animation: none;
  }

  .product-card,
  .pl-img-wrap .product-image,
  .pl-sidebar {
    transition: none;
  }
}
