/* ==========================================================================
   POLREG - Shop (publik sida)
   ========================================================================== */
:root {
  --bg-card2: #1b1b1f;
  --line: rgba(255,255,255,.08);
  --green: #4caf7d;
  --red: #e05555;

  /* Rollfärger */
  --t-diamant-a: #8ff7ff; --t-diamant-b: #b89bff; --t-diamant-c: #ffffff;
  --t-premium-a: #b06cff; --t-premium-b: #ffcf5a;
  --t-elite-a:   #ffe082; --t-elite-b:   #d4a017;
  --t-patrull-a: #7fb8ff; --t-patrull-b: #c9d6e8;
  --t-supporter-a: #e0a070; --t-supporter-b: #8a5a33;
}

@property --tier-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

/* ---------- Hero ---------- */
.shop-hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(40px, 7vw, 72px) 16px clamp(32px, 5vw, 56px);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(0,85,204,.55), transparent 70%),
    radial-gradient(40% 80% at 85% 100%, rgba(184,155,255,.18), transparent 70%),
    linear-gradient(180deg, #0b1830, var(--bg-dark));
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.shop-hero-kicker { color: var(--accent-yellow); text-transform: uppercase; letter-spacing: 3px; font-size: 12px; font-weight: 600; margin: 0 0 6px; }
.shop-hero h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(40px, 8vw, 76px); letter-spacing: 3px; font-weight: 400; margin: 0 0 8px; line-height: 1; }
.shop-hero-sub { color: rgba(255,255,255,.75); margin: 0 auto; max-width: 560px; font-size: clamp(14px, 2.2vw, 16px); }

.shop-main { padding-left: 16px; padding-right: 16px; }
.shop-alert { background: rgba(224,85,85,.12); border: 1px solid rgba(224,85,85,.4); color: #ffb3b3; border-radius: 10px; padding: 12px 16px; margin-bottom: 24px; display: flex; gap: 8px; align-items: center; }

/* ---------- Sektioner ---------- */
.section-wrap { background: var(--bg-mid); border-radius: 18px; padding: clamp(20px, 4vw, 40px); box-shadow: 0 4px 20px var(--shadow); margin-bottom: 36px; border: 1px solid var(--line); }
.section-heading { font-family: 'Bebas Neue', sans-serif; font-size: clamp(26px, 4vw, 32px); letter-spacing: 2px; font-weight: 400; color: var(--accent-yellow); margin: 0 0 2px; }
.section-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; }
.group-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-light); margin: 28px 0 14px; }
.group-label:first-of-type { margin-top: 8px; }
.group-label i { color: var(--accent-yellow); font-size: 18px; }
.group-label small { font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin-left: 4px; }

/* ---------- Insamlingsmål ---------- */
.goal-section { background: var(--bg-card); border-radius: 14px; padding: clamp(18px, 3vw, 28px) clamp(18px, 3vw, 32px); margin-bottom: 36px; border: 1px solid var(--line); }
.goal-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.goal-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1.5px; font-weight: 400; margin: 0; }
.goal-title span { color: var(--accent-yellow); }
.goal-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.goal-stat { text-align: right; }
.goal-stat-val { font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-stat-val.green { color: var(--green); } .goal-stat-val.yellow { color: var(--accent-yellow); } .goal-stat-val.red { color: var(--red); }
.goal-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.progress-wrap { background: rgba(255,255,255,.08); border-radius: 30px; height: 20px; overflow: hidden; margin-bottom: 10px; }
.progress-bar-fill { height: 100%; border-radius: 30px; background: linear-gradient(90deg, var(--primary-blue), #4a90d9); position: relative; transition: width 1s ease; }
.progress-bar-fill.complete { background: linear-gradient(90deg, #2e7d4f, #4caf7d); }
.progress-bar-fill::after { content: ''; position: absolute; top: 3px; left: 10px; right: 10px; height: 6px; background: rgba(255,255,255,.18); border-radius: 10px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.deadline-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.dbadge { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 8px; padding: 7px 14px; font-size: 12px; }
.dbadge i { font-size: 15px; color: var(--accent-yellow); }
.dbadge.urgent { border-color: rgba(224,85,85,.4); } .dbadge.urgent i { color: var(--red); }
.dbadge.done { border-color: rgba(76,175,125,.4); } .dbadge.done i { color: var(--green); }
@media (max-width: 575px) { .goal-stat { text-align: left; } }

/* ---------- Rollkort ---------- */
.tiers-once { display: grid; grid-template-columns: 1fr; gap: 20px; }
.tiers-subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
@media (min-width: 992px) { .tiers-once { grid-template-columns: 1.7fr 1fr; } }

.tier {
  --a: #666; --b: #999; --c: var(--b);
  position: relative; border-radius: 20px; padding: 2px;
  background: linear-gradient(140deg, var(--a), var(--b) 55%, var(--c));
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--a) 45%, transparent);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tier:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--a) 65%, transparent); }
.tier-inner {
  position: relative; height: 100%; border-radius: 18px; padding: clamp(20px, 3vw, 28px);
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--a) 16%, transparent), transparent 60%),
    var(--bg-card2);
  display: flex; flex-direction: column; overflow: hidden;
}
.tier-diamant   { --a: var(--t-diamant-a); --b: var(--t-diamant-b); --c: var(--t-diamant-c); }
.tier-premium   { --a: var(--t-premium-a); --b: var(--t-premium-b); }
.tier-elite     { --a: var(--t-elite-a);   --b: var(--t-elite-b); }
.tier-patrull   { --a: var(--t-patrull-a); --b: var(--t-patrull-b); }
.tier-supporter { --a: var(--t-supporter-a); --b: var(--t-supporter-b); }

/* Diamant: roterande regnbågskant + glitter */
.tier-diamant {
  background: conic-gradient(from var(--tier-angle), var(--t-diamant-a), var(--t-diamant-b), var(--t-diamant-c), var(--t-diamant-a), var(--t-diamant-b), var(--t-diamant-a));
  animation: tierSpin 6s linear infinite;
}
.tier-premium {
  background: conic-gradient(from var(--tier-angle), var(--t-premium-a), var(--t-premium-b), var(--t-premium-a), var(--t-premium-b), var(--t-premium-a));
  animation: tierSpin 9s linear infinite;
}
@keyframes tierSpin { to { --tier-angle: 360deg; } }
.tier-diamant .tier-inner::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent),
    radial-gradient(1px 1px at 78% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 64%, #cdfcff, transparent),
    radial-gradient(1px 1px at 30% 80%, #fff, transparent),
    radial-gradient(1px 1px at 55% 35%, #e6dcff, transparent);
  opacity: .7; animation: twinkle 3.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .25; } to { opacity: .8; } }

.tier-head { position: relative; }
.tier-chip {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
  color: #111; background: linear-gradient(90deg, var(--a), var(--b));
}
.tier-icon { font-size: 34px; line-height: 1; margin-bottom: 6px; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--a) 60%, transparent)); }
.tier-name {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400; letter-spacing: 1.5px; margin: 0;
  font-size: clamp(26px, 3.2vw, 32px); line-height: 1.05;
  background: linear-gradient(90deg, var(--a), var(--c, var(--b)), var(--b), var(--a));
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tier-diamant .tier-name, .tier-premium .tier-name { animation: shimmer 5s linear infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
.tier-tag { color: var(--text-muted); font-size: 12px; margin: 2px 0 12px; }
.tier-price { font-size: clamp(28px, 4vw, 34px); font-weight: 700; color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tier-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.tier-note { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; }
.tier-perks { list-style: none; padding: 16px 0 0; margin: 16px 0 20px; border-top: 1px solid var(--line); flex: 1; }
.tier-perks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: #d6d6d6; padding: 5px 0; line-height: 1.45; }
.tier-perks i { flex-shrink: 0; font-size: 18px; color: var(--a); margin-top: -1px; }
.tier-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none;
  color: #111; background: linear-gradient(90deg, var(--a), var(--b)); border: 0;
  transition: filter .2s, transform .2s;
}
.tier-btn:hover { filter: brightness(1.12); color: #111; transform: translateY(-1px); }
.tier-btn i { font-size: 18px; }
.tier-supporter .tier-btn, .tier-patrull .tier-btn { color: #0d0d0d; }

/* Diamant stort kort: två kolumner på bred skärm */
@media (min-width: 768px) {
  .tier-featured .tier-inner { display: grid; grid-template-columns: minmax(220px, 1fr) 1.4fr; column-gap: 28px; align-items: start; }
  .tier-featured .tier-perks { margin-top: 0; padding-top: 0; border-top: 0; grid-row: span 2; }
  .tier-featured .tier-btn { align-self: end; margin-top: 18px; }
  .tier-featured .tier-icon { font-size: 44px; }
}
.tier-popular { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .tier, .tier-name, .tier-inner::before { animation: none !important; transition: none !important; }
}

.stripe-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.stripe-note { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); color: var(--text-light); text-decoration: none; font-size: 13px; font-weight: 500; transition: background .15s; }
.ghost-btn:hover { background: rgba(255,255,255,.07); color: var(--text-light); }

/* ---------- Donationslista ---------- */
.list-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.lstat { min-width: 0; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.lstat-val { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--accent-yellow); }
.lstat-val.green { color: var(--green); } .lstat-val.muted { color: var(--text-muted); }
.lstat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
@media (max-width: 480px) { .lstat { padding: 12px 6px; } .lstat-val { font-size: 22px; } .lstat-label { font-size: 9px; letter-spacing: .3px; } }

.honor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.honor-card { --a: var(--t-premium-a); --b: var(--t-premium-b); display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(var(--bg-card2), var(--bg-card2)) padding-box, linear-gradient(120deg, var(--a), var(--b)) border-box; border: 1.5px solid transparent; }
.honor-diamant { --a: var(--t-diamant-a); --b: var(--t-diamant-b); box-shadow: 0 0 24px -8px var(--t-diamant-a); }
.honor-icon { font-size: 26px; }
.honor-body { flex: 1; min-width: 0; }
.honor-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: linear-gradient(90deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.honor-meta { font-size: 11px; color: var(--text-muted); }
.honor-total { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(76,175,125,.6); animation: livePulse 2s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(76,175,125,0); } 100% { box-shadow: 0 0 0 0 rgba(76,175,125,0); } }
.empty-note { color: var(--text-muted); font-size: 14px; background: var(--bg-card); border-radius: 10px; padding: 16px; text-align: center; }

.donors-box { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.donors-box.faded { opacity: .8; }
.donor-table { width: 100%; border-collapse: collapse; }
.donor-table thead tr { background: rgba(0,85,204,.22); }
.donor-table th { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 12px 18px; text-align: left; }
.donor-table td { padding: 12px 18px; font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.donor-table tbody tr:last-child td { border-bottom: none; }
.donor-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.c-num { color: var(--text-muted); font-size: 12px; width: 40px; }
.c-muted { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.c-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dname { font-weight: 600; }
.dname-elite { color: var(--t-elite-a); }
.dname-patrull { color: var(--t-patrull-a); }
.row-elite td:first-child { box-shadow: inset 3px 0 0 var(--t-elite-b); }
.row-patrull td:first-child { box-shadow: inset 3px 0 0 var(--t-patrull-a); }
.row-supporter td:first-child { box-shadow: inset 3px 0 0 var(--t-supporter-a); }

.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.rbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; letter-spacing: .3px; white-space: nowrap; border: 1px solid; }
.rbadge-diamant   { color: var(--t-diamant-a); border-color: rgba(143,247,255,.4); background: rgba(143,247,255,.1); }
.rbadge-premium   { color: #d9b3ff; border-color: rgba(176,108,255,.45); background: rgba(176,108,255,.12); }
.rbadge-elite     { color: var(--t-elite-a); border-color: rgba(212,160,23,.4); background: rgba(212,160,23,.12); }
.rbadge-patrull   { color: var(--t-patrull-a); border-color: rgba(127,184,255,.35); background: rgba(127,184,255,.1); }
.rbadge-supporter { color: var(--t-supporter-a); border-color: rgba(224,160,112,.35); background: rgba(224,160,112,.1); }
.rbadge.is-ended  { color: #8a8a8a; border-color: rgba(255,255,255,.12); background: transparent; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status-pill.on  { color: var(--green); background: rgba(76,175,125,.12); border: 1px solid rgba(76,175,125,.35); }
.status-pill.off { color: #999; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); }

.former { margin-top: 22px; }
.former summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; padding: 12px 16px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line); margin-bottom: 12px; color: var(--text-muted); }
.former summary::-webkit-details-marker { display: none; }
.former summary .chev { margin-left: auto; transition: transform .2s; font-size: 20px; }
.former[open] summary .chev { transform: rotate(180deg); }

/* Tabeller blir kompakta kort på mobil: namn + totalt överst, roller under */
@media (max-width: 700px) {
  .donor-table thead { display: none; }
  .donor-table, .donor-table tbody { display: block; width: 100%; }
  .donor-table tr {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
    grid-template-areas: "name total" "badges badges" "meta status";
  }
  .donor-table tbody tr:last-child { border-bottom: 0; }
  .donor-table td { display: block; padding: 0; border: 0 !important; background: none !important; }
  .donor-table td:nth-child(1) { display: none; }
  .donor-table td:nth-child(2) { grid-area: name; min-width: 0; overflow-wrap: anywhere; }
  .donor-table td:nth-child(3) { grid-area: badges; }
  .donor-table td:nth-child(4) { grid-area: status; justify-self: end; }
  .donor-table td:nth-child(5) { grid-area: meta; font-size: 11px; }
  .donor-table td:nth-child(5)::before { content: attr(data-label) ": "; }
  .donor-table td:nth-child(6) { grid-area: total; text-align: right; }
  .donor-table .dname { font-size: 15px; }
  .row-elite td:first-child, .row-patrull td:first-child, .row-supporter td:first-child { box-shadow: none; }
  .row-elite { box-shadow: inset 3px 0 0 var(--t-elite-b); }
  .row-patrull { box-shadow: inset 3px 0 0 var(--t-patrull-a); }
  .row-supporter { box-shadow: inset 3px 0 0 var(--t-supporter-a); }
}

.legal { margin-top: 30px; padding: 18px 20px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.legal strong { color: var(--text-light); display: block; margin-bottom: 8px; }
.legal p { margin: 0 0 10px; } .legal p:last-child { margin: 0; }

/* ---------- Uniformsshop ---------- */
.uniform-link-box { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 3vw, 28px); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 40px; transition: border-color .2s; }
.uniform-link-box:hover { border-color: var(--primary-blue); }
.uniform-link-box-text h3 { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1.5px; font-weight: 400; margin: 0 0 4px; }
.uniform-link-box-text p { font-size: 13px; color: var(--text-muted); margin: 0; }
.uniform-link-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-blue); color: #fff; font-weight: 600; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-size: 14px; transition: background .2s; }
.uniform-link-btn:hover { background: #0044aa; color: var(--accent-yellow); }
@media (max-width: 575px) { .uniform-link-btn { width: 100%; justify-content: center; } }
