/* ==========================================================================
   Abonnement – vælg interval og kasser (template-subscription-builder.php).
   Scoped to .subb. Palette and type follow Forside v2 / start-abonnement.
   ========================================================================== */

.subb {
  --sb-green:      #334010;
  --sb-green-deep: #1a2e05;
  --sb-leaf:       #5d7a1f;
  --sb-amber:      #ff8a00;
  --sb-amber-deep: #e67a00;
  --sb-amber-ink:  #2b1900;
  --sb-ink:        #1a2e05;
  --sb-ink-2:      #4b5538;
  --sb-ink-3:      #6f7a5c;
  --sb-tint:       #f5f7ee;
  --sb-tint-2:     #e8edda;
  --sb-line:       #d7dbc8;
  --sb-red:        #a4341d;
  --sb-display:    "Fira Sans Extra Condensed", "Arial Narrow", system-ui, sans-serif;
  --sb-body:       "Lato", "Helvetica Neue", Arial, system-ui, sans-serif;
  --sb-bar-h:      0px;
  font-family: var(--sb-body); color: var(--sb-ink); background: #fff; font-size: 16px; line-height: 1.5; overflow-x: clip;
  padding-bottom: calc(48px + var(--sb-bar-h));
}
.thb-subb #wrapper, .thb-subb div[role="main"] { min-width: 0; max-width: 100%; }
.thb-subb .woocommerce-store-notice { display: none !important; }

.subb *, .subb *::before, .subb *::after { box-sizing: border-box; }
.subb img { max-width: 100%; height: auto; display: block; }
.subb :where(p) { margin: 0; text-wrap: pretty; }
.subb ul, .subb dl, .subb dd { margin: 0; padding: 0; list-style: none; }
.subb button { font-family: inherit; }
.subb [hidden] { display: none !important; }

.subb-wrap { max-width: 1240px; margin: 0 auto; padding-inline: clamp(14px, 3.5vw, 40px); }

/* ---- Type ---- */
.subb-h1, .subb-h2, .subb-h3 { font-family: var(--sb-display); font-weight: 700; color: var(--sb-ink); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.subb-h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1; }
.subb-h2 { font-size: clamp(25px, 2.8vw, 32px); line-height: 1.1; display: flex; align-items: center; gap: 12px; }
.subb-h3 { font-size: 23px; line-height: 1.1; }
.subb-lead { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; max-width: 58ch; color: var(--sb-ink-2); margin-top: 14px; }
.subb-hint { font-size: 14.5px; color: var(--sb-ink-3); margin-top: 10px; }
.subb-hint--top { margin: 6px 0 16px; font-size: 15.5px; color: var(--sb-ink-2); }
.subb-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sb-green-deep); color: #fff; font-size: 20px; display: grid; place-items: center; line-height: 1; }

/* ---- Hero ---- */
.subb-hero { background: var(--sb-tint); border-bottom: 1px solid var(--sb-line); padding-block: clamp(26px, 4.5vw, 56px) clamp(22px, 3.5vw, 40px); }
.subb-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px !important; font-weight: 700; font-size: 15.5px; color: var(--sb-green); }
.subb-facts li { display: flex; align-items: center; gap: 8px; }
.subb-facts li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--sb-leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.6 9.4l2.8 2.8 6-6.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; flex: none; }

.subb-alert { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: #fbe9e4; color: var(--sb-red); font-weight: 700; }

/* ---- Layout ---- */
.subb-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: clamp(22px, 3vw, 40px); }
.subb-step + .subb-step { margin-top: clamp(28px, 3.5vw, 44px); }
@media (min-width: 1024px) {
  .subb-layout { grid-template-columns: minmax(0, 1fr) 372px; gap: 44px; align-items: start; }
  .subb-summary { position: sticky; top: 118px; }
}

/* ---- 1 · Interval ---- */
.subb-freq { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 16px; padding: 6px; background: var(--sb-tint-2); border-radius: 16px; max-width: 520px; }
.subb-freq-btn { appearance: none; border: 0; background: transparent; color: var(--sb-green); font-size: 17px; font-weight: 700; min-height: 54px; padding: 8px 12px; border-radius: 11px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.subb-freq-btn:hover { background: rgba(255, 255, 255, .6); }
.subb-freq-btn[aria-checked="true"] { background: var(--sb-green-deep); color: #fff; box-shadow: 0 2px 8px rgba(26, 46, 5, .25); }
.subb-freq-btn:focus-visible, .subb-qty-btn:focus-visible, .subb-btn:focus-visible, .subb-line-x:focus-visible { outline: 3px solid var(--sb-amber); outline-offset: 2px; }

/* ---- 2 · Products ---- */
.subb-products { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 720px) { .subb-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }

.subb-product { border: 1.5px solid var(--sb-line); border-radius: 20px; overflow: hidden; background: #fff; display: grid; grid-template-columns: minmax(0, 1fr); transition: border-color .15s ease, box-shadow .15s ease; }
.subb-product.has-items { border-color: var(--sb-green); box-shadow: 0 0 0 3px rgba(93, 122, 31, .18); }
.subb-product-photo { aspect-ratio: 16 / 8; background: var(--sb-tint-2); overflow: hidden; }
.subb-product-photo img { width: 100%; height: 100%; object-fit: cover; }
.subb-product-body { padding: 16px 16px 8px; }
@media (max-width: 719px) {
  .subb-product-photo { aspect-ratio: 16 / 6.5; }
}

.subb-sizes { margin-top: 6px !important; }
.subb-size { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--sb-tint-2); }
.subb-size:first-child { border-top: 0; }
.subb-size-info { display: grid; gap: 1px; min-width: 0; }
.subb-size-label { font-weight: 700; font-size: 17px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.subb-badge { font-size: 12px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--sb-amber); color: var(--sb-amber-ink); white-space: nowrap; }
.subb-size-price { font-size: 16px; }
.subb-size-price strong { color: var(--sb-green); font-weight: 900; }
.subb-size-price s { color: var(--sb-ink-3); font-size: 14px; margin-left: 4px; }
.subb-size-kg { font-size: 13px; color: var(--sb-ink-3); }

.subb-qty { flex: none; display: grid; grid-template-columns: 44px 34px 44px; align-items: center; border: 1.5px solid var(--sb-green); border-radius: 999px; background: #fff; overflow: hidden; transition: background .15s ease; }
.subb-qty-btn { appearance: none; border: 0; background: transparent; color: var(--sb-green); width: 44px; height: 44px; font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0 0 2px; }
.subb-qty-btn:hover:not(:disabled) { background: var(--sb-tint-2); }
.subb-qty-btn:disabled { color: var(--sb-line); cursor: default; }
.subb-qty-n { text-align: center; font-weight: 900; font-size: 17px; color: var(--sb-ink); }
.subb-size.is-on .subb-qty { background: var(--sb-green-deep); border-color: var(--sb-green-deep); }
.subb-size.is-on .subb-qty-btn, .subb-size.is-on .subb-qty-n { color: #fff; }
.subb-size.is-on .subb-qty-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.subb-size.is-on .subb-qty-btn:disabled { color: rgba(255, 255, 255, .35); }
/* Untouched sizes show a single round "+" – less to read, obvious to tap. */
.subb-size:not(.is-on) .subb-qty { grid-template-columns: 44px; }
.subb-size:not(.is-on) .subb-minus, .subb-size:not(.is-on) .subb-qty-n { display: none; }

/* ---- Summary slip ---- */
.subb-slip { border: 2px solid var(--sb-green-deep); border-radius: 20px; background: #fff; overflow: hidden; padding: 0 20px 18px; }
.subb-h2--slip { margin: 0 -20px; padding: 16px 20px; background: var(--sb-green-deep); color: #fff; font-size: 26px; }
.subb-slip-freq { margin-top: 14px; font-weight: 700; color: var(--sb-green); }
.subb-empty { margin-top: 10px; color: var(--sb-ink-3); font-size: 15px; }
.subb-lines { margin-top: 10px !important; }
.subb-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--sb-line); font-size: 15.5px; }
.subb-line-price { font-weight: 700; white-space: nowrap; }
.subb-line-x { appearance: none; border: 0; background: var(--sb-tint-2); color: var(--sb-ink-2); width: 26px; height: 26px; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.subb-line-x:hover { background: var(--sb-line); }
.subb-totals { margin-top: 12px !important; display: grid; gap: 5px; }
.subb-totals-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--sb-ink-2); }
.subb-totals-row--save { color: var(--sb-leaf); font-weight: 700; }
.subb-totals-row--sum { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--sb-green-deep); color: var(--sb-ink); font-weight: 900; font-size: 19px; align-items: baseline; }
.subb-totals-row--sum dd { font-family: var(--sb-display); font-size: 30px; line-height: 1; }
.subb-ship { margin-top: 8px; font-size: 13.5px; color: var(--sb-ink-3); }
.subb-first { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--sb-tint); font-size: 14.5px; color: var(--sb-ink-2); }
.subb-first strong { display: block; color: var(--sb-ink); font-size: 15.5px; }

/* ---- CTA ---- */
.subb-cta { margin-top: 14px; }
.subb-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--sb-amber); color: var(--sb-amber-ink) !important; font-size: 18px; font-weight: 900; line-height: 1.15; cursor: pointer; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.subb-btn:hover:not(:disabled) { background: var(--sb-amber-deep); transform: translateY(-1px); }
.subb-btn--go { width: 100%; }
.subb-btn:disabled { background: var(--sb-tint-2); color: var(--sb-ink-3) !important; cursor: not-allowed; font-weight: 700; font-size: 16px; }
.subb-btn.is-loading { opacity: .7; pointer-events: none; }
.subb-pay { margin-top: 10px; font-size: 14px; color: var(--sb-ink-2); text-align: center; }
.subb-cta-sum { display: none; }

/* Mobile / tablet: the button and the total stay within reach at the bottom. */
@media (max-width: 1023px) {
  .subb-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--sb-line); box-shadow: 0 -6px 20px rgba(26, 46, 5, .12); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .subb-cta.has-items { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; }
  .subb-cta-sum:not([hidden]) { display: grid; line-height: 1.15; }
  .subb-cta-sum span { font-size: 12.5px; color: var(--sb-ink-3); }
  .subb-cta-sum strong { font-family: var(--sb-display); font-size: 25px; white-space: nowrap; }
  .subb-btn--go { min-height: 52px; font-size: 17px; padding: 0 16px; }
  .subb-pay { grid-column: 1 / -1; margin: 0; font-size: 12.5px; line-height: 1.35; }
  /* Cookie button sits above the bar instead of on top of the button. */
  body.thb-subb .heyrobot-cc-reopen { bottom: calc(var(--subb-bar-h, 84px) + 12px) !important; }
}

/* ---- Info ---- */
.subb-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; margin-top: clamp(40px, 5vw, 72px); }
.subb-info-item { padding: 18px 0; border-top: 1px solid var(--sb-line); }
.subb-info-item p { margin-top: 6px; color: var(--sb-ink-2); font-size: 15.5px; line-height: 1.6; max-width: 62ch; }
@media (min-width: 760px) { .subb-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.subb-closed { padding-block: 80px; text-align: center; display: grid; justify-items: center; gap: 16px; }

@media (prefers-reduced-motion: reduce) { .subb * { transition: none !important; } }
