/* Mood Travel CRM — storefront. Inherits theme fonts and text colour;
 * accent and corner radius come from the plugin settings (inline variables). */
:root {
  --mfd-accent: #111827;
  --mfd-radius: 14px;
  --mfd-success: #047857;
  --mfd-warning: #b45309;
  --mfd-danger: #b91c1c;
}

.mfd-options,
.mfd-consent,
.mfd-block-summary,
.mfd-account,
.mfd-schedule__list,
.mfd-plan-list {
  /* Borders and tints follow the theme's text colour, so light and dark themes both work. */
  --mfd-border: rgba(0, 0, 0, 0.12);
  --mfd-muted: rgba(0, 0, 0, 0.6);
  --mfd-accent-soft: rgba(17, 24, 39, 0.05);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  .mfd-options,
  .mfd-consent,
  .mfd-block-summary,
  .mfd-account,
  .mfd-schedule__list,
  .mfd-plan-list {
    --mfd-border: color-mix(in srgb, currentColor 14%, transparent);
    --mfd-muted: color-mix(in srgb, currentColor 62%, transparent);
    --mfd-accent-soft: color-mix(in srgb, var(--mfd-accent) 6%, transparent);
  }
}

/* ------------------------------------------------------------------ */
/* Product page: payment choice block                                  */

.mfd-options {
  display: block;
  clear: both;
  flex: 1 0 100%;
  box-sizing: border-box;
  width: 100%;
  max-width: 580px;
  margin: 0 0 1.25em;
  font: inherit;
  line-height: 1.4;
  text-align: left;
  animation: mfd-reveal 0.2s ease-out;
}

.mfd-options *,
.mfd-options *::before,
.mfd-options *::after {
  box-sizing: border-box;
}

.mfd-options[hidden],
.mfd-options [hidden] {
  display: none !important;
}

@keyframes mfd-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mfd-options__set {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.mfd-options__legend {
  display: block;
  float: left;
  width: 100%;
  margin: 0 0 0.65em;
  padding: 0;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mfd-options__choices {
  clear: both;
  display: grid;
  gap: 0.6em;
}

.mfd-options .mfd-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9em;
  /* Themes often add margins and widths to form labels. */
  width: auto;
  margin: 0;
  padding: 1em 1.1em;
  border: 1px solid var(--mfd-border);
  border-radius: var(--mfd-radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: inherit;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mfd-option:hover {
  border-color: color-mix(in srgb, var(--mfd-accent) 55%, transparent);
}

/* The native radio stays focusable and announced; the circle is drawn so it looks the same in every theme. */
.mfd-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.mfd-option__check {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid var(--mfd-border);
  border-radius: 50%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mfd-option input:checked ~ .mfd-option__check {
  border-color: var(--mfd-accent);
  background: radial-gradient(circle, var(--mfd-accent) 0 42%, transparent 46%);
}

.mfd-option:has(input:checked) {
  border-color: var(--mfd-accent);
  background: var(--mfd-accent-soft);
  box-shadow: 0 0 0 1px var(--mfd-accent);
}

.mfd-option:has(input:focus-visible) {
  outline: 2px solid var(--mfd-accent);
  outline-offset: 2px;
}

.mfd-option__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2em;
  min-width: 0;
}

.mfd-option__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em 0.55em;
}

.mfd-option__title {
  font-weight: 600;
  line-height: 1.3;
}

.mfd-option__title .mfd-amount,
.mfd-option__title .mfd-amount .amount {
  font-weight: 700;
}

.mfd-option__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18em 0.6em;
  border-radius: 999px;
  background: var(--mfd-accent);
  color: #fff;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.mfd-option__meta {
  font-size: 0.85em;
  color: var(--mfd-muted);
}

.mfd-option__price {
  flex: none;
  margin-left: auto;
  font-size: 1.05em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.mfd-option__price:empty {
  display: none;
}

.mfd-option__price .amount,
.mfd-option__price bdi {
  font-weight: inherit;
}

.mfd-options.is-pending .mfd-option__meta[data-mfd="deposit-meta"] {
  font-style: italic;
}

.mfd-options.is-loading .mfd-option__price,
.mfd-options.is-loading .mfd-amount,
.mfd-options.is-loading .mfd-option__meta,
.mfd-options.is-updating .mfd-option__price,
.mfd-options.is-updating .mfd-amount,
.mfd-options.is-updating .mfd-option__meta {
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

/* A small spinner by the heading while the new price is worked out. */
.mfd-options.is-updating .mfd-options__legend::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.55;
  animation: mfd-spin 0.7s linear infinite;
}

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

/* The site's own button waits (greyed, not clickable) until the price is ready. */
.single_add_to_cart_button.mfd-waiting,
.mfd-waiting {
  opacity: 0.45 !important;
  filter: grayscale(0.5);
  cursor: progress !important;
  transition: opacity 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .mfd-options.is-updating .mfd-options__legend::after {
    animation: none;
  }
}

/* Layout: side-by-side tiles */
.mfd-options--tiles .mfd-options__choices {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mfd-options--tiles .mfd-option {
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  padding: 1em;
}

.mfd-options--tiles .mfd-option__check {
  order: 2;
  margin-left: auto;
}

.mfd-options--tiles .mfd-option__body {
  order: 1;
  flex: 1 1 0;
}

.mfd-options--tiles .mfd-option__price {
  order: 3;
  flex-basis: 100%;
  margin: 0.35em 0 0;
  font-size: 1.3em;
  text-align: left;
}

/* Layout: minimal list */
.mfd-options--minimal .mfd-options__choices {
  gap: 0;
}

.mfd-options--minimal .mfd-option {
  padding: 0.7em 0.15em;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.mfd-options--minimal .mfd-option + .mfd-option {
  border-top: 1px solid var(--mfd-border);
}

.mfd-options--minimal .mfd-option:has(input:checked) {
  background: transparent;
  box-shadow: none;
}

/* Payment schedule */
.mfd-schedule {
  margin-top: 0.7em;
  font-size: 0.9em;
}

.mfd-schedule[hidden] {
  display: none;
}

.mfd-schedule__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  list-style: none;
  cursor: pointer;
  color: var(--mfd-accent);
  font-weight: 600;
}

.mfd-schedule__toggle::-webkit-details-marker {
  display: none;
}

.mfd-options .mfd-schedule__toggle:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.mfd-options .mfd-schedule__toggle:focus-visible {
  outline: 2px solid var(--mfd-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.mfd-schedule__toggle::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  margin-top: -0.2em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.mfd-schedule[open] .mfd-schedule__toggle::after {
  margin-top: 0.15em;
  transform: rotate(-135deg);
}

/* "Always show": a plain heading, not a toggle. */
.mfd-options[data-schedule="open"] .mfd-schedule__toggle {
  pointer-events: none;
  color: inherit;
}

.mfd-options[data-schedule="open"] .mfd-schedule__toggle::after {
  display: none;
}

.mfd-schedule__list {
  position: relative;
  list-style: none;
  margin: 0.65em 0 0;
  padding: 0.35em 0;
}

.mfd-schedule__item,
.mfd-plan-list li {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.mfd-schedule__item {
  position: relative;
  align-items: center;
  margin: 0;
  padding: 0.4em 0 0.4em 1.6em;
}

/* Timeline dot and connecting line */
.mfd-schedule__item::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 50%;
  width: 0.55em;
  height: 0.55em;
  margin-top: -0.275em;
  border: 2px solid var(--mfd-border);
  border-radius: 50%;
  background: transparent;
}

.mfd-schedule__item.is-today::before {
  border-color: var(--mfd-accent);
  background: var(--mfd-accent);
}

.mfd-schedule__item + .mfd-schedule__item::after {
  content: "";
  position: absolute;
  left: calc(0.575em - 1px);
  bottom: calc(50% + 0.4em);
  height: calc(100% - 0.8em);
  border-left: 2px solid var(--mfd-border);
}

.mfd-schedule__when {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mfd-schedule__date {
  font-weight: 600;
}

.mfd-schedule__label {
  font-size: 0.85em;
  color: var(--mfd-muted);
}

.mfd-schedule__amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .mfd-options .mfd-option {
    padding: 0.9em;
    gap: 0.75em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mfd-options,
  .mfd-option,
  .mfd-option__check,
  .mfd-schedule__toggle::after {
    animation: none;
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Cart & checkout                                                     */

.mfd-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9em;
}

.mfd-total--today td strong {
  font-size: 1.05em;
}

.mfd-consent {
  margin: 1em 0;
  padding: 0.8em 1em;
  border: 1px solid var(--mfd-border);
  border-radius: var(--mfd-radius);
}

.mfd-consent label {
  display: flex !important;
  gap: 0.6em;
  align-items: flex-start;
}

/* Block checkout summary. It sits in WooCommerce's order summary card, whose
 * `.wc-block-components-totals-wrapper.slot-wrapper > * > *` rule sets
 * `padding: 16px 0`; the extra class here outranks it and lines the panel up
 * with the totals rows above (16px in from the card's edges). */
.mfd-block-summary,
.wc-block-components-totals-wrapper.slot-wrapper .mfd-block-summary {
  box-sizing: border-box;
  margin: 4px 16px 16px;
  padding: 14px 16px;
  border: 1px solid var(--mfd-border);
  border-radius: var(--mfd-radius);
  font-size: 0.875em;
  line-height: 1.45;
}

.mfd-block-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: 3px 0;
}

.mfd-block-summary__row > span:first-child {
  color: var(--mfd-muted);
}

.mfd-block-summary__row > span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mfd-block-summary__row--strong,
.mfd-block-summary__row--strong > span:first-child {
  color: inherit;
  font-weight: 600;
}

.mfd-block-summary__plan {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mfd-border);
}

.mfd-block-summary__plan > .mfd-block-summary__row--strong {
  padding-bottom: 4px;
}

/* In the block checkout the consent row is the label itself (the classic
 * checkout wraps a label in .mfd-consent), so lay it out here. */
.mfd-block-summary .mfd-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--mfd-border);
  border-radius: 0;
  cursor: pointer;
}

.mfd-block-summary .mfd-consent input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--mfd-accent);
  cursor: pointer;
}

/* My Account */
.mfd-account {
  display: grid;
  gap: 1.25em;
}

.mfd-account__plan {
  border: 1px solid var(--mfd-border);
  border-radius: var(--mfd-radius);
  padding: 1.1em 1.25em;
}

.mfd-account__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1em;
  align-items: flex-start;
  margin-bottom: 0.8em;
}

.mfd-account__title {
  margin: 0 0 0.3em;
  font-size: 1.05em;
}

.mfd-account__totals {
  display: flex;
  gap: 1.5em;
  margin: 0;
}

.mfd-account__totals dt {
  font-size: 0.8em;
  color: var(--mfd-muted);
}

.mfd-account__totals dd {
  margin: 0;
  font-weight: 600;
}

.mfd-account__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mfd-account__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.75em;
  align-items: center;
  padding: 0.6em 0;
  border-top: 1px solid var(--mfd-border);
}

.mfd-account__footer {
  display: flex;
  gap: 1.25em;
  margin-top: 0.8em;
  font-size: 0.9em;
}

.mfd-badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  background: var(--mfd-accent-soft);
  color: var(--mfd-accent);
}

.mfd-badge--paid,
.mfd-badge--completed {
  color: var(--mfd-success);
  background: rgba(4, 120, 87, 0.08);
}

.mfd-badge--failed {
  color: var(--mfd-danger);
  background: rgba(185, 28, 28, 0.08);
}

.mfd-badge--scheduled,
.mfd-badge--processing {
  color: var(--mfd-warning);
  background: rgba(180, 83, 9, 0.08);
}

@media (max-width: 600px) {
  .mfd-account__row {
    grid-template-columns: 1fr auto;
  }

  .mfd-account__date {
    grid-column: 1;
    font-size: 0.85em;
    color: var(--mfd-muted);
  }
}

/* "Your payment plan" after checkout (order received, My Account → order). */
.mfd-order-plan {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
}

.mfd-order-plan__title {
  margin: 0 0 6px;
  font-size: 1.25em;
}

.mfd-order-plan__lead {
  margin: 0 0 16px;
  opacity: 0.75;
  font-size: 0.95em;
}

.mfd-order-plan__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mfd-order-plan__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mfd-order-plan__item:first-child {
  border-top: 0;
}

.mfd-order-plan__when {
  display: flex;
  flex-direction: column;
}

.mfd-order-plan__date {
  font-weight: 600;
}

.mfd-order-plan__label {
  font-size: 0.875em;
  opacity: 0.7;
}

.mfd-order-plan__amount {
  font-weight: 700;
  white-space: nowrap;
}

.mfd-order-plan__item.is-paid .mfd-order-plan__amount {
  opacity: 0.6;
}
