.izio-pet-selector {
  display: grid;
  gap: var(--izio-selector-gap, 7px);
  width: 100%;
  max-width: var(--izio-selector-max-width-desktop, 512px);
  margin-block: var(--izio-selector-vertical-margin, 4px);
  box-sizing: border-box;
  line-height: normal;
}

.izio-pet-selector--align-center {
  margin-inline: auto;
}

.izio-pet-selector--align-right {
  margin-inline-start: auto;
}

@media (max-width: 1024px) {
  .izio-pet-selector {
    max-width: var(--izio-selector-max-width-tablet, 512px);
  }
}

@media (max-width: 767px) {
  .izio-pet-selector {
    max-width: var(--izio-selector-max-width-mobile, 100%);
  }
}

.izio-my-pets__list,
.izio-my-pets__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.izio-my-pets__card,
.izio-my-pets__form {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

.izio-my-pets__card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.izio-my-pets__card-header h3,
.izio-my-pets__card-header p {
  margin: 0;
}

.izio-my-pets__identity {
  min-width: 0;
}

.izio-my-pets__access {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 4px 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.izio-my-pets__access--owner {
  color: #166534;
  background: #dcfce7;
}

.izio-my-pets__access--shared {
  color: #1e3a8a;
  background: #dbeafe;
}

.izio-my-pets__access--outgoing {
  color: #9a3412;
  background: #ffedd5;
}

.izio-my-pets__access--editable {
  color: #166534;
  background: #dcfce7;
}

.izio-my-pets__access--readonly {
  color: #475569;
  background: #e2e8f0;
}

.izio-my-pets__card--shared {
  background: #f8fafc;
}

.izio-my-pets__shared-note {
  margin: 0;
  color: #475569;
  font-size: 0.875rem;
}

.izio-my-pets__photo {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f4f7;
}

.izio-my-pets__photo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.izio-my-pets__delete {
  display: inline-block;
}

.izio-my-pets__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 18px 0;
}

.izio-my-pets__checks legend {
  width: 100%;
  font-weight: 600;
  margin-bottom: 8px;
}

.izio-my-pets__group-help {
  flex: 0 0 100%;
  width: 100%;
  margin: -2px 0 4px;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.4;
}

.izio-my-pets__optional-group {
  margin: 18px 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.izio-my-pets__optional-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.izio-my-pets__optional-group > summary::-webkit-details-marker {
  display: none;
}

.izio-my-pets__optional-group > summary span {
  color: #64748b;
  font-size: 0.8rem;
  white-space: nowrap;
}

.izio-my-pets__optional-group > .izio-my-pets__checks {
  margin: 0;
  padding: 0 16px 16px;
  border: 0;
}

/* Alcuni temi assegnano display ai label e neutralizzano l'attributo hidden. */
[data-izio-option-field][hidden],
[data-izio-profile-field][hidden],
[data-izio-dynamic-group][hidden] {
  display: none !important;
}

.izio-pet-selector__label {
  font-weight: 600;
}

.izio-pet-selector__label--hidden {
  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;
}

.izio-pet-selector__field {
  position: relative;
  width: 100%;
}

.izio-pet-selector__controls {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.izio-pet-selector__action-row {
  display: flex;
  align-items: center;
  gap: var(--izio-selector-gap, 7px);
  width: 100%;
  min-width: 0;
}

.izio-pet-selector__info-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--izio-selector-text-color, currentColor);
  background: transparent;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.izio-pet-selector__info-button .dashicons {
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 20px;
}

.izio-pet-selector__info-button:hover,
.izio-pet-selector__info-button:focus-visible {
  color: var(--izio-selector-icon-color, currentColor);
  background: transparent;
  box-shadow: none;
}

.izio-pet-selector__info-button:focus-visible {
  outline: 1px dotted currentColor;
  outline-offset: 2px;
}

.izio-pet-selector__trigger {
  display: none;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: var(--izio-selector-control-height, 44px);
  min-height: var(--izio-selector-control-height, 44px);
  max-height: var(--izio-selector-control-height, 44px);
  box-sizing: border-box;
  padding: 2px var(--izio-selector-horizontal-padding, 12px) 2px 3px;
  border: var(--izio-selector-border-width, 1px) solid var(--izio-selector-border-color, currentColor);
  border-radius: var(--izio-selector-border-radius, 8px);
  color: var(--izio-selector-text-color, inherit);
  background: var(--izio-selector-background-color, inherit);
  font: inherit;
  font-size: var(--izio-selector-font-size, 16px);
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
}

.izio-pet-selector__trigger:disabled {
  cursor: wait;
  opacity: .72;
}

.izio-pet-selector--guest .izio-pet-selector__trigger {
  display: flex;
  text-decoration: none;
}

.izio-pet-selector__trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(var(--izio-selector-icon-box-size, 38px), calc(var(--izio-selector-control-height, 44px) - 4px - var(--izio-selector-border-width, 1px) - var(--izio-selector-border-width, 1px)));
  height: min(var(--izio-selector-icon-box-size, 38px), calc(var(--izio-selector-control-height, 44px) - 4px - var(--izio-selector-border-width, 1px) - var(--izio-selector-border-width, 1px)));
  flex: 0 0 min(var(--izio-selector-icon-box-size, 38px), calc(var(--izio-selector-control-height, 44px) - 4px - var(--izio-selector-border-width, 1px) - var(--izio-selector-border-width, 1px)));
  border-radius: 50%;
  color: var(--izio-selector-icon-color, currentColor);
  background: var(--izio-selector-icon-background-color, transparent);
}

.izio-pet-selector__trigger-icon :is(svg, img) {
  width: var(--izio-selector-icon-size, 20px);
  height: var(--izio-selector-icon-size, 20px);
  object-fit: contain;
}

.izio-pet-selector__trigger-icon svg {
  fill: currentColor;
}

.izio-pet-selector__trigger-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.izio-pet-selector__trigger-text--hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.izio-pet-selector__trigger-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-inline: 2px 4px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .62;
}

@media (min-width: 768px) {
  .izio-pet-selector--info-desktop .izio-pet-selector__info-button {
    display: inline-flex;
  }

  .izio-pet-selector--desktop-modal .izio-pet-selector__field {
    display: none;
  }

  .izio-pet-selector--desktop-modal .izio-pet-selector__trigger {
    display: flex;
  }

  .izio-pet-selector--desktop-text-never .izio-pet-selector__trigger-text,
  .izio-pet-selector--desktop-text-selected:not(.izio-pet-selector--has-selection) .izio-pet-selector__trigger-text {
    display: none;
  }
}

@media (max-width: 767px) {
  .izio-pet-selector--info-mobile .izio-pet-selector__info-button {
    display: inline-flex;
  }

  .izio-pet-selector--mobile-modal {
    width: fit-content;
    max-width: min(100%, var(--izio-selector-max-width-mobile, 100%));
  }

  .izio-pet-selector--mobile-modal .izio-pet-selector__controls,
  .izio-pet-selector--mobile-modal .izio-pet-selector__trigger {
    width: fit-content;
    max-width: 100%;
  }

  .izio-pet-selector--mobile-modal .izio-pet-selector__field {
    display: none;
  }

  .izio-pet-selector--mobile-modal .izio-pet-selector__trigger {
    display: flex;
  }

  .izio-pet-selector--mobile-text-never .izio-pet-selector__trigger-text,
  .izio-pet-selector--mobile-text-selected:not(.izio-pet-selector--has-selection) .izio-pet-selector__trigger-text {
    display: none;
  }

  .izio-pet-selector--no-pets .izio-pet-selector__status:not(.izio-pet-selector__status--error) {
    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;
  }
}

.izio-pet-selector__info-content {
  padding: 18px 20px 22px;
  line-height: 1.55;
}

.izio-pet-selector__info-content > :first-child {
  margin-top: 0;
}

.izio-pet-selector__info-content > :last-child {
  margin-bottom: 0;
}

.izio-pet-selector__select {
  min-height: var(--izio-selector-control-height, 44px);
  height: var(--izio-selector-control-height, 44px);
  box-sizing: border-box;
  width: 100%;
  border: var(--izio-selector-border-width, 1px) solid var(--izio-selector-border-color, currentColor);
  border-radius: var(--izio-selector-border-radius, 8px);
  padding-inline: var(--izio-selector-horizontal-padding, 12px);
  background: var(--izio-selector-background-color, inherit);
  color: var(--izio-selector-text-color, inherit);
  font-size: var(--izio-selector-font-size, 16px);
}

.izio-pet-selector__loader {
  position: absolute;
  top: 50%;
  display: none;
  width: var(--izio-selector-loader-size, 16px);
  height: var(--izio-selector-loader-size, 16px);
  margin-top: calc(var(--izio-selector-loader-size, 16px) / -2);
  border: 2px solid transparent;
  border-top-color: var(--izio-selector-loader-color, currentColor);
  border-right-color: var(--izio-selector-loader-color, currentColor);
  border-radius: 50%;
  pointer-events: none;
  animation: izio-pet-selector-spin 0.75s linear infinite;
}

.izio-pet-selector--loading-spinner.izio-pet-selector--loading .izio-pet-selector__loader {
  display: block;
}

.izio-pet-selector__loading-label {
  position: absolute;
  inset: var(--izio-selector-border-width, 1px) 36px var(--izio-selector-border-width, 1px) var(--izio-selector-border-width, 1px);
  display: none;
  align-items: center;
  padding-inline: var(--izio-selector-horizontal-padding, 12px);
  overflow: hidden;
  color: var(--izio-selector-text-color, inherit);
  background: var(--izio-selector-background-color, inherit);
  font-size: var(--izio-selector-font-size, 16px);
  white-space: nowrap;
  pointer-events: none;
}

.izio-pet-selector--loading-text.izio-pet-selector--loading .izio-pet-selector__loading-label {
  display: flex;
}

.izio-pet-selector--loading-text.izio-pet-selector--loading .izio-pet-selector__select {
  color: transparent;
}

.izio-pet-selector--loader-right .izio-pet-selector__loader {
  inset-inline-end: calc(var(--izio-selector-horizontal-padding, 12px) + 22px);
}

.izio-pet-selector--loader-left .izio-pet-selector__loader {
  inset-inline-start: var(--izio-selector-horizontal-padding, 12px);
}

.izio-pet-selector--loader-left .izio-pet-selector__select {
  padding-inline-start: calc(var(--izio-selector-horizontal-padding, 12px) + var(--izio-selector-loader-size, 16px) + 8px);
}

@keyframes izio-pet-selector-spin {
  to {
    transform: rotate(360deg);
  }
}

.izio-pet-selector__status {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.875rem;
}

.izio-pet-selector__status:empty {
  display: none;
}

.izio-pet-selector__status--loading {
  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;
}

.izio-pet-selector__status--error {
  color: #b42318;
}

.izio-pet-selector__modal[hidden] {
  display: none !important;
}

.izio-pet-selector__modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 18px;
}

.izio-pet-selector__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, var(--izio-selector-modal-overlay-opacity, .45));
  cursor: default;
}

.izio-pet-selector__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--izio-selector-modal-max-width, 420px));
  max-height: min(80vh, 680px);
  overflow: hidden;
  border-radius: var(--izio-selector-modal-border-radius, 18px);
  color: var(--izio-selector-text-color, #182230);
  background: var(--izio-selector-modal-background-color, #fff);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.izio-pet-selector__dialog-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 13px;
  border-bottom: 1px solid rgba(128, 128, 128, .2);
}

.izio-pet-selector__dialog-header h2 {
  flex: 1 1 auto;
  margin: 0;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1.3;
}

.izio-pet-selector__dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: rgba(128, 128, 128, .12);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.izio-pet-selector__options {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.izio-pet-selector__options > p {
  margin: 10px 0;
  text-align: center;
}

.izio-pet-selector__option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(128, 128, 128, .22);
  border-radius: 12px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.izio-pet-selector__option:hover,
.izio-pet-selector__option:focus-visible {
  border-color: currentColor;
  background: rgba(128, 128, 128, .08);
}

.izio-pet-selector__option--selected {
  border-color: currentColor;
  background: rgba(128, 128, 128, .12);
}

.izio-pet-selector__option-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.izio-pet-selector__option-name,
.izio-pet-selector__option-details {
  display: block;
}

.izio-pet-selector__option-name {
  font-weight: 700;
}

.izio-pet-selector__option-details {
  margin-top: 2px;
  font-size: .82em;
  opacity: .7;
}

.izio-pet-selector__option-check {
  width: 10px;
  height: 6px;
  flex: 0 0 10px;
  border-inline-start: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0;
}

.izio-pet-selector__option--selected .izio-pet-selector__option-check {
  opacity: 1;
}

html.izio-pet-selector-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .izio-pet-selector__modal {
    align-items: end;
    padding: 10px;
  }

  .izio-pet-selector__dialog {
    width: 100%;
    max-height: min(82vh, 680px);
  }
}

.izio-pet-selector--notice {
  padding: 0.75rem 1rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
}

.izio-compatibility-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0.35rem 0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  background: #eef2f6;
  color: #344054;
  position: relative;
  z-index: 1;
}

.izio-compatibility-badge--recommended,
.izio-compatibility-badge--compatible {
  background: #e8f7ef;
  color: #087443;
}

.izio-compatibility-badge--warning {
  background: #fff4db;
  color: #8a4b00;
}

.izio-compatibility-badge--incompatible {
  background: #feeceb;
  color: #b42318;
}
