:root {
  --lg-accent: #ff6f61;
}

/* Desktop: sidebar visible */
#lg-filter-sidebar {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  box-shadow: none;
  transition: none;
  z-index: auto;
}

/* Modern e-commerce filter UI (unified & cleaned) */

/* Accent color (change here to use a different brand color) */
:root {
  --lg-accent: #ff6f61;
  --lg-accent-ghost: rgba(255, 111, 97, 0.12);
  --lg-accent-border: rgba(255, 111, 97, 0.18);
  --lg-muted: #666666;
  --lg-text: #111827;
  --lg-bg: #ffffff;
}

/* Layout */
.lg-filter-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

@media (max-width:900px) {
  .lg-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar card */
.lg-filter-card {
  background: var(--lg-bg);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 15, 15, 0.06);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Header */
.lg-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lg-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--lg-text);
}

.lg-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lg-apply-btn {
  background: var(--lg-accent);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 12px rgba(255, 111, 97, 0.12);
}

.lg-reset-link {
  background: transparent;
  border: none;
  color: var(--lg-muted);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}

/* Sections */
.lg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lg-section-body {
  padding-top: 6px;
}

/* Checkbox style */
.lg-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--lg-text);
}

.lg-checkbox input {
  display: none;
}

.lg-checkmark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid #ccc;
  display: inline-block;
  position: relative;
  flex: 0 0 18px;
}

.lg-checkbox input:checked+.lg-checkmark {
  background: var(--lg-accent);
  border-color: var(--lg-accent);
}

.lg-checkbox input:checked+.lg-checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Category nesting */
.lg-cat-parent {
  margin-bottom: 6px;
}

.lg-cat-children {
  margin-left: 14px;
  margin-bottom: 12px;
}

.lg-child .lg-checkmark {
  width: 16px;
  height: 16px;
}

/* Inputs */
.lg-input,
.lg-select,
.lg-filter-card input[type=number] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  font-size: 14px;
}

.lg-select {
  appearance: none;
}

/* Price range */
.lg-price-row {
  display: flex;
  gap: 8px;
}

.lg-price-row label {
  flex: 1;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lg-range {
  margin-top: 8px;
}
#lg-range-min{
  margin-bottom: 15px;
}
.lg-range input[type=range] {
  width: 100%;
  appearance: none;
  height: 8px;
  background: linear-gradient(90deg, var(--lg-accent) 0%, #ffd6cf 100%);
  border-radius: 6px;
}

.lg-range-values {
  text-align: center;
  font-size: 13px;
  color: #444;
  margin-top: 6px;
}

/* Content area */
.lg-filter-content {
  padding: 10px;
}

.lg-filter-instruction {
  background: #fff;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 15, 15, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.lg-code {
  background: #f6f6f8;
  padding: 8px;
  border-radius: 6px;
  display: inline-block;
}

/* ===== Selected chips / footer (unified style) ===== */

/* Footer card container */
.lg-filter-footer-card,
.lg-filter-footer {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 15, 15, 0.04);
  padding: 12px;
  margin-top: 35px;
}

/* inner layout for footer */
.lg-filter-footer-card .lg-filter-footer-inner,
.lg-filter-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Left area: title + count (optional) */
.lg-footer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--lg-text);
}

.lg-footer-count {
  background: var(--lg-accent-ghost);
  color: var(--lg-accent);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 111, 97, 0.14);
}

/* Selected chips container */
.lg-selected-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 auto;
}

/* Chip (single unified style) */
.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff6f4;
  border: 1px solid var(--lg-accent-border);
  color: #9b2b20;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
  box-shadow: 0 2px 8px rgba(255, 111, 97, 0.02);
}

.lg-chip .lg-chip-label {
  display: inline-block;
}

/* hover transforms */
.lg-chip:hover {
  transform: translateY(-2px);
  background: var(--lg-accent);
  color: #fff;
  border-color: var(--lg-accent);
}

.lg-chip:hover .lg-chip-remove {
  color: rgba(255, 255, 255, 0.95);
}

/* Remove button */
.lg-chip-remove {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, color 120ms ease;
}

.lg-chip-remove:hover {
  transform: scale(1.15);
  color: rgba(0, 0, 0, 0.6);
}

/* Clear-all button */
.lg-clear-all {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
}

.lg-clear-all:hover {
  background: var(--lg-accent);
  color: #fff;
  border-color: var(--lg-accent);
}

/* Small-screen layout adjustments */
@media (max-width:768px) {

  .lg-filter-footer-card .lg-filter-footer-inner,
  .lg-filter-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .lg-filter-footer-left {
    width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
  }

  .lg-footer-actions {
    width: 100%;
    text-align: right;
    margin-top: 6px;
  }

  .lg-chip {
    font-size: 13px;
    padding: 5px 10px;
  }
}

/* Toggle collapse button */
.lg-toggle {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

/* Small utility */
.lg-code,
.lg-filter-instruction {
  max-width: 100%;
  word-break: break-word;
}

/* Accessibility focus outlines */
.lg-filter-grid :focus {
  outline: 3px solid rgba(59, 111, 255, 0.12);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mobile block for off-canvas behavior */
@media (min-width: 980px) {
  .lg-filter-mobile-toggle {
    display: none;
  }
}

@media (max-width: 980px) {
  .lg-filter-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(90deg, var(--lg-accent), #ff8a75);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    margin: 0 0 12px auto;
    min-width: 88px;
    height: 40px;
    -webkit-tap-highlight-color: transparent;
  }

  /* hide sidebar by default on mobile */
  #lg-filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84%;
    max-width: 400px;
    transform: translateX(-110%);
    transition: transform 300ms ease;
    z-index: 10002;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
    background: var(--lg-bg);
  }

  #lg-filter-sidebar.lg-open {
    transform: translateX(0);
  }

  .lg-filter-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
  }

  .lg-filter-overlay.lg-active {
    opacity: 1;
    pointer-events: auto;
  }

  body.lg-filter-open {
    overflow: hidden;
  }
}