/* ── My Pets & Me ─────────────────────────────────────────────────────────── */
/*
 * Loaded on every My Account page (see starter_my_pets_assets()): the same file styles the pet cards
 * on My Pets & Me, the "Your birthday" card there, the birthday notices on the dashboard and the
 * "£5 treat" badge in the account menu. Markup for the birthday parts: mu-plugins/pw-birthday.php.
 */

:root {
  --pw-bday-green: #234B4D;      /* headings, buttons, icons */
  --pw-bday-text: #3B4336;       /* body copy */
  --pw-bday-muted: #495444;      /* fine print */
  --pw-bday-lime: #DCE5A6;       /* card border, light button */
  --pw-bday-lime-bg: #EEF1D2;    /* card / saved-notice fill */
  --pw-bday-maroon: #602311;     /* "Pet parent" eyebrow, paw icon */
  --pw-bday-plum: #7B3A62;       /* envelope icon */
  --pw-bday-pink: #C67DAA;       /* dashed voucher edge */
  --pw-bday-pink-line: #E9C9E0;  /* "not opted in" notice border */
  --pw-bday-pink-bg: #F6E6F0;    /* "not opted in" icon disc */
  --pw-bday-field: #C9CCBF;      /* form-field borders */
}

/* Page title */
.pw-pets-title {
  color: var(--pw-bday-green);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 900;
}

.pw-pets-wrap .pw-sub-hero {
  padding: 0.25rem 0 0;
}

.pw-pets-wrap .pw-sub-subtitle {
  color: var(--pw-bday-text);
  font-size: 1.05rem;
  max-width: 48rem;
}

/* ── Buttons (shared by the birthday card + notices) ─────────────────────── */

.pw-bday-btn {
  display: inline-block;
  background: var(--pw-bday-green);
  color: #fff;
  border: 2px solid var(--pw-bday-green);
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1.65rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pw-bday-btn:hover,
.pw-bday-btn:focus {
  background: #173436;
  border-color: #173436;
  color: #fff;
}

/* Pale-green variant: sits on the dark "nudge" notice */
.pw-bday-btn--light {
  background: var(--pw-bday-lime);
  border-color: var(--pw-bday-lime);
  color: #2F4219;
}

.pw-bday-btn--light:hover,
.pw-bday-btn--light:focus {
  background: #cfdb8c;
  border-color: #cfdb8c;
  color: #2F4219;
}

/* typography.css centres every bare h2; these components are left-aligned throughout. */
.pw-bday-card,
.pw-bday-notice,
.pw-bday-card__title,
.pw-bday-notice__title {
  text-align: left;
}

/* "PET PARENT" label above a heading */
.pw-bday-eyebrow {
  margin: 0 0 0.15rem;
  color: var(--pw-bday-maroon);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.3;
}

/* ── "When's your birthday?" card (My Pets & Me, no birthday saved yet) ──── */

.pw-bday-section {
  margin: 1.75rem 0 2.25rem;
  scroll-margin-top: 6rem;
}

.pw-bday-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  grid-template-areas:
    "head head"
    "form voucher";
  column-gap: 2.25rem;
  row-gap: 1.1rem;
  background: var(--pw-bday-lime-bg);
  border: 2px solid var(--pw-bday-lime);
  border-radius: 28px;
  padding: 1.75rem 2rem 2rem;
}

.pw-bday-card__head {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pw-bday-card__avatar {
  flex: 0 0 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--pw-bday-green);
  color: #fff;
  display: grid;
  place-items: center;
}

.pw-bday-card__avatar .pw-bday-svg {
  width: 1.7rem;
  height: 1.7rem;
}

.pw-bday-card__title {
  margin: 0;
  color: var(--pw-bday-green);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.15;
}

.pw-bday-card__form {
  grid-area: form;
  min-width: 0;
}

.pw-bday-card__text {
  margin: 0 0 1.1rem;
  color: var(--pw-bday-text);
  line-height: 1.55;
}

.pw-bday-card__text strong {
  color: var(--pw-bday-green);
}

.pw-bday-fields {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.pw-bday-field {
  flex: 0 0 7rem;
}

.pw-bday-field--month {
  flex-basis: 11.5rem;
}

.pw-bday-field label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--pw-bday-green);
  font-size: 0.85rem;
  font-weight: 700;
}

.pw-bday-field .form-select {
  height: 2.9rem;
  padding: 0.5rem 2.2rem 0.5rem 0.9rem;
  background-color: #fff;
  border: 1.5px solid var(--pw-bday-field);
  border-radius: 10px;
  color: var(--pw-bday-green);
  font-size: 1rem;
}

.pw-bday-field .form-select:focus {
  border-color: var(--pw-bday-green);
  box-shadow: 0 0 0 3px rgba(35, 75, 77, 0.15);
}

.pw-bday-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
  color: var(--pw-bday-text);
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
}

.pw-bday-check input {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--pw-bday-green);
}

.pw-bday-card__fine {
  margin: 1.1rem 0 0;
  max-width: 28rem;
  color: var(--pw-bday-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pw-bday-card__fine a {
  color: var(--pw-bday-green);
  text-decoration: underline;
}

.pw-bday-card__voucher {
  grid-area: voucher;
  align-self: start;
}

/* The white dashed voucher (decorative) */
.pw-bday-voucher {
  background: #fff;
  border: 2px dashed var(--pw-bday-pink);
  border-radius: 14px;
  padding: 1.2rem 1.5rem 1.15rem;
  box-shadow: 0 6px 16px rgba(35, 75, 77, 0.08);
}

.pw-bday-voucher p {
  margin: 0;
}

.pw-bday-voucher__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pw-bday-maroon);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pw-bday-voucher__eyebrow .pw-bday-svg {
  width: 1.1rem;
  height: 1.1rem;
}

.pw-bday-voucher__amount {
  margin: 0.45rem 0 0.35rem !important;
  color: var(--pw-bday-green);
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1;
}

.pw-bday-voucher__script {
  color: var(--pw-bday-green);
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  line-height: 1.1;
}

.pw-bday-voucher__note {
  margin-top: 0.6rem !important;
  color: var(--pw-bday-muted);
  font-size: 0.75rem;
}

/* ── Notices: saved & opted in / saved but not opted in / dashboard nudge ── */

.pw-bday-notice {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.75rem;
  padding: 1.5rem 1.75rem;
  border-radius: 28px;
}

.pw-bday-notice__icon {
  flex: 0 0 3.6rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.pw-bday-notice__icon .pw-bday-svg {
  width: 1.75rem;
  height: 1.75rem;
}

.pw-bday-notice__body {
  flex: 1 1 auto;
  min-width: 0;
}

.pw-bday-notice__title {
  margin: 0;
  color: var(--pw-bday-green);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.15;
}

.pw-bday-notice__text {
  margin: 0.25rem 0 0;
  color: var(--pw-bday-text);
  font-size: 1.05rem;
  line-height: 1.4;
}

.pw-bday-notice__fine {
  margin: 0.45rem 0 0;
  color: var(--pw-bday-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.pw-bday-notice__action {
  flex: 0 0 auto;
  margin: 0;
}

/* 1 · saved, opted in */
.pw-bday-notice--saved {
  background: var(--pw-bday-lime-bg);
  border: 2px solid var(--pw-bday-lime);
}

.pw-bday-notice--saved .pw-bday-notice__icon {
  background: var(--pw-bday-green);
  color: #fff;
}

.pw-bday-chip {
  flex: 0 0 auto;
  padding: 0.55rem 1.3rem 0.6rem;
  background: #fff;
  border: 2px dashed var(--pw-bday-pink);
  border-radius: 12px;
  color: var(--pw-bday-green);
  font-family: 'Caveat', cursive;
  font-size: 1.75rem;
  line-height: 1.1;
  white-space: nowrap;
}

/* 2 · saved, but not opted in to emails */
.pw-bday-notice--optin {
  background: #fff;
  border: 2px solid var(--pw-bday-pink-line);
}

.pw-bday-notice--optin .pw-bday-notice__icon {
  background: var(--pw-bday-pink-bg);
  color: var(--pw-bday-plum);
}

/* 3 · dashboard nudge (no birthday saved yet) */
.pw-bday-notice--nudge {
  background: var(--pw-bday-green);
  border-radius: 24px;
  padding: 1.3rem 1.75rem;
  gap: 1.25rem;
}

.pw-bday-notice--nudge .pw-bday-notice__icon {
  flex-basis: 3.1rem;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0;
  color: var(--pw-bday-lime);
}

.pw-bday-notice--nudge .pw-bday-notice__icon .pw-bday-svg {
  width: 3.1rem;
  height: 3.1rem;
}

.pw-bday-notice__script {
  margin: 0;
  color: var(--pw-bday-lime);
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  line-height: 1.05;
}

.pw-bday-notice--nudge .pw-bday-notice__text {
  margin-top: 0.15rem;
  color: #F2F1EC;
}

/* ── "£5 treat" badge on the My Pets & Me menu item ──────────────────────── */

.pw-nav-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.55rem 0.2rem;
  border-radius: 999px;
  background: var(--pw-bday-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── "Your pets" section ─────────────────────────────────────────────────── */

.pw-pets-section__title {
  margin: 0 0 0.5rem;
  color: var(--pw-bday-green);
  font-size: 1.75rem;
  font-weight: 900;
  text-align: left;
}

.pw-pets-section__intro {
  margin: 0;
  max-width: 48rem;
  color: var(--pw-bday-text);
}

/* ── Pet cards ───────────────────────────────────────────────────────────── */

.pw-pet-card {
  background: #fff;
  border: 1.5px solid #DADFD0 !important;
  border-radius: 20px !important;
  box-shadow: none;
  transition: box-shadow 0.15s ease;
}

.pw-pet-card:hover {
  box-shadow: 0 4px 18px rgba(35, 75, 77, 0.09);
}

/* Newly added (unsaved) card gets a dashed green border */
.pw-pet-card--new {
  border-style: dashed !important;
  border-color: var(--pw-bday-green) !important;
}

/* Paw: the 🐾 emoji is swapped for a flat maroon paw by masking — no markup change, so the
   server-rendered cards and the JS-cloned "Add to Family" cards both pick it up. */
.pw-pet-icon {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0;
  line-height: 0;
  color: transparent;
  user-select: none;
  background: var(--pw-bday-maroon);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='5.2' cy='11' rx='2.1' ry='2.7' transform='rotate(-18 5.2 11)'/%3E%3Cellipse cx='9.4' cy='5.8' rx='2.2' ry='3'/%3E%3Cellipse cx='14.6' cy='5.8' rx='2.2' ry='3'/%3E%3Cellipse cx='18.8' cy='11' rx='2.1' ry='2.7' transform='rotate(18 18.8 11)'/%3E%3Cpath d='M12 11.2c-3.3 0-6.2 3.3-6.2 6 0 2 1.5 2.9 3.2 2.9 1.2 0 2-.5 3-.5s1.8.5 3 .5c1.7 0 3.2-.9 3.2-2.9 0-2.7-2.9-6-6.2-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='5.2' cy='11' rx='2.1' ry='2.7' transform='rotate(-18 5.2 11)'/%3E%3Cellipse cx='9.4' cy='5.8' rx='2.2' ry='3'/%3E%3Cellipse cx='14.6' cy='5.8' rx='2.2' ry='3'/%3E%3Cellipse cx='18.8' cy='11' rx='2.1' ry='2.7' transform='rotate(18 18.8 11)'/%3E%3Cpath d='M12 11.2c-3.3 0-6.2 3.3-6.2 6 0 2 1.5 2.9 3.2 2.9 1.2 0 2-.5 3-.5s1.8.5 3 .5c1.7 0 3.2-.9 3.2-2.9 0-2.7-2.9-6-6.2-6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Field labels inside cards */
.pw-pets-field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pw-bday-green);
  margin-bottom: 0.3rem;
}

.pw-pet-card .form-control,
.pw-pet-card .form-select {
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  background-color: #fff;
  border: 1.5px solid var(--pw-bday-field);
  border-radius: 10px;
  color: #2F3B34;
  font-size: 1rem;
}

.pw-pet-card .form-select {
  padding-right: 2.2rem;
}

.pw-pet-card .form-control:focus,
.pw-pet-card .form-select:focus {
  border-color: var(--pw-bday-green);
  box-shadow: 0 0 0 3px rgba(35, 75, 77, 0.15);
}

.pw-pet-card .form-control::placeholder {
  color: #6F7568;
}

/* A saved (locked) date reads as a value, not a live field */
.pw-pet-card .form-control[readonly] {
  background-color: #fff;
}

/* ── Remove button ───────────────────────────────────────────────────────── */

.pw-pet-remove-btn {
  background: transparent;
  border: none;
  color: #4B5A56;
  font-size: 0.9rem;
  padding: 0.15rem 0.4rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.pw-pet-remove-btn:hover,
.pw-pet-remove-btn:focus {
  background: transparent;
  border: none;
  color: #dc3545;
  box-shadow: none;
}

/* Photo: flat grey disc + outlined "Add photo" button. (The structural bits are in an inline
   <style> in pw-my-pets.php, which prints after this file — hence the extra specificity.) */
.pw-pets-wrap .pw-pet-photo-preview {
  width: 78px;
  height: 78px;
  border: 0;
  background: #EBE9E1;
}

.pw-pets-wrap .pw-pet-photo-placeholder {
  color: #7A7F73;
}

.pw-pets-wrap .pw-pet-photo-label {
  background: #fff;
  border: 2px solid var(--pw-bday-green);
  border-radius: 10px;
  color: var(--pw-bday-green);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
}

.pw-pets-wrap .pw-pet-photo-label:hover {
  background: var(--pw-bday-green);
  color: #fff;
}

/* Favourite-product chips */
.pw-pets-wrap .pw-fav-chip {
  background: var(--pw-bday-lime-bg);
  border-radius: 10px;
  color: var(--pw-bday-green);
  font-weight: 700;
  padding: 5px 10px 5px 9px;
}

/* ── Add Pet button (outline green pill) ─────────────────────────────────── */

.pw-btn-add-pet {
  background: #fff;
  color: var(--pw-bday-green);
  border: 2px solid var(--pw-bday-green) !important;
  border-radius: 999px;
  font-weight: 700;
  padding: 0.65rem 1.6rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.pw-btn-add-pet:hover,
.pw-btn-add-pet:focus {
  background: var(--pw-bday-green);
  color: #fff;
  border-color: var(--pw-bday-green);
}

/* ── Save Changes button (filled green pill) ─────────────────────────────── */

.pw-btn-save-pets {
  background: var(--pw-bday-green);
  color: #fff;
  border: 2px solid var(--pw-bday-green);
  border-radius: 999px;
  font-weight: 700;
  padding: 0.8rem 1.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pw-btn-save-pets:hover,
.pw-btn-save-pets:focus {
  background: #173436;
  border-color: #173436;
  color: #fff;
}

/* ── Small screens ───────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
  .pw-bday-section {
    margin: 1.25rem 0 1.75rem;
  }

  /* Birthday card: voucher first, then the heading and form, full width */
  .pw-bday-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "voucher"
      "head"
      "form";
    row-gap: 1rem;
    padding: 1.25rem 1.1rem 1.4rem;
    border-radius: 22px;
  }

  .pw-bday-card__avatar {
    display: none;
  }

  .pw-bday-card__title {
    font-size: 1.45rem;
  }

  .pw-bday-card__voucher {
    justify-self: center;
  }

  .pw-bday-voucher {
    padding: 0.9rem 1.5rem 0.85rem;
    text-align: center;
  }

  .pw-bday-voucher__eyebrow,
  .pw-bday-voucher__note,
  .pw-bday-voucher__hb {
    display: none;
  }

  .pw-bday-voucher__amount {
    margin: 0 0 0.2rem !important;
    font-size: 3rem;
  }

  .pw-bday-voucher__script {
    font-size: 1.35rem;
  }

  .pw-bday-fields {
    gap: 0.75rem;
  }

  .pw-bday-field {
    flex: 1 1 38%;
  }

  .pw-bday-field--month {
    flex: 1 1 62%;
  }

  .pw-bday-card .pw-bday-btn {
    display: block;
    width: 100%;
  }

  /* Notices: icon + words on one row, the action (button / voucher chip) underneath */
  .pw-bday-notice {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.1rem;
    border-radius: 22px;
  }

  .pw-bday-notice__icon {
    flex-basis: 2.9rem;
    width: 2.9rem;
    height: 2.9rem;
  }

  .pw-bday-notice__icon .pw-bday-svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  .pw-bday-notice__body {
    flex: 1 1 calc(100% - 4.2rem);
  }

  .pw-bday-notice__title {
    font-size: 1.4rem;
  }

  .pw-bday-notice__text {
    font-size: 1rem;
  }

  .pw-bday-notice__action,
  .pw-bday-notice > .pw-bday-btn,
  .pw-bday-chip {
    flex: 1 1 100%;
  }

  .pw-bday-chip {
    text-align: center;
    white-space: normal;
    font-size: 1.5rem;
  }

  .pw-bday-notice__action .pw-bday-btn,
  .pw-bday-notice > .pw-bday-btn {
    display: block;
    width: 100%;
  }

  .pw-bday-notice--nudge .pw-bday-notice__icon {
    flex-basis: 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
  }

  .pw-bday-notice--nudge .pw-bday-notice__icon .pw-bday-svg {
    width: 2.4rem;
    height: 2.4rem;
  }

  .pw-bday-notice__script {
    font-size: 1.6rem;
  }

  .pw-pets-section__title {
    font-size: 1.5rem;
  }
}
