/* account island styles (plan 01, lane W3b): account.html and the wishlist hearts on product cards and pages.
   Uses style.css tokens only; buttons, chips and fields reuse .btn, .chip, .field. */

.acc-page {
  padding-top: calc(var(--nav-h) + clamp(1.6rem, 3.2vw, 2.6rem));
}
.acc-head {
  max-width: 62ch;
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}
.acc-head .lead {
  margin-top: 0.9rem;
}

.acc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.acc-hello {
  font-family: var(--display);
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  color: var(--hd);
}

/* Tabs */
.acc-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.2rem, 2.4vw, 1.8rem);
}
.acc-tab {
  flex: none;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--tx-2);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.acc-tab:hover {
  color: var(--tx);
}
.acc-tab[aria-selected="true"] {
  color: var(--hd);
  border-bottom-color: var(--flame);
}
.acc-tab:focus-visible,
.acc-panel:focus-visible,
.acc-order-link:focus-visible,
.acc-heart:focus-visible {
  outline: 3px solid var(--flame);
  outline-offset: 2px;
}
.acc-panel {
  outline: none;
}

.acc-h {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem);
  line-height: 1.1;
  color: var(--hd);
  margin: 0 0 0.9rem;
}
.acc-h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--hd);
  margin: 0 0 0.6rem;
}
.acc-muted {
  color: var(--tx-2);
  font-size: 0.9rem;
}
.acc-small {
  font-size: 0.8rem;
}
.acc-loading {
  color: var(--tx-2);
  padding: 1.5rem 0;
}
.acc-status {
  min-height: 1.2em;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--tx);
}
.acc-status.is-bad,
.acc-photo-err {
  color: var(--brick);
}
.acc-photo-err {
  font-size: 0.8rem;
}
.acc-note {
  white-space: pre-line;
  overflow-wrap: anywhere;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--saffron);
  background: var(--panel);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 0.4rem 0;
}
.acc-sec {
  margin-top: clamp(1.4rem, 3vw, 2rem);
  padding-top: clamp(1.2rem, 2.4vw, 1.6rem);
  border-top: 1px solid var(--line);
}
.acc-empty {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.acc-gate {
  margin-top: 0.5rem;
}
.acc-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--hd);
}
.acc-chips {
  margin-bottom: 1.2rem;
}
.acc-more {
  margin-top: 1rem;
}
.acc-danger {
  color: var(--brick);
}

/* Status pills */
.acc-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--panel-2);
  color: var(--hd);
  white-space: nowrap;
}
.acc-pill-delivered {
  background: #e3f3e6;
  color: #1d5b2a;
}
.acc-pill-shipped,
.acc-pill-packed,
.acc-pill-paid {
  background: #fdebd3;
  color: #7a3b05;
}
.acc-pill-cancelled,
.acc-pill-refunded,
.acc-pill-partially-refunded {
  background: var(--panel-2);
  color: var(--tx-2);
}
.acc-pill-awaiting-payment {
  background: #fbe2df;
  color: #8a1410;
}
.acc-pill-default {
  margin-left: 0.5rem;
}

/* Orders list */
.acc-orders,
.acc-addrs,
.acc-claims,
.acc-wish,
.acc-reviews {
  display: grid;
  gap: 0.7rem;
}
.acc-order-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
  transition:
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.acc-order-link:hover {
  border-color: var(--line-2);
  box-shadow: 0 10px 24px -18px rgba(60, 10, 6, 0.5);
}
.acc-order-link img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg-3);
}
.acc-order-main {
  display: grid;
  gap: 0.15rem;
}
.acc-order-side {
  display: grid;
  justify-items: end;
  gap: 0.3rem;
}

/* Order detail */
.acc-ohead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
}
.acc-ohead .acc-h {
  margin: 0;
  outline: none;
}
.acc-ohead .acc-muted {
  flex-basis: 100%;
}
.acc-actions {
  margin-top: 1rem;
}
.acc-lines {
  display: grid;
  gap: 0.6rem;
}
.acc-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
}
.acc-line img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg-3);
}
.acc-line-name {
  overflow-wrap: anywhere;
}
.acc-totals {
  display: grid;
  gap: 0.3rem;
  max-width: 22rem;
  margin: 1rem 0 0 auto;
}
.acc-trow {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.acc-trow.is-total {
  font-weight: 700;
  font-size: 1.05rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}
.acc-addr {
  line-height: 1.5;
}

/* Tracking timeline */
.acc-ship + .acc-ship {
  margin-top: 1rem;
}
.acc-tl {
  position: relative;
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding-left: 1.4rem;
}
.acc-tl::before {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line-2);
}
.acc-tl li {
  position: relative;
  font-size: 0.92rem;
}
.acc-tl li::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 0.38rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-2);
}
.acc-tl li.is-now::before {
  background: var(--flame);
  border-color: var(--flame);
}

/* Forms (review, claim, address, profile) */
.acc-form {
  margin-top: 0.9rem;
  padding: clamp(1rem, 2.4vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
}
.acc-form fieldset {
  border: 0;
  display: grid;
  gap: 0.45rem;
}
.acc-form legend {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.acc-stars {
  display: flex;
  flex-wrap: wrap;
}
.acc-stars legend {
  width: 100%;
}
.acc-star,
.acc-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.9rem;
}
.acc-choices ul {
  display: grid;
  gap: 0.5rem;
}
.acc-claim-line {
  display: grid;
  grid-template-columns: auto 1fr 5rem;
  align-items: center;
  gap: 0.6rem;
}
.acc-qty {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}
.acc-qty:disabled {
  opacity: 0.5;
}
.acc-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.acc-form input[type="radio"],
.acc-form input[type="checkbox"],
.acc-consent input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--flame);
}
.acc-review-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.acc-review-item .acc-form {
  flex-basis: 100%;
}
.acc-confirm span {
  font-weight: 700;
}

/* Photos */
.acc-file {
  padding: 0.6rem !important;
}
.acc-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.acc-thumb {
  position: relative;
}
.acc-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.acc-thumb-x {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 0;
  background: var(--tx);
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
}

/* Addresses */
.acc-addr-card {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
}
.acc-addr-card .co-row {
  margin-top: 0.5rem;
}
.acc-addr-top {
  display: flex;
  align-items: center;
}
.acc-formbox:not(:empty) {
  margin-top: 1rem;
}

/* Profile */
.acc-consents {
  display: grid;
  gap: 0.9rem;
  margin: 0.8rem 0;
}
.acc-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
}
.acc-consent label {
  font-weight: 700;
}
[data-delete-note] {
  margin-top: 1rem;
}

/* Wishlist tab */
.acc-wish {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.acc-wish-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
}
.acc-wish-card img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.acc-wish-name {
  font-weight: 700;
  color: var(--hd);
}

/* Hearts on product cards and pages */
.acc-heart {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--hd);
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    background 0.25s var(--ease),
    color 0.25s var(--ease);
}
/* Card hearts sit on the card (above its stretched link), lined up with the image box's corner. */
.pcard > .acc-heart {
  top: calc(9px + 0.6rem);
  right: calc(9px + 0.6rem);
}
.acc-heart .ic {
  width: 1.2rem;
  height: 1.2rem;
}
.acc-heart:hover {
  transform: scale(1.06);
}
.acc-heart.is-on {
  background: var(--brick);
  border-color: var(--brick);
  color: #fff;
}
.acc-heart:disabled {
  opacity: 0.6;
}
.acc-heart-lg {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-pill);
  margin: 0.6rem 0;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Header initials (W3a's badge, refined here per W3a's request) */
.cm-initials {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
}

@media (max-width: 640px) {
  .acc-order-link {
    grid-template-columns: auto 1fr;
  }
  .acc-order-side {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: space-between;
    justify-items: start;
  }
  .acc-totals {
    margin-left: 0;
  }
  .acc-claim-line {
    grid-template-columns: auto 1fr 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acc-heart,
  .acc-order-link,
  .acc-tab {
    transition: none;
  }
}
