/* ===== Filter Section ===== */
.listing-filter-form {
  display: block;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  background: var(--white);
  border: 2px solid var(--ocean-mid);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.listing-filter-form .filter {
  display: flex;
  flex-direction: column;
}

.listing-filter-form label {
  font-weight: bold;
  color: var(--ocean-mid);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.listing-filter-form input,
.listing-filter-form text {
  margin-bottom: 5px;
}

.listing-filter-form input,
.listing-filter-form select {
  padding: 0.5rem;
  margin-bottom: 5px;
  border: 1px solid var(--ocean-mid);
  border-radius: 6px;
  font-size: 0.95rem;
}

.listing-filter-form button {
  align-self: flex-end;
  padding: 8px 16px;
  background-color: var(--ocean-mid);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
}

.listing-filter-form button:hover {
  background-color: var(--navy-mid);
}

/* ===== Breadcrumbs / Filter Pills ===== */
.filter-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-pill {
  background: var(--aqua-mist);
  border-radius: 999px;
  padding: 0.4em 0.75em;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
}

.filter-pill .remove-pill {
  margin-left: 0.5em;
  font-weight: bold;
  color: var(--ink-light);
  text-decoration: none;
}

/* PPN TOGGLE TAB */
.sort-toggle {
  position: absolute;
  width: 275px;
  right: 0;
  top: 0;
  z-index: 5;
  padding: 10px 20px 25px 14px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  font-weight: bold;
  font-size: 16px;
  line-height: 16px;
  color: #00405f;
  user-select: none;
  cursor: pointer;

  background:
    linear-gradient(120deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(135deg, #ffd700, #e5a810);
  background-repeat: no-repeat;
  background-size: cover;
}

.sort-toggle:hover {
  color: #00405f;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(135deg, #ffe066, #fbbe22);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.sort-toggle .sort-toggle-pill {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

/* ===== Table ===== */
.listing-table-outer {
  position: relative;
  z-index: 6;
  border: 2px solid var(--ocean-mid);
  border-radius: 12px;
  overflow: hidden;
}

.listing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 13px;
  z-index: 15;
  position: relative;
}

.listing-table thead {
  background-color: var(--ocean-mid);
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.listing-table thead th {
  white-space: nowrap;
  text-align: left;
  background-color: var(--ocean-mid);
  color: var(--white);
}

.listing-table th,
.listing-table td {
  padding: 5px 13px 5px 2px;
  border: 0px;
}

.listing-table th a {
  text-decoration: none;
  color: var(--white);
  font-weight: bold;
}

.listing-table th a:hover {
  color: var(--aqua-light);
}

/* ZEBRA STRIPES */
.listing-table tbody tr:nth-child(odd) {
  background-color: var(--white);
}

.listing-table tbody tr:nth-child(even) {
  background-color: var(--aqua-mist);
}

.listing-table tr th:first-child,
.listing-table tr td:first-child {
  padding-left: 13px;
}

.listing-filters-container {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.listing-breadcrumbs-container,
.listing-table-container {
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
}

.listing-table-container {
  position: relative;
  padding-top: 36px;
}

.listing-breadcrumbs-container {
  position: relative;
  z-index: 10;
  min-height: 79px;
  margin-top: -4px;
  margin-bottom: -45px;
  pointer-events: none; /* empty space here must not block clicks on .sort-toggle beneath it; pills opt back in below */
}

.listing-wrapper {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
  margin-top: 10px;
  padding: 0 16px 40px 16px;
}

.listing-title {
  font-size: 18px;
  margin-top: 0px;
}

.listing-filters-container,
.listing-breadcrumbs-container,
.listing-table-container {
  float: none !important;
  clear: both !important;
}

/* Sort arrow spacing */
.listing-table th a::after {
  content: ' ';
  margin-left: 0.3em;
}

.listing-cell {
  font-size: 13px;
}

.listing-cell-days {
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.listing-cell-ddate,
.listing-cell-rdate {
  font-size: 13px;
  white-space: nowrap;
}

.listing-cell-cship,
.listing-cell-cline {
  font-size: 13px;
  white-space: nowrap;
}

.listing-cell-poc {
  font-size: 12px;
}

/* Price cells — color is applied inline by listing_price_color() in PHP.
   The base color here is the "neutral" fallback only. */
.listing-cell-int,
.listing-cell-win,
.listing-cell-blc,
.listing-cell-ste {
  font-size: 16px;
  font-weight: bold;
  color: var(--aqua);
  text-align: center;
}

.listing-cell-night {
  font-size: 9px;
  color: var(--ink-light);
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
  .listing-filter-form {
    flex-direction: column;
  }

  .listing-table th,
  .listing-table td {
    font-size: 0.875rem;
    padding: 5px;
  }
}

.listing-breadcrumbs {
  color: var(--ink-light);
  margin: 0px;
  font-family: Arial, sans-serif;
}

.breadcrumb-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--sand);
  margin: 0 5px 5px 0;
  font-size: 15px;
  pointer-events: auto;
}

.filter-pill {
  background: var(--aqua-mist);
  color: var(--navy);
}

.sort-pill {
  background: #d5f5f5;
  color: #1a6060;
}

.remove-pill {
  margin-left: 8px;
  color: var(--ink-light);
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

.remove-pill:hover {
  color: var(--coral);
}

/* FILTER SLIDER UI STYLES */
range-wrapper {
  position: relative;
  user-select: none;
  margin-bottom: 0px;
  font-family: Arial, sans-serif;
  margin-top: -20px;
}

.range-labels {
  height: 14px;
  padding: 0;
  margin: 0 0 5px 0;
  font-size: 0.9em;
  color: var(--ink-mid);
  text-align: right;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: right;
}

/* FILTER BOX STYLES */
.filter-grid {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) 1fr 1fr minmax(350px, 1fr) !important;
  gap: 0px;
  background-color: var(--white);
  padding: 0px;
}

.filter-header {
  background-color: var(--ocean-mid);
  padding: 8px;
  font-weight: bold;
  color: var(--white);
  border-bottom: 0px solid var(--ocean-mid);
  border-right: 1px solid var(--ocean-mid);
  border-top: 0px;
  border-left: 0px;
  text-align: left;
}

.filter-header:nth-child(4n) {
  border-right: none;
}

.filter-cell {
  background-color: var(--aqua-mist);
  padding: 10px;
  border-right: 2px solid var(--ocean-mid);
}

.filter-cell:nth-child(4n) {
  border-right: none;
}

.filter-footer {
  grid-column: span 4;
  background-color: var(--aqua-mist);
  padding: 10px;
  text-align: right;
  border-top: 2px solid var(--ocean-mid);
}

.apply-filters-button {
  background-color: var(--ocean-mid);
  color: var(--white);
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  margin-right: 10px;
}

.apply-filters-button:hover {
  background-color: var(--navy-mid);
}

.reset-filters-button {
  color: var(--ocean-mid);
  text-decoration: none;
  padding: 7px 12px;
  background-color: var(--sand);
  border: 1px solid var(--sand-dark);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
}

.reset-filters-button:hover {
  background-color: var(--sand-dark);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.date-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 330px;
  min-width: 330px;
}

.date-input-grid .filter {
  width: 100%;
  box-sizing: border-box;
}

/* PAGINATION CONTROLS */
.listing-pagination-wrapper {
  text-align: center;
  margin-bottom: 50px;
}

.listing-pagination {
  display: inline-block;
  background: var(--ocean-mid);
  color: var(--white);
  padding: 6px 25px 10px 25px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  margin: 0px;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  user-select: none;
  text-align: center;
  text-decoration: none;
}

.listing-pagination a {
  color: var(--white);
  text-decoration: none;
  margin-left: 25px;
  margin-right: 25px;
}

.listing-pagination a:hover {
  text-decoration: none;
  color: var(--aqua-light);
}

/* UPSELL ROW */
.listing-upsell-row {
  text-align: center;
  padding: 14px;
  background: #f8d4c9;
  font-size: 14px;
  border-top: 2px solid var(--ocean-mid);
}

.listing-upsell-row a {
  color: var(--ocean-mid);
  font-weight: bold;
  text-decoration: none;
}

.listing-upsell-row a:hover {
  text-decoration: underline;
}
