/* ==========================================================
   Range of Products (range-of-products.php)
   ========================================================== */

:root {
  --rs-range-accent: #ea5501;
  --rs-range-accent-dark: #c44600;
  --rs-range-tint: #fff4ee;
  --rs-range-tint-strong: #ffe6d8;
  --rs-range-ink: #261914;
  --rs-range-muted: #4a5568;
  --rs-range-line: #f6ddd5;
}

/* ---------- Filter ---------- */

.rs-range-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 40px;
}

.rs-range-filter-field {
  flex: 0 1 340px;
  min-width: 0;
}

.rs-range-filter-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rs-range-accent);
}

.rs-range-filter-field select {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 16px;
  border: 2px solid var(--rs-range-line);
  border-radius: 12px;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ea5501' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  font-size: 15px;
  font-weight: 500;
  color: var(--rs-range-ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rs-range-filter-field select:hover,
.rs-range-filter-field select:focus {
  border-color: var(--rs-range-accent);
  box-shadow: 0 0 0 4px rgba(234, 85, 1, 0.12);
  outline: none;
}

/* The site's nice-select plugin replaces the native <select> */
.rs-range-filter-field .nice-select {
  float: none;
  width: 100%;
  height: 48px;
  line-height: 44px;
  padding-left: 16px;
  border: 2px solid var(--rs-range-line);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--rs-range-ink);
}

.rs-range-filter-field .nice-select:hover,
.rs-range-filter-field .nice-select.open,
.rs-range-filter-field .nice-select:focus {
  border-color: var(--rs-range-accent);
  box-shadow: 0 0 0 4px rgba(234, 85, 1, 0.12);
}

.rs-range-filter-field .nice-select::after {
  border-color: var(--rs-range-accent);
}

.rs-range-filter-field .nice-select .list {
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 12px;
}

.rs-range-filter-field .nice-select .option:hover,
.rs-range-filter-field .nice-select .option.focus,
.rs-range-filter-field .nice-select .option.selected.focus {
  background: var(--rs-range-tint);
  color: var(--rs-range-accent);
}

.rs-range-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--rs-range-tint);
  color: var(--rs-range-accent);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.rs-range-clear:hover {
  background: var(--rs-range-accent);
  color: #ffffff;
}

/* ---------- Sector block ---------- */

.rs-range-block {
  margin-bottom: 48px;
  background: #ffffff;
  border: 1px solid var(--rs-range-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(38, 25, 20, 0.35);
}

.rs-range-block:last-child {
  margin-bottom: 0;
}

.rs-range-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  background: linear-gradient(120deg, var(--rs-range-tint) 0%, #ffffff 70%);
  border-bottom: 1px solid var(--rs-range-line);
}

.rs-range-head-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--rs-range-accent);
  color: #ffffff;
  font-size: 24px;
  box-shadow: 0 10px 20px -10px rgba(234, 85, 1, 0.7);
}

.rs-range-head h2 {
  margin: 0 0 2px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--rs-range-ink);
}

.rs-range-head p {
  margin: 0;
  font-size: 14px;
  color: var(--rs-range-muted);
}

.rs-range-count {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rs-range-tint-strong);
  color: var(--rs-range-accent-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Table ---------- */

.rs-range-table-wrap {
  overflow-x: auto;
}

.rs-range-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.rs-range-table thead th {
  padding: 15px 20px;
  background: var(--rs-range-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.rs-range-table tbody td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--rs-range-line);
  font-size: 15px;
  line-height: 1.65;
  color: var(--rs-range-muted);
  vertical-align: top;
}

.rs-range-table tbody tr:last-child td {
  border-bottom: 0;
}

.rs-range-table tbody tr:nth-child(even) {
  background: #fffaf7;
}

.rs-range-table tbody tr {
  transition: background 0.2s ease;
}

.rs-range-table tbody tr:hover {
  background: var(--rs-range-tint);
}

.rs-range-table .rs-range-num {
  width: 72px;
  text-align: center;
}

.rs-range-table td.rs-range-num span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rs-range-tint-strong);
  color: var(--rs-range-accent-dark);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.rs-range-table tbody tr:hover td.rs-range-num span {
  background: var(--rs-range-accent);
  color: #ffffff;
}

.rs-range-table .rs-range-sector {
  width: 28%;
}

.rs-range-table td.rs-range-sector {
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--rs-range-ink);
}

/* ---------- Empty state ---------- */

.rs-range-empty {
  padding: 60px 20px;
  border: 2px dashed var(--rs-range-line);
  border-radius: 18px;
  background: var(--rs-range-tint);
  text-align: center;
}

.rs-range-empty i {
  display: block;
  margin-bottom: 8px;
  font-size: 40px;
  color: var(--rs-range-accent);
}

.rs-range-empty p {
  margin: 0;
  color: var(--rs-range-muted);
}

/* ---------- Mobile: rows become stacked cards ---------- */

@media (max-width: 767px) {
  .rs-range-head {
    flex-wrap: wrap;
    padding: 18px;
  }

  .rs-range-head h2 {
    font-size: 20px;
  }

  .rs-range-count {
    margin-left: 68px;
  }

  .rs-range-table thead {
    display: none;
  }

  .rs-range-table,
  .rs-range-table tbody,
  .rs-range-table tr,
  .rs-range-table td {
    display: block;
    width: 100% !important;
  }

  .rs-range-table tbody tr {
    position: relative;
    padding: 16px 18px 16px 64px;
    border-bottom: 1px solid var(--rs-range-line);
  }

  .rs-range-table tbody tr:last-child {
    border-bottom: 0;
  }

  .rs-range-table tbody td {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .rs-range-table td.rs-range-num {
    position: absolute;
    top: 16px;
    left: 18px;
    width: auto !important;
  }

  .rs-range-table td.rs-range-sector {
    margin-bottom: 6px;
  }

  .rs-range-table td.rs-range-items::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rs-range-accent);
  }
}
