/**
 * Shop widgets — structural only; colors inherit host theme.
 */
.tcm-shop,
.tcm-event-booking,
.tcm-product-buy {
  --tcm-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, currentColor));
  --tcm-accent-strong: var(--wp--preset--color--secondary, var(--tcm-accent));
  --tcm-accent-contrast: var(--wp--preset--color--base, #fff);
  --tcm-muted: color-mix(in srgb, currentColor 55%, transparent);
  --tcm-border: color-mix(in srgb, currentColor 18%, transparent);
  --tcm-surface: color-mix(in srgb, currentColor 5%, transparent);
  color: inherit;
  font-family: inherit;
}

.tcm-shop {
  max-width: 640px;
  margin: 1rem 0;
}

.tcm-shop-muted {
  color: var(--tcm-muted);
  font-size: 0.9rem;
}

.tcm-shop-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tcm-shop-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tcm-shop-total {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 1.05rem;
}

.tcm-shop-field {
  margin-bottom: 0.75rem;
}

.tcm-shop-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  color: var(--tcm-muted);
}

.tcm-shop-field input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--tcm-border);
  border-radius: 8px;
  font: inherit;
}

.tcm-shop-submit,
.tcm-shop-add {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--tcm-accent);
  color: var(--tcm-accent-contrast);
  color: var(--tcm-accent-contrast);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tcm-shop-error {
  color: #b00020;
  margin: 0.5rem 0;
}

.tcm-shop-ship {
  margin: 1rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tcm-event-booking {
  max-width: none;
  margin: 0;
}

.tcm-event-booking-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.tcm-event-booking select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--tcm-border);
  border-radius: 8px;
  font: inherit;
  background: var(--tcm-surface);
}

.tcm-event-ticket-types {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem 0 1rem;
}

.tcm-event-ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.tcm-event-ticket-label {
  font-weight: 600;
}

.tcm-event-ticket-row input[type='number'] {
  width: 4.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--tcm-border);
  border-radius: 8px;
  font: inherit;
  text-align: center;
}

.tcm-event-ticket-total {
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 0;
  font-size: 1.05rem;
}

.tcm-event-booking-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tcm-event-booking-actions .tcm-shop-add,
.tcm-event-booking-actions .tcm-shop-submit {
  width: 100%;
  margin-top: 0;
  text-align: center;
}

.tcm-event-booking-actions .tcm-shop-add {
  background: var(--tcm-accent);
}

.tcm-event-booking-actions .tcm-shop-add:disabled,
.tcm-event-booking-actions .tcm-shop-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tcm-shop-ok {
  color: #1a7f37;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.tcm-shop-totals-rows {
  margin-top: 0.75rem;
}

.tcm-shop-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  margin: 0.2rem 0;
}

.tcm-event-vat-note {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.85rem;
}

.tcm-product-buy {
  max-width: none;
  margin: 0;
}

.tcm-product-buy-price {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.15rem;
}

.tcm-product-buy .tcm-shop-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.tcm-slot-view-toggle {
  display: inline-flex;
  width: 100%;
  max-width: 22rem;
  border: 1px solid var(--tcm-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--tcm-surface);
  margin-bottom: 0.75rem;
}

.tcm-slot-view-toggle button {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--tcm-muted);
  cursor: pointer;
}

.tcm-slot-view-toggle button.is-active {
  background: var(--tcm-accent);
  color: var(--tcm-accent-contrast);
}

.tcm-slot-calendar {
  margin-bottom: 0.75rem;
}

.tcm-slot-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tcm-slot-calendar-title {
  font-weight: 700;
  text-transform: capitalize;
}

.tcm-slot-cal-prev,
.tcm-slot-cal-next {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--tcm-border);
  border-radius: 8px;
  background: var(--tcm-surface);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.tcm-slot-calendar-weekdays,
.tcm-slot-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.tcm-slot-calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tcm-muted);
  text-transform: uppercase;
}

.tcm-slot-cal-day {
  aspect-ratio: 1;
  min-height: 2.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  color: var(--tcm-muted);
  cursor: default;
}

.tcm-slot-cal-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.tcm-slot-cal-day.is-available:not(.is-past) {
  background: rgba(26, 127, 55, 0.12);
  color: inherit;
  border-color: rgba(26, 127, 55, 0.28);
  cursor: pointer;
  font-weight: 700;
}

.tcm-slot-cal-day.is-full:not(.is-past) {
  background: rgba(180, 60, 40, 0.1);
  color: var(--tcm-muted);
  text-decoration: line-through;
}

.tcm-slot-cal-day.is-blackout,
.tcm-slot-cal-day.is-out_of_season,
.tcm-slot-cal-day.is-closed,
.tcm-slot-cal-day.is-past {
  opacity: 0.45;
}

.tcm-slot-cal-day.is-selected {
  outline: 2px solid var(--tcm-accent);
  outline-offset: 1px;
}

.tcm-slot-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.tcm-slot-cal-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.2rem;
  vertical-align: middle;
}

.tcm-slot-cal-dot.is-available {
  background: rgba(26, 127, 55, 0.55);
}

.tcm-slot-cal-dot.is-full {
  background: rgba(180, 60, 40, 0.45);
}

.tcm-slot-cal-dot.is-blocked {
  background: rgba(26, 46, 36, 0.25);
}

.tcm-slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.tcm-slot-chip {
  border: 1px solid var(--tcm-border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: var(--tcm-surface);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.tcm-slot-chip.is-selected {
  background: var(--tcm-accent);
  border-color: var(--tcm-accent);
  color: var(--tcm-accent-contrast);
}

.tcm-slot-chip.is-disabled,
.tcm-slot-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}

@media (max-width: 480px) {
  .tcm-slot-cal-day {
    min-height: 2.1rem;
    font-size: 0.8rem;
  }

  .tcm-slot-chip {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
  }
}
