/* ===== Contenedor ===== */
.cof-fyb {
  box-sizing: border-box;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 0 40px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #33352f;
}

.cof-fyb *,
.cof-fyb *::before,
.cof-fyb *::after {
  box-sizing: border-box;
}

/* ===== Acceso a farmacias abiertas ===== */
.cof-fyb .open-pharmacy-action {
  margin: 0 0 24px;
  text-align: center;
}

.cof-fyb .open-pharmacy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  min-height: 48px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #bbe164;
  color: #2b3018;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(60, 70, 40, .12);
  transition: background .15s ease, box-shadow .15s ease;
}

.cof-fyb .open-pharmacy-button:hover {
  background: #aed652;
  color: #2b3018;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(60, 70, 40, .18);
}

.cof-fyb .open-pharmacy-button:focus-visible {
  outline: 3px solid #405c16;
  outline-offset: 4px;
}

/* ===== Buscador ===== */
.cof-fyb .search-section {
  margin-bottom: 28px;
}

.cof-fyb .search-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  background: #e8f5d8;
  border-left: 4px solid #bbe164;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(60, 70, 40, .08);
}

.cof-fyb .search-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #bbe164;
  color: #ffffff;
  font-size: 18px;
}

.cof-fyb .search-content {
  flex: 1 1 auto;
  min-width: 0;
}

.cof-fyb .filter-group {
  flex: 0 0 240px;
}

.cof-fyb .search-label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #33352f;
}

.cof-fyb .search-input {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: #33352f;
  background: #ffffff;
  border: 1px solid #d5dccb;
  border-radius: 6px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cof-fyb .search-input:focus {
  border-color: #9ab459;
  box-shadow: 0 0 0 3px rgba(187, 225, 100, .35);
}

.cof-fyb .search-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7160;
}

.cof-fyb .search-hint i {
  margin-right: 4px;
  color: #9ab459;
}

/* ===== Pestañas ===== */
.cof-fyb .tabs-navigation {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid #e3e8da;
}

.cof-fyb .tab-button {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #5b6150;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.cof-fyb .tab-button:hover {
  background: #f3f9e8;
}

.cof-fyb .tab-button.active {
  color: #8cb52f;
  background: #e8f5d8;
  border-bottom-color: #bbe164;
}

.cof-fyb .tab-count {
  min-width: 28px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #33352f;
  background: #bbe164;
  border-radius: 999px;
}

.cof-fyb .tab-button.active .tab-count {
  color: #ffffff;
  background: #2b2e26;
}

/* ===== Contenido de cada pestaña ===== */
.cof-fyb .tab-content {
  display: none;
}

.cof-fyb .tab-content.active {
  display: block;
}

.cof-fyb .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 22px;
  margin-bottom: 20px;
  background: #bbe164;
  border-radius: 8px;
  color: #2b3018;
}

.cof-fyb .list-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #2b3018;
}

.cof-fyb .list-header h3 i {
  margin-right: 8px;
}

.cof-fyb .list-header p {
  margin: 0;
  font-size: 13px;
}

.cof-fyb .list-header p strong {
  font-size: 16px;
}

/* ===== Rejilla y tarjetas ===== */
.cof-fyb .items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.cof-fyb .item-card {
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e5e9dc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(60, 70, 40, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cof-fyb .item-card:hover {
  transform: translateY(-2px);
  border-color: #bbe164;
  box-shadow: 0 8px 20px rgba(60, 70, 40, .12);
}

.cof-fyb .item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eef1e8;
}

.cof-fyb .item-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #bbe164 0%, #9ab459 100%);
  color: #ffffff;
  font-size: 16px;
}

.cof-fyb .item-title {
  min-width: 0;
}

.cof-fyb .item-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  color: #2b2e26;
  overflow-wrap: anywhere;
}

.cof-fyb .item-num {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #8cb52f;
  background: #e8f5d8;
  border-radius: 4px;
}

.cof-fyb .item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  text-transform: uppercase;
  color: #6b7160;
}

.cof-fyb .item-row:last-child {
  margin-bottom: 0;
}

.cof-fyb .item-row i {
  flex: 0 0 14px;
  margin-top: 2px;
  text-align: center;
  color: #9ab459;
}

.cof-fyb .item-row a {
  font-weight: 600;
  color: #8cb52f;
  text-decoration: none;
}

.cof-fyb .item-row a:hover {
  text-decoration: underline;
}

/* ===== Sin resultados ===== */
.cof-fyb .no-results {
  display: none;
  padding: 48px 16px;
  text-align: center;
  color: #7b8168;
}

.cof-fyb .no-results.show {
  display: block;
}

.cof-fyb .no-results i {
  margin-bottom: 12px;
  font-size: 32px;
  color: #bbe164;
}

.cof-fyb .no-results p {
  margin: 0;
  font-size: 15px;
}

/* ===== Móvil ===== */
@media (max-width: 768px) {
  .cof-fyb .open-pharmacy-button {
    width: 100%;
    padding: 14px 18px;
  }
  .cof-fyb .search-card {
    flex-direction: column;
    padding: 18px;
  }
  .cof-fyb .search-content,
  .cof-fyb .filter-group {
    width: 100%;
    flex: 1 1 auto;
  }
  .cof-fyb .items-grid {
    grid-template-columns: 1fr;
  }
  .cof-fyb .tab-button {
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
  }
  .cof-fyb .list-header h3 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cof-fyb .open-pharmacy-button,
  .cof-fyb .item-card,
  .cof-fyb .tab-button,
  .cof-fyb .search-input {
    transition: none;
  }
}

/* ===== Fecha de actualización (datos del ERP) ===== */
.cof-fyb .data-stamp {
  margin: -8px 0 16px;
  font-size: 12px;
  text-align: right;
  color: #6b7160;
}
