/* ── Header ──────────────────────────────────────────────────────────────── */

.ccd-pets-header {
  margin-bottom: 1.5em;
}

.ccd-pets-add-btn {
  font-weight: 600;
}

.ccd-pets-empty {
  color: #888;
  font-style: italic;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

.ccd-pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25em;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.ccd-pet-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  background: #fff;
}

.ccd-pet-card__icon {
  font-size: 2.5em;
  line-height: 1;
}

.ccd-pet-card__name {
  margin: 0 0 0.4em;
  font-size: 1.1em;
}

.ccd-pet-card__info {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9em;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.ccd-pet-card__info span {
  font-weight: 600;
  color: #333;
  margin-right: 0.3em;
}

.ccd-pet-card__actions {
  margin-top: auto;
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}

.ccd-pet-card__actions .button {
  flex: 1;
  text-align: center;
  font-size: 0.85em;
  padding: 0.5em 0.75em;
}

.ccd-pet-card__actions form {
  flex: 1;
  margin: 0;
}

.ccd-pet-card__actions form .button {
  width: 100%;
}

.ccd-pet-card__delete {
  background: transparent !important;
  border-color: #c00 !important;
  color: #c00 !important;
}

.ccd-pet-card__delete:hover {
  background: #c00 !important;
  color: #fff !important;
}

/* ── Form ────────────────────────────────────────────────────────────────── */

.ccd-pet-form {
  width: 100%;
  max-width: 640px;
}

.ccd-pet-form .form-row {
  margin-bottom: 1.15em;
}

.ccd-pet-form .form-row input,
.ccd-pet-form .form-row select {
  width: 100%;
  background-color: #eaeaea;
  border-radius: 30px;
  margin: 0;
}

.ccd-input-suffix-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #eaeaea;
  border-radius: 30px;
}

.ccd-input-suffix-wrap input[type="number"] {
  border: none !important;
  outline: none;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}

.ccd-input-suffix {
  padding: 0 0.6em;
  background: #f5f5f5;
  border-left: 1px solid #ccc;
  color: #666;
  font-size: 0.9em;
  white-space: nowrap;
  line-height: 1;
  display: flex;
  align-items: center;
  align-self: stretch;
}

.ccd-pet-form .form-row-first,
.ccd-pet-form .form-row-last {
  width: 48%;
  display: inline-block;
}

.ccd-pet-form .form-row-last {
  float: right;
}

.ccd-pet-form .form-row:last-child {
  display: flex;
  gap: 0.75em;
  margin-top: 0.5em;
  clear: both;
}

.ccd-pet-form__actions {
  display: flex !important;
  align-items: stretch;
  gap: 0.75em !important;
  margin-top: 0.75em !important;
  clear: both;
}

.ccd-pet-form__actions .button {
  margin: 0 !important;
  float: none !important;
  position: static !important;
  transform: none !important;
}

.ccd-pet-form__checkboxes > label:first-child {
  display: block;
  margin-bottom: 0.5em;
}

.ccd-pet-form__checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1em;
}

.ccd-pet-form__checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 400;
  cursor: pointer;
}

.ccd-pet-form__checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  background: none;
  border-radius: 0;
  cursor: pointer;
}

@media (max-width: 600px) {
  .ccd-pet-form {
    padding: 0 15px;
  }

  .ccd-pet-form .form-row {
    margin-bottom: 1.45em;
  }

  .ccd-pet-form .form-row-first,
  .ccd-pet-form .form-row-last {
    width: 100%;
    display: block;
    float: none;
  }

  /* Keep the primary and cancel actions separated on narrow screens. */
  .ccd-pet-form .form-row:last-child {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 1.25em !important;
  }

  .ccd-pet-form .form-row:last-child .button {
    width: 100% !important;
    min-height: 48px;
    margin: 0 !important;
    box-sizing: border-box;
    text-align: center;
  }

  .ccd-pet-form__actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-top: 1.35em !important;
  }

  .ccd-pet-form__actions .button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    float: none !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  .ccd-pet-form__checkboxes {
    margin-top: 0.35em;
  }
}

/* ── Pet photo ───────────────────────────────────────────────────────────── */

.ccd-pet-card__photo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 116px;
}

.ccd-pet-card__photo-img,
.ccd-pet-card__photo-placeholder {
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.ccd-pet-card__photo-img {
  display: block;
  object-fit: cover;
  border: 1px solid #ececec;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.07);
}

.ccd-pet-card__photo-placeholder {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  color: #555 !important;
  background: #fffafa;
  border: 1px dashed rgba(193, 23, 26, 0.5);
  text-decoration: none !important;
  text-align: center;
  font-size: 0.76em;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ccd-pet-card__photo-placeholder:hover,
.ccd-pet-card__photo-placeholder:focus-visible {
  color: #c1171a !important;
  background: #fff5f5;
  border-color: #c1171a;
  transform: translateY(-1px);
}

.ccd-pet-card__photo-paw {
  display: block;
  font-size: 1.65em;
  line-height: 1;
}

.ccd-pet-photo-field {
  margin: 0 0 1.4em !important;
  padding: 18px;
  background: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  scroll-margin-top: 120px;
}

.ccd-pet-photo-field > label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

.ccd-pet-photo-field__optional {
  color: #777;
  font-weight: 400;
}

.ccd-pet-photo-field__layout {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ccd-pet-photo-field__preview {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px dashed #d7d7d7;
}

.ccd-pet-photo-field__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ccd-pet-photo-field__placeholder {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  color: #666;
}

.ccd-pet-photo-field__placeholder span {
  font-size: 1.65em;
  line-height: 1;
}

.ccd-pet-photo-field__placeholder strong {
  font-size: 0.78em;
  line-height: 1.2;
}

.ccd-pet-photo-field__controls {
  flex: 1;
  min-width: 0;
}

.ccd-pet-photo-field__controls input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.ccd-pet-photo-field__controls small {
  display: block;
  color: #777;
  font-size: 0.82em;
  line-height: 1.4;
}

.ccd-pet-photo-field__admin-size {
  margin-top: 8px;
  color: #555 !important;
  font-size: 0.76em !important;
}

.ccd-pet-photo-field__remove {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #8a2525;
  font-size: 0.86em;
  font-weight: 500;
  cursor: pointer;
}

.ccd-pet-photo-field__remove input[type="checkbox"] {
  width: auto !important;
  margin: 0 !important;
}

@media (max-width: 600px) {
  .ccd-pet-photo-field {
    margin-bottom: 1.8em !important;
    padding: 16px;
  }

  .ccd-pet-photo-field__layout {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ccd-pet-photo-field__preview {
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    margin: 0 auto;
  }

  .ccd-pet-photo-field__controls {
    width: 100%;
  }

  .ccd-pet-photo-field__controls input[type="file"] {
    min-height: 50px;
  }
}
