/* =============================================================
   SSR My Account — Subscriptions tab
   ============================================================= */

/* ── Typography ────────────────────────────────────────────── */
.ssr-ma-table,
.ssr-ma-detail,
.ssr-ma-section {
  font-family: var(--ssr-font-body, inherit);
}

.ssr-ma-section__title,
.ssr-ma-detail__title {
  font-family: var(--ssr-font-heading, var(--ssr-font-body, inherit));
}

/* ── Status badges ─────────────────────────────────────────── */
.ssr-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.ssr-status--active             { background: #e6f4ea; color: #2e7d32; }
.ssr-status--trialing           { background: #e3f0fa; color: #1a5276; }
.ssr-status--past_due           { background: #fef9e7; color: #7a4f00; }
.ssr-status--incomplete         { background: #fef9e7; color: #7a4f00; }
.ssr-status--incomplete_expired { background: #f0f0f0; color: #555; }
.ssr-status--canceled           { background: #fdecea; color: #7a0000; }
.ssr-status--unpaid             { background: #fdecea; color: #7a0000; }

/* ── Utility ───────────────────────────────────────────────── */
.ssr-ma-dim { color: #aaa; font-size: 0.9em; }

.ssr-ma-notice {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.ssr-ma-notice--success { background: #e6f4ea; color: #2e7d32; border-left: 4px solid #2e7d32; }

.ssr-ma-error {
  color: #c0392b;
  font-size: 14px;
}

/* ── Shared button ─────────────────────────────────────────── */
.ssr-ma-btn {
  display: inline-block;
  padding: 7px 16px;
  background: var(--ssr-primary, #635bff);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1.4;
}
.ssr-ma-btn:hover { background: var(--ssr-primary-dark, #4f46e5); color: #fff; }
.ssr-ma-btn:focus { outline: none; box-shadow: 0 0 0 3px var(--ssr-primary-a25, rgba(99,91,255,.25)); }

.ssr-ma-btn--sm {
  padding: 4px 12px;
  font-size: 12px;
}

.ssr-ma-btn--danger {
  background: transparent;
  color: #c0392b;
  border: 1.5px solid #c0392b;
}
.ssr-ma-btn--danger:hover {
  background: #fdecea;
  color: #7a0000;
  border-color: #7a0000;
}

/* ── Empty state ───────────────────────────────────────────── */
.ssr-ma-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: #aaa;
}
.ssr-ma-empty p {
  margin: 0;
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════
   LIST VIEW
   ═══════════════════════════════════════════════════════════ */

.ssr-ma-list {}

.ssr-ma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ssr-ma-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 1px solid #e0e0e0;
}

.ssr-ma-table td {
  padding: 14px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.ssr-ma-row { cursor: pointer; transition: background 0.12s; }
.ssr-ma-row:hover { background: #f9f9ff; }

.ssr-ma-plan { display: flex; flex-direction: column; gap: 2px; }
.ssr-ma-plan__name {
  font-weight: 600;
  color: #1d2327;
  text-decoration: none;
}
.ssr-ma-plan__name:hover { color: var(--ssr-primary, #635bff); }
.ssr-ma-plan__price { font-size: 13px; color: var(--ssr-primary, #635bff); font-weight: 600; }
.ssr-ma-plan__interval { color: #aaa; font-weight: 400; }

.ssr-ma-amount { font-variant-numeric: tabular-nums; font-weight: 600; color: #1d2327; }
.ssr-ma-date   { color: #555; white-space: nowrap; }
.ssr-ma-actions { text-align: right; }

@media (max-width: 600px) {
  .ssr-ma-table th:nth-child(2),
  .ssr-ma-table td:nth-child(2),
  .ssr-ma-table th:nth-child(3),
  .ssr-ma-table td:nth-child(3) { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   DETAIL VIEW
   ═══════════════════════════════════════════════════════════ */

.ssr-ma-detail { display: flex; flex-direction: column; gap: 24px; }

/* Back link */
.ssr-ma-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ssr-primary, #635bff);
  text-decoration: none;
}
.ssr-ma-back:hover { color: var(--ssr-primary-dark, #4f46e5); text-decoration: underline; }
.ssr-ma-back svg { flex-shrink: 0; }

/* Header */
.ssr-ma-detail__header { }
.ssr-ma-detail__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ssr-ma-detail__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1d2327;
}
.ssr-ma-detail__sub {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ssr-primary, #635bff);
}

/* Stats row */
.ssr-ma-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
}
.ssr-ma-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  flex: 1 1 120px;
  border-right: 1px solid #e8e8e8;
}
.ssr-ma-stat:last-child { border-right: none; }
.ssr-ma-stat__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
}
.ssr-ma-stat__value {
  font-size: 15px;
  font-weight: 700;
  color: #1d2327;
  font-variant-numeric: tabular-nums;
}

/* Section cards */
.ssr-ma-section {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
}
.ssr-ma-section--danger { border-color: #ffd0cc; }

.ssr-ma-section__title {
  margin: 0;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
}
.ssr-ma-section--danger .ssr-ma-section__title {
  background: #fff8f7;
  border-color: #ffd0cc;
  color: #9e2a20;
}

.ssr-ma-section__body {
  padding: 18px;
}
.ssr-ma-section__body--flush { padding: 0; }

/* Definition list */
.ssr-ma-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 0;
}
.ssr-ma-dl dt,
.ssr-ma-dl dd {
  padding: 9px 0;
  font-size: 14px;
  margin: 0;
  border-bottom: 1px solid #f5f5f5;
}
.ssr-ma-dl > *:nth-last-child(-n+2) { border-bottom: none; }
.ssr-ma-dl dt {
  padding-right: 24px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}
.ssr-ma-dl dd { color: #1d2327; }

/* Shipping total row inside plan details */
.ssr-ma-dl .ssr-ma-dl__total-dt,
.ssr-ma-dl .ssr-ma-dl__total-dd {
  border-top: 1px solid #e0e0e0;
  padding-top: 11px;
  margin-top: 2px;
  color: #1d2327;
}

/* Cancel section */
.ssr-ma-cancel-text {
  font-size: 14px;
  color: #555;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Orders table */
.ssr-ma-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ssr-ma-orders-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
}
.ssr-ma-orders-table td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.ssr-ma-orders-table tbody tr:last-child td { border-bottom: none; }
.ssr-ma-orders-table tbody tr:hover { background: #f9f9ff; }

.ssr-ma-order-link {
  font-weight: 700;
  color: var(--ssr-primary, #635bff);
  text-decoration: none;
}
.ssr-ma-order-link:hover { text-decoration: underline; }

/* Order type badges */
.ssr-ma-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.ssr-ma-type--initial { background: #e3f0fa; color: #1a5276; }
.ssr-ma-type--renewal { background: #e6f4ea; color: #2e7d32; }

@media (max-width: 600px) {
  .ssr-ma-orders-table th:nth-child(4),
  .ssr-ma-orders-table td:nth-child(4) { display: none; }

  .ssr-ma-stat { padding: 12px 14px; }
  .ssr-ma-detail__title { font-size: 18px; }
}
