/* Checkout UI — clean, airy, brand-aligned. Does not rename CF7 fields. */
:root {
  --pm-ck-bg: #ffffff;
  --pm-ck-surface: #ffffff;
  --pm-ck-surface-soft: #faf8f7;
  --pm-ck-line: rgba(42, 26, 36, 0.08);
  --pm-ck-on: #2a1a24;
  --pm-ck-muted: #7a6a72;
  --pm-ck-primary: #700053;
  --pm-ck-primary-soft: rgba(112, 0, 83, 0.08);
  --pm-ck-gold: #c9923a;
  --pm-ck-on-gold: #3d2e00;
  --pm-ck-radius: 1rem;
  --pm-ck-font: "Manrope", "Segoe UI", sans-serif;
}

body.pm-checkout-brand {
  font-family: var(--pm-ck-font);
  color: var(--pm-ck-on);
  background: var(--pm-ck-bg);
}

/* Remove heavy/cream page backgrounds from theme wrappers */
body.pm-checkout-brand .main_content,
body.pm-checkout-brand .main_content > .section,
body.pm-checkout-brand .container,
body.pm-checkout-brand #content,
body.pm-checkout-brand .content-area {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.pm-checkout-brand .main_content {
  padding-bottom: 3rem;
}

/* Legacy cart table replaced by panel */
.pm-checkout-brand #total,
#total.pm-checkout-legacy-hidden {
  display: none !important;
}

.pm-checkout-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 2rem 2.5rem;
  align-items: start;
  width: min(1180px, calc(100% - 3rem));
  margin: 0.5rem auto 3.5rem;
  box-sizing: border-box;
}

.pm-checkout-cart {
  position: sticky;
  top: 176px;
  background: var(--pm-ck-surface);
  border: 1px solid var(--pm-ck-line);
  border-radius: var(--pm-ck-radius);
  padding: 1.5rem 1.5rem 1.75rem;
}

.pm-checkout-cart__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pm-ck-on);
  letter-spacing: -0.01em;
}

.pm-checkout-cart__sub {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--pm-ck-muted);
  line-height: 1.4;
}

.pm-checkout-cart__list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pm-checkout-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--pm-ck-line);
  padding-bottom: 1rem;
  border-radius: 0;
}

.pm-checkout-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pm-checkout-line__img {
  width: 64px;
  height: 72px;
  border-radius: 0.75rem;
  object-fit: cover;
  background: var(--pm-ck-surface-soft);
  border: 1px solid var(--pm-ck-line);
}

.pm-checkout-line__name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pm-ck-on);
}

.pm-checkout-line__meta {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--pm-ck-muted);
}

.pm-checkout-line__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.pm-checkout-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--pm-ck-line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.pm-checkout-qty button {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  color: var(--pm-ck-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

.pm-checkout-qty button:hover:not(:disabled) {
  background: var(--pm-ck-primary-soft);
}

.pm-checkout-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pm-checkout-qty span {
  min-width: 1.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.pm-checkout-line__price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pm-ck-on);
}

.pm-checkout-line__remove {
  border: 0;
  background: none;
  color: var(--pm-ck-muted);
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0.25rem 0 0;
  margin-top: 0.35rem;
}

.pm-checkout-line__remove:hover {
  color: var(--pm-ck-primary);
}

.pm-checkout-cart__totals {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--pm-ck-line);
  display: grid;
  gap: 0.55rem;
  font-size: 0.875rem;
}

.pm-checkout-cart__totals div {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  color: var(--pm-ck-muted);
}

.pm-checkout-cart__totals .is-total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--pm-ck-line);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pm-ck-on);
}

.pm-checkout-coupon {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--pm-ck-line);
}

.pm-checkout-coupon > p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pm-ck-on);
}

.pm-checkout-coupon form {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.pm-checkout-coupon input {
  flex: 1;
  min-width: 0;
  height: 2.85rem;
  border-radius: 999px;
  border: 1px solid var(--pm-ck-line);
  padding: 0 1.1rem;
  font-size: 0.875rem;
  outline: none;
  background: #fff;
  color: var(--pm-ck-on);
}

.pm-checkout-coupon input:focus {
  border-color: rgba(112, 0, 83, 0.45);
  box-shadow: 0 0 0 3px var(--pm-ck-primary-soft);
}

.pm-checkout-coupon button[type="submit"] {
  height: 2.85rem;
  border: 0;
  border-radius: 999px;
  padding: 0 1.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--pm-ck-primary);
  cursor: pointer;
  white-space: nowrap;
}

.pm-checkout-coupon button[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.06);
}

.pm-checkout-coupon button[type="submit"]:disabled,
.pm-checkout-cart.is-busy button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pm-checkout-coupon__err {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--pm-ck-primary);
}

.pm-checkout-coupon__list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
}

.pm-checkout-coupon__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--pm-ck-surface-soft);
  border: 1px solid var(--pm-ck-line);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--pm-ck-primary);
}

.pm-checkout-coupon__list button {
  border: 0;
  background: none;
  text-decoration: underline;
  color: var(--pm-ck-muted);
  font-size: 0.75rem;
  text-transform: none;
  font-weight: 500;
  cursor: pointer;
}

.pm-checkout-empty {
  margin-top: 1.25rem;
  padding: 1.75rem 1.25rem;
  text-align: center;
  border-radius: var(--pm-ck-radius);
  background: var(--pm-ck-surface-soft);
  border: 1px solid var(--pm-ck-line);
}

.pm-checkout-empty p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--pm-ck-muted);
  line-height: 1.45;
}

.pm-checkout-empty a {
  display: inline-flex;
  margin: 1rem 0.35rem 0;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--pm-ck-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.pm-checkout-empty a[href="/"] {
  background: transparent;
  color: var(--pm-ck-primary);
  border: 1px solid rgba(112, 0, 83, 0.28);
}

.pm-checkout-cart__status {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--pm-ck-muted);
  min-height: 1.2em;
  line-height: 1.4;
}

.pm-checkout-cart__status.is-error {
  color: var(--pm-ck-primary);
}

.pm-checkout-cart.is-busy {
  opacity: 0.9;
}

.pm-checkout-form-col {
  min-width: 0;
  background: var(--pm-ck-surface);
  border: 1px solid var(--pm-ck-line);
  border-radius: var(--pm-ck-radius);
  padding: 1.75rem 1.75rem 2rem;
}

/* CF7 skin — names/ids untouched */
.pm-checkout-brand .wpcf7-form input[type="text"],
.pm-checkout-brand .wpcf7-form input[type="email"],
.pm-checkout-brand .wpcf7-form input[type="tel"],
.pm-checkout-brand .wpcf7-form input[type="number"],
.pm-checkout-brand .wpcf7-form input[type="password"],
.pm-checkout-brand .wpcf7-form select,
.pm-checkout-brand .wpcf7-form textarea {
  width: 100%;
  max-width: 100%;
  min-height: 3rem;
  border-radius: 0.85rem !important;
  border: 1px solid var(--pm-ck-line) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.9375rem !important;
  line-height: 1.35 !important;
  color: var(--pm-ck-on) !important;
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.pm-checkout-brand .wpcf7-form input:focus,
.pm-checkout-brand .wpcf7-form select:focus,
.pm-checkout-brand .wpcf7-form textarea:focus {
  border-color: rgba(112, 0, 83, 0.45) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--pm-ck-primary-soft) !important;
}

.pm-checkout-brand .wpcf7-form label,
.pm-checkout-brand .wpcf7-form .wpcf7-list-item-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pm-ck-on);
}

.pm-checkout-brand .wpcf7-form p,
.pm-checkout-brand .wpcf7-form .row,
.pm-checkout-brand .wpcf7-form .form-group {
  margin-bottom: 1rem;
}

.pm-checkout-brand .wpcf7-not-valid-tip {
  font-size: 0.8125rem;
  color: var(--pm-ck-primary);
  margin-top: 0.35rem;
}

.pm-checkout-brand .wpcf7-form input.wpcf7-submit,
.pm-checkout-brand .wpcf7-form .wpcf7-submit {
  width: 100%;
  max-width: 100%;
  min-height: 3.15rem !important;
  margin-top: 0.5rem;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 0.85rem 1.5rem !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase !important;
  color: #fff !important;
  background: var(--pm-ck-primary) !important;
  box-shadow: none !important;
  cursor: pointer;
}

.pm-checkout-brand .wpcf7-form input.wpcf7-submit:hover,
.pm-checkout-brand .wpcf7-form .wpcf7-submit:hover {
  filter: brightness(1.06);
}

.pm-checkout-brand .nav-pills {
  gap: 0.5rem;
  margin-bottom: 1.25rem !important;
  flex-wrap: wrap;
}

.pm-checkout-brand .nav-pills .nav-link {
  border-radius: 999px !important;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.55rem 1rem !important;
  color: var(--pm-ck-muted) !important;
  background: var(--pm-ck-surface-soft) !important;
  border: 1px solid var(--pm-ck-line) !important;
}

.pm-checkout-brand .nav-pills .nav-link.active {
  background: var(--pm-ck-primary) !important;
  border-color: var(--pm-ck-primary) !important;
  color: #fff !important;
}

/* Tablet */
@media (max-width: 1024px) {
  .pm-checkout-layout {
    width: min(100%, calc(100% - 2rem));
    gap: 1.5rem;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .pm-checkout-form-col,
  .pm-checkout-cart {
    padding: 1.35rem 1.25rem 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .pm-checkout-layout {
    grid-template-columns: 1fr;
    width: calc(100% - 1.5rem);
    gap: 1.25rem;
    margin: 0 auto 4.5rem;
  }

  .pm-checkout-cart {
    position: relative;
    top: auto;
    order: -1;
  }

  .pm-checkout-form-col {
    padding: 1.25rem 1.1rem 1.5rem;
  }

  .pm-checkout-coupon form {
    flex-direction: column;
  }

  .pm-checkout-coupon button[type="submit"] {
    width: 100%;
  }

  .pm-checkout-empty a {
    display: flex;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .pm-checkout-brand .wpcf7-form input[type="text"],
  .pm-checkout-brand .wpcf7-form input[type="email"],
  .pm-checkout-brand .wpcf7-form input[type="tel"],
  .pm-checkout-brand .wpcf7-form select {
    min-height: 3.15rem;
    font-size: 1rem !important;
  }
}

@media (max-width: 420px) {
  .pm-checkout-layout {
    width: calc(100% - 1rem);
  }

  .pm-checkout-line {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.75rem;
  }
}
