/* Royal Rewards & Privileges — Front-end Styles
   Palette: gold (#B8943A), dark gold (#8B6B1F), gold light (#F5EDD5)
   Typography: inherits WooCommerce/theme fonts
   ------------------------------------------------------------------ */

.rr-wrap {
  max-width: 900px;
  padding: 0 0 3rem;
  font-family: inherit;
}

/* ── Page header ─────────────────────────────────────────────────── */
.rr-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e8e0d0;
}
.rr-page-header__title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1a1510;
}
.rr-page-header__sub {
  font-size: 0.85rem;
  color: #7a6a55;
  margin: 0;
}

/* Tier badge */
.rr-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #F5EDD5;
  color: #8B6B1F;
  border: 1px solid #D4A843;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.rr-crown-icon {
  width: 16px;
  height: 16px;
  stroke: #B8943A;
  flex-shrink: 0;
}

/* ── Notifications ───────────────────────────────────────────────── */
.rr-notifications {
  margin-bottom: 1.25rem;
}
.rr-notification-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #F5EDD5;
  border: 1px solid #D4A843;
  border-radius: 8px;
  margin-bottom: 8px;
}
.rr-notif-icon {
  width: 18px;
  height: 18px;
  stroke: #8B6B1F;
  flex-shrink: 0;
  margin-top: 2px;
}
.rr-notif-text {
  font-size: 0.85rem;
  color: #5C3D0E;
  line-height: 1.5;
}
.rr-notif-text strong { font-weight: 600; }
.rr-notif-text code {
  font-family: monospace;
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 3px;
}
.rr-dismiss-notif {
  background: none;
  border: none;
  color: #8B6B1F;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

/* ── Section tabs ────────────────────────────────────────────────── */
.rr-section-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e8e0d0;
  margin-bottom: 1.25rem;
}
.rr-section-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  color: #7a6a55;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
  margin-bottom: -1px;
}
.rr-section-tab--active {
  color: #8B6B1F;
  border-bottom-color: #B8943A;
  font-weight: 600;
}
.rr-section-tab:hover:not(.rr-section-tab--active) { color: #1a1510; }
.rr-count {
  background: #B8943A;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  padding: 1px 7px;
  font-weight: 600;
  line-height: 1.6;
}

/* ── Section panels ──────────────────────────────────────────────── */
.rr-section--hidden { display: none; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.rr-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.rr-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  background: #f5f2ed;
  border: 1px solid #e0d8cc;
  color: #7a6a55;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.rr-filter-btn--active,
.rr-filter-btn:hover {
  background: #F5EDD5;
  color: #8B6B1F;
  border-color: #D4A843;
  font-weight: 600;
}

/* ── Cards grid ──────────────────────────────────────────────────── */
.rr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

/* ── Individual card ─────────────────────────────────────────────── */
.rr-card {
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rr-card:hover {
  border-color: #D4A843;
  box-shadow: 0 2px 12px rgba(184,148,58,0.12);
}
.rr-card--redeemed {
  opacity: 0.6;
}
.rr-card--redeemed:hover {
  border-color: #e8e0d0;
  box-shadow: none;
}

/* Card colour banners */
.rr-card__banner {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}
.rr-card__banner--coupon   { background: #B8943A; }
.rr-card__banner--loyalty  { background: #4A7C59; }
.rr-card__banner--promo    { background: #2E6B9E; }
.rr-card__banner--brand    { background: #7B4A9E; }
.rr-card__banner--campaign { background: #C05A2A; }

/* Card image */
.rr-card__image {
  width: 100%;
  height: 120px;
  overflow: hidden;
}
.rr-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card body */
.rr-card__body {
  padding: 14px;
  flex: 1;
}
.rr-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1510;
  margin: 0 0 5px;
  line-height: 1.35;
}
.rr-card__desc {
  font-size: 0.8rem;
  color: #7a6a55;
  line-height: 1.5;
  margin: 0 0 10px;
}

/* Pill labels */
.rr-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.pill-coupon   { background: #F5EDD5; color: #8B6B1F; }
.pill-loyalty  { background: #E1F0E6; color: #2A6040; }
.pill-promo    { background: #E3EEF7; color: #1A4B72; }
.pill-brand    { background: #EDE3F5; color: #4A1F72; }
.pill-campaign { background: #FAEDE3; color: #7A2E0A; }

/* Coupon code display */
.rr-coupon-code-wrap {
  margin-bottom: 8px;
}
.rr-coupon-code {
  display: inline-block;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8B6B1F;
  background: #faf6ef;
  border: 1px solid #e8d9b8;
  border-radius: 5px;
  padding: 4px 8px;
  letter-spacing: 0.05em;
}

/* Expiry labels */
.rr-card__expiry {
  font-size: 0.75rem;
  color: #a09080;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.rr-card__expiry--urgent { color: #C05A2A; }
.rr-icon-sm {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Card footer / buttons */
.rr-card__footer {
  padding: 0 14px 14px;
}
.rr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s;
  border: none;
}
.rr-btn--copy {
  background: #F5EDD5;
  color: #8B6B1F;
  border: 1px solid #D4A843;
}
.rr-btn--copy:hover {
  background: #B8943A;
  color: #fff;
  border-color: #B8943A;
}
.rr-btn--shop {
  background: #f5f2ed;
  color: #1a1510;
  border: 1px solid #e0d8cc;
}
.rr-btn--shop:hover {
  background: #e8e0d0;
  border-color: #c4b898;
}
.rr-btn--redeemed {
  background: #f5f2ed;
  color: #b0a090;
  border: 1px solid #e0d8cc;
  cursor: default;
  font-weight: 400;
}
.rr-copy-msg {
  display: block;
  font-size: 0.75rem;
  color: #2A6040;
  text-align: center;
  margin-top: 4px;
  min-height: 1em;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.rr-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #b0a090;
}
.rr-empty-state svg {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: block;
  stroke: #d0c0a8;
}

/* ── Loyalty section ─────────────────────────────────────────────── */
.rr-loyalty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 1.5rem;
}
@media (max-width: 600px) {
  .rr-loyalty-grid { grid-template-columns: 1fr; }
}
.rr-loyalty-card {
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: 10px;
  padding: 1.25rem;
}
.rr-loyalty-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #a09080;
  margin: 0 0 4px;
}
.rr-loyalty-card__value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1510;
  margin: 0 0 2px;
}
.rr-loyalty-card__value--sm { font-size: 1.15rem; }
.rr-loyalty-card__sub {
  font-size: 0.78rem;
  color: #a09080;
  margin: 0 0 12px;
}

/* Progress bar */
.rr-progress-wrap { margin-top: 14px; }
.rr-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #a09080;
  margin-bottom: 5px;
}
.rr-progress-track {
  height: 7px;
  background: #f0ebe0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e8d9b8;
}
.rr-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #B8943A;
  transition: width 0.5s ease;
}
.rr-progress-note {
  font-size: 0.78rem;
  color: #7a6a55;
  margin: 6px 0 0;
}
.rr-progress-note strong { color: #8B6B1F; }
.rr-progress-note--max {
  color: #8B6B1F;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 12px;
}

/* Tier display */
.rr-tier-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
}
.rr-tier-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.rr-tier-dot--royal    { background: #C0C0C0; }
.rr-tier-dot--silver   { background: #A8B8D0; }
.rr-tier-dot--gold     { background: #D4A843; }
.rr-tier-dot--platinum { background: #B0C4D8; }

.rr-next-tier-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: #7a6a55;
}
.rr-next-tier-hint strong { color: #8B6B1F; }

/* Tiers reference table */
.rr-tiers-table-wrap {
  border: 1px solid #e8e0d0;
  border-radius: 10px;
  overflow: hidden;
}
.rr-tiers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.rr-tiers-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a09080;
  background: #faf6ef;
  border-bottom: 1px solid #e8e0d0;
}
.rr-tiers-table td {
  padding: 10px 14px;
  vertical-align: middle;
}
.rr-tiers-table td:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rr-tiers-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid #f0ebe0;
}
.rr-tier-row--current td {
  background: #fdf8ee;
}
.rr-tier-row--current td:first-child {
  border-left: 3px solid #B8943A;
}

/* Status pills */
.rr-status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
}
.rr-status-pill--active   { background: #E1F0E6; color: #2A6040; }
.rr-status-pill--passed   { background: #f0ebe0; color: #8a7a65; }
.rr-status-pill--locked   { background: #E3EEF7; color: #1A4B72; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .rr-cards-grid { grid-template-columns: 1fr; }
  .rr-page-header { flex-direction: column; align-items: flex-start; }
  .rr-tiers-table th:nth-child(2),
  .rr-tiers-table td:nth-child(2) { display: none; }
}
