/* ==========================================================
   Fanox Relay Selector – Fanox Design System
   ========================================================== */

:root {
  --fanox-primary: #00847d;
  --fanox-secondary: #67b3b1;
  --fanox-border: rgba(16, 24, 40, 0.10);
  --fanox-text: #1e1e1e;
  --fanox-text-soft: #444;
  --fanox-radius-lg: 5px;
  --fanox-radius-md: 5px;
  --fanox-elev-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .10);
  --fanox-elev-2: 0 6px 16px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
  --fanox-elev-3: 0 14px 30px rgba(16, 24, 40, .14), 0 6px 12px rgba(16, 24, 40, .10);
  --fanox-ring: 0 0 0 4px rgba(0, 132, 125, 0.18);
}


/* Layout */
#fanox-relay-selector.frs-wrapper {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.frs-filters-wrapper,
.frs-results-wrapper {
  background: #fff;
  border: 1px solid var(--fanox-border);
  border-radius: var(--fanox-radius-lg);
  box-shadow: var(--fanox-elev-1);
  padding: 1.25rem;
}

.frs-filters-title,
.frs-results-title {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.2px;
  color: var(--fanox-primary);
}

/* Search */
.frs-search {
  margin-bottom: 1.1rem;
}

.frs-search-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--fanox-text);
}

.frs-search-row {
  display: flex;
  gap: 0.6rem;
}

frs-search-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--fanox-border);
  border-radius: 5px;
  font-size: 0.92rem;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
  margin-bottom: 0;
}

.frs-search-input:focus {
  outline: none;
  border-color: rgba(0, 132, 125, 0.55);
  box-shadow: var(--fanox-ring);
}

.frs-search-button {
  padding: 0 1rem;
  border: 2px solid #008472 !important;
  background-color: transparent !important;
  color: #008472 !important;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
  height: 3em;
}

.frs-search-button:hover {
  color: #fff !important;
  background-color: #006a5d !important;
  border-color: #006a5d !important;
}

#fanox-relay-selector,
#fanox-relay-selector * {
  box-sizing: border-box;
}

#fanox-relay-selector {
  max-width: 100%;
  overflow-x: hidden;
}

.frs-filters-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 0.5rem;
}

.frs-filter-group {
  min-width: 0;
  max-width: 100%;
}

.frs-filter-group h4 {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--fanox-text);
  letter-spacing: 0.15px;
}

.frs-filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 125px;
  overflow-y: auto;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(16, 24, 40, .08);
  border-radius: var(--fanox-radius-md);
  background: rgba(245, 247, 251, .55);
}

.frs-filter-options::-webkit-scrollbar {
  width: 10px;
}

.frs-filter-options::-webkit-scrollbar-thumb {
  background: rgba(16, 24, 40, .15);
  border-radius: 5px;
  border: 3px solid rgba(245, 247, 251, .55);
}

.frs-filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--fanox-text-soft);
  padding: 0.16rem 0.2rem;
  border-radius: 5px;
}

.frs-filter-option:hover {
  background: rgba(0, 132, 125, .06);
}

.frs-filter-option input[type="checkbox"] {
  accent-color: var(--fanox-primary);
  margin: 0;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  display: block;
}

.frs-clear-filters {
  margin-top: 0.95rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--fanox-primary);
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
}

.frs-clear-filters:hover {
  color: var(--fanox-secondary);
  text-decoration: underline;
}

/* Results */
.frs-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}

.frs-results-empty {
  font-size: 0.9rem;
  color: var(--fanox-text-soft);
}


/* Cards */
.frs-card {
  position: relative;
  background: #fff;
  border-radius: var(--fanox-radius-lg);
  padding: 1rem 1.05rem;
  box-shadow: var(--fanox-elev-1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  overflow: hidden;
}

.frs-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fanox-elev-3);
  border-color: rgba(0, 132, 125, .25);
}

.frs-card:focus-within {
  box-shadow: var(--fanox-elev-2), var(--fanox-ring);
  border-color: rgba(0, 132, 125, .35);
}

.frs-card-thumb {
  width: 100%;
  /*aspect-ratio: 4 / 3;*/
  /*background: rgba(16, 24, 40, .04);*/
  border-radius: var(--fanox-radius-lg);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.frs-card-thumb img {
  width: 100%;
  height: 100%;
  max-height: 140px;
  /*object-fit: cover;*/
  object-fit: contain;
  display: block;
}

/* Mantiene el contenido visible por encima de la barra lateral,
   pero debajo del overlay de link */
.frs-card>* {
  position: relative;
  z-index: 1;
}

.frs-card-title {
  font-size: 1.02rem;
  font-weight: 750;
  color: var(--fanox-text);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.1px;
}

.frs-card-meta {
  font-size: 0.82rem;
  color: var(--fanox-text-soft);
  margin: 0;
}

.frs-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.frs-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 132, 125, .08);
  border: 1px solid rgba(0, 132, 125, .18);
  font-size: 0.74rem;
  color: var(--fanox-primary);
  white-space: nowrap;
}

/* Card clickable */
.frs-card-footer {
  position: static;
  margin-top: 0;
}

.frs-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  cursor: pointer;
  text-decoration: none;
}

.frs-card-footer .frs-link:hover {
  text-decoration: none;
}

/* Desktop */
@media (min-width: 960px) {
  #fanox-relay-selector.frs-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    align-items: flex-start;
  }

  .frs-filters-wrapper {
    position: sticky;
    top: 24px;
    align-self: flex-start;
  }

  .frs-results-wrapper {
    min-width: 0;
  }

  .frs-filters-groups {
    grid-template-columns: 1fr;
  }

  .frs-filter-options {
    max-height: 145px;
  }
}

@media (max-width: 1100px) {
  #fanox-relay-selector.frs-wrapper {
    grid-template-columns: 1fr;
  }

  .frs-filters-wrapper {
    position: static;
  }

  .frs-filters-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 600px) {
  .frs-filters-wrapper,
  .frs-results-wrapper {
    padding: 1rem;
  }

  .frs-search-row {
    flex-direction: column;
  }

  .frs-search-button {
    width: 100%;
  }

  .frs-filters-groups {
    grid-template-columns: 1fr;
  }

  .frs-filter-group {
    min-width: 0;
    max-width: 100%;
  }

  .frs-filter-options {
    max-height: 180px;
  }
}