/* the loyalty join page (templates/loyalty.liquid), web-v3's /loyalty in the theme's colours */
.ly {
  --ly-muted: #6b6b6b;
  --ly-border: #e7e7e7;
  --ly-soft-bg: #f5f5f5;
  --ly-brand-soft: color-mix(in srgb, var(--brand) 9%, transparent);
  width: min(100% - 2rem, 36rem);
  margin-inline: auto;
  padding-block: 1.5rem 4rem;
}

@media (min-width: 640px) {
  .ly {
    padding-block-start: 2.5rem;
  }
}

.ly p,
.ly h1,
.ly h2 {
  margin: 0;
}

.ly-i {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.ly-i--lg {
  width: 1.375rem;
  height: 1.375rem;
}

.ly-spin {
  animation: ly-spin 0.8s linear infinite;
}

@keyframes ly-spin {
  to {
    transform: rotate(360deg);
  }
}

.ly-center {
  text-align: center;
}

.ly-muted {
  color: var(--ly-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.ly-soft {
  color: color-mix(in srgb, #fff 75%, transparent);
  font-size: 0.875rem;
}

.ly-strong {
  font-weight: 600;
}

.ly-medium {
  font-weight: 500;
}

.ly-brand {
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.ly-lg {
  font-size: 1.125rem;
  font-weight: 600;
}

.ly-xl {
  font-size: 1.25rem;
  font-weight: 600;
}

.ly-error {
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
}

.ly-error[hidden],
.ly [hidden] {
  display: none !important;
}

.ly-mt1 { margin-block-start: 0.375rem !important; }
.ly-mt2 { margin-block-start: 0.5rem !important; }
.ly-mt3 { margin-block-start: 0.75rem !important; }
.ly-mt4 { margin-block-start: 1rem !important; }
.ly-mt5 { margin-block-start: 1.25rem !important; }

.ly-truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ly-min {
  min-width: 0;
}

.ly-grow {
  min-width: 0;
  flex: 1;
}

/* buttons */
.ly-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid var(--brand);
  border-radius: 0.875rem;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), opacity 160ms ease;
}

.ly-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.ly-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ly-btn--block {
  width: 100%;
  min-height: 3.25rem;
  margin-block-start: 1.75rem;
  border-radius: 1rem;
  font-size: 1rem;
}

.ly-btn--outline {
  background: transparent;
  border-color: var(--ly-border);
  color: inherit;
}

.ly-btn--sm {
  min-height: 2.25rem;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
}

.ly-link {
  margin-block-start: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.ly-link:hover,
.ly-link:focus-visible {
  text-decoration: underline;
}

.ly-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.ly-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--ly-brand-soft);
  color: var(--brand);
}

.ly-badge--light {
  background: color-mix(in srgb, #fff 15%, transparent);
  color: #fff;
}

/* the join card */
.ly-join {
  overflow: hidden;
  border: 1px solid var(--ly-border);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.ly-join__hero {
  padding: 2rem 1.5rem 4rem;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.ly-join__eyebrow {
  color: color-mix(in srgb, #fff 75%, transparent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ly-join__title {
  max-width: 24rem;
  margin: 0.5rem auto 0 !important;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}

@media (min-width: 640px) {
  .ly-join__title {
    font-size: 1.875rem;
  }
}

.ly-join__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.75rem auto 0;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  position: relative;
}

.ly-join__logo img {
  width: 100%;
  height: 100%;
  padding: 0.375rem;
  object-fit: contain;
}

.ly-join__logo span {
  color: var(--brand);
  font-size: 1.875rem;
  font-weight: 600;
}

.ly-join__body {
  padding: 1.25rem 1.5rem 1.75rem;
}

@media (min-width: 640px) {
  .ly-join__body {
    padding-inline: 2rem;
  }
}

.ly-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-block: 1.5rem;
  color: var(--ly-muted);
  font-size: 0.875rem;
}

.ly-steps {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.ly-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: var(--ly-soft-bg);
  font-size: 0.875rem;
  font-weight: 500;
}

.ly-steps__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.ly-wallet {
  margin-block-start: 1.25rem;
}

.ly-wallet button {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ly-wallet img {
  height: 2.75rem;
  width: auto;
}

/* the business's loyalty card */
.ly-card {
  padding-block: 2.5rem;
}

.ly-card__eyebrow {
  margin-block-end: 0.5rem !important;
  color: var(--ly-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.ly-card__title {
  margin-block-end: 1.25rem !important;
  font-size: 1.5rem;
  font-weight: 600;
}

.ly-placeholder {
  margin-block-end: 1rem;
  padding: 2rem 1.25rem;
  border-radius: 1rem;
  background: var(--ly-soft-bg);
  color: var(--ly-muted);
  font-size: 0.875rem;
  text-align: center;
}

.ly-balance {
  margin-block-end: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--ly-border);
  border-radius: 1rem;
  background: #fff;
}

.ly-balance--brand {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ly-balance__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.ly-balance__value {
  margin-block-start: 0.25rem !important;
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.ly-stamps {
  margin-block-start: 1.25rem;
  padding: 0.75rem;
  border: 1px solid var(--ly-border);
  border-radius: 0.75rem;
  background: var(--background);
}

.ly-stamps__grid {
  display: grid;
  place-items: center;
  gap: 0.375rem;
}

.ly-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block-end: 1rem;
  padding: 1rem;
  border: 1px solid var(--ly-border);
  border-radius: 1rem;
  background: #fff;
}

.ly-notice--brand {
  flex-direction: column;
  align-items: stretch;
  border-color: color-mix(in srgb, var(--brand) 20%, transparent);
  background: color-mix(in srgb, var(--brand) 4.5%, transparent);
}

.ly-notice--brand .ly-btn {
  width: 100%;
  min-height: 2.5rem;
  border-radius: 0.75rem;
}

@media (min-width: 640px) {
  .ly-notice--brand {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .ly-notice--brand .ly-btn {
    width: auto;
  }
}

.ly-rows {
  display: grid;
  gap: 0.75rem;
}

.ly-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem;
  border: 1px solid var(--ly-border);
  border-radius: 0.75rem;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.ly-row:hover {
  background: var(--ly-soft-bg);
}

.ly-row__text {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.ly-row__arrow {
  color: var(--ly-muted);
  transform: scaleX(var(--dir));
}

/* earn / rewards sheet: a bottom sheet on phones, a dialog from 48rem */
.ly-sheet {
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fff;
  color: inherit;
}

.ly-sheet::backdrop {
  background: rgb(0 0 0 / 0.4);
}

@media (min-width: 48rem) {
  .ly-sheet {
    max-width: 30rem;
    margin: auto;
    border-radius: 1.25rem;
  }
}

.ly-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 1.25rem 1.25rem;
  border-block-end: 1px solid var(--ly-border);
}

.ly-sheet__title {
  font-size: 1.5rem;
  font-weight: 600;
}

.ly-sheet__body {
  padding: 1.5rem 1.25rem max(1rem, env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
  .ly-sheet__header,
  .ly-sheet__body {
    padding-inline: 1.75rem;
  }
}

.riyal {
  display: inline-block;
  vertical-align: -0.125em;
}

/* what @rekaz/headless draws: the stamps, the sheet's services and rewards */
.rk-loyalty__icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.rk-loyalty__icon--spinner {
  animation: ly-spin 0.8s linear infinite;
}

.rk-loyalty__stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 2.25rem;
  min-width: 1rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--ly-brand-soft);
  color: var(--brand);
}

.rk-loyalty__stamp .rk-loyalty__icon {
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 2.3;
}

.rk-loyalty__list {
  display: grid;
  gap: 0.75rem;
}

.rk-loyalty__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--ly-border);
  border-radius: 0.75rem;
}

.rk-loyalty__item--reward {
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
}

.rk-loyalty__text {
  min-width: 0;
  flex: 1;
}

.rk-loyalty__name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

.rk-loyalty__detail,
.rk-loyalty__empty {
  margin-block-start: 0.25rem !important;
  color: var(--ly-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.rk-loyalty__cost {
  margin-block-start: 0.5rem !important;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.rk-loyalty__thumb {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  object-fit: cover;
}

.rk-loyalty__thumb--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand);
}

.rk-loyalty__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--ly-brand-soft);
  color: var(--brand);
}

.rk-loyalty__badge .rk-loyalty__icon {
  width: 1.375rem;
  height: 1.375rem;
}

.rk-loyalty__pill {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--ly-brand-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
}

.rk-loyalty__redeem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  margin-block-start: 0.75rem;
  padding: 0 1rem;
  border: 1px solid var(--ly-border);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.rk-loyalty__redeem:disabled {
  opacity: 0.5;
  cursor: default;
}

.rk-loyalty__rate {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: var(--ly-soft-bg);
}

.rk-loyalty__rate p {
  padding-block-start: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.rk-loyalty__balance {
  margin-block-start: 0.75rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: var(--brand);
  color: #fff;
}

.rk-loyalty__balance-label {
  color: color-mix(in srgb, #fff 75%, transparent);
  font-size: 0.875rem;
}

.rk-loyalty__balance-value {
  margin-block-start: 0.25rem !important;
  font-size: 1.875rem;
  font-weight: 600;
}

.ly-sheet p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rk-loyalty__icon--spinner,
  .ly-spin {
    animation-duration: 2s;
  }
}
