/* Norsk Gift Rewards v0.1.16 - matches the Norsk storefront, no frontend framework. */
:root { --nfg-green: #69c40e; --nfg-green-dark: #3d7f08; --nfg-ink: #131b12; --nfg-muted: #586251; --nfg-border: #e5e9e1; --nfg-soft: #f5f8f1; }
.nfg-modal[hidden], .nfg-cart-trigger-wrap[hidden] { display: none !important; }
.nfg-modal .nfg-modal__done[hidden] { display: none !important; }
body.nfg-modal-open { overflow: hidden !important; }
.nfg-modal { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; isolation: isolate; }
.nfg-modal *, .nfg-sticky-banner *, .nfg-cart-trigger-wrap * { box-sizing: border-box; }
.nfg-modal__backdrop { position: absolute; inset: 0; background: rgba(8,14,8,.74); }
.nfg-modal__dialog { position: relative; width: min(1120px, 100%); max-height: min(88dvh, 900px); overflow-y: auto; overscroll-behavior: contain; border-radius: 14px; background: #fff; color: var(--nfg-ink); padding: clamp(20px, 3.5vw, 36px); box-shadow: 0 24px 80px rgba(0,0,0,.30); outline: none; font-family: 'Open Sans', Arial, sans-serif; }
.nfg-modal__close { position: absolute; right: 14px; top: 12px; z-index: 1; width: 42px; height: 42px; background: #f4f6f1; color: #222; border: 0; border-radius: 50%; font: 28px/1 Arial,sans-serif; cursor: pointer; }
.nfg-modal__close:hover, .nfg-modal__close:focus-visible { background: #e0e9d7; }
.nfg-modal h2 { font-family: Oswald, 'Arial Narrow', Arial, sans-serif; font-size: clamp(24px,3.5vw,36px); font-weight: 700; line-height: 1.12; text-transform: uppercase; margin: 0 40px 12px 0; color: var(--nfg-ink); letter-spacing: .01em; }
.nfg-modal__description { margin: 0; font-size: 14px; line-height: 1.5; color: var(--nfg-muted); }
.nfg-modal__meter { font-size: 12px; line-height: 1.4; letter-spacing: .08em; font-weight: 800; text-transform: uppercase; margin: 16px 0 14px; color: #386b06; border-bottom: 1px solid var(--nfg-border); padding-bottom: 12px; }
.nfg-modal__products { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: stretch; }
/* The three-choice view keeps its original 1120px dialog and natural card widths.
   Two choices retain those card widths, with the third column removed.
   One choice centers a normal-width card instead of stretching it edge to edge. */
.nfg-modal__dialog[data-nfg-gift-count="2"] { width: min(766px, 100%); }
.nfg-modal__dialog[data-nfg-gift-count="1"] { width: min(500px, 100%); padding: 28px; }
.nfg-modal__dialog[data-nfg-gift-count="2"] .nfg-modal__products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nfg-modal__dialog[data-nfg-gift-count="2"] .nfg-modal__actions { gap: 10px; }
.nfg-modal__dialog[data-nfg-gift-count="1"] .nfg-modal__products { grid-template-columns: minmax(0, 338px); justify-content: center; }
/* Only navigation is at the bottom; adding/changing gifts happens on each card. */
.nfg-modal__dialog[data-nfg-gift-count="1"] .nfg-modal__actions { gap: 10px; }
.nfg-modal .nfg-modal__dialog[data-nfg-gift-count="1"] .nfg-modal__done,
.nfg-modal .nfg-modal__dialog[data-nfg-gift-count="1"] .nfg-modal__cart-link { flex: 1 1 160px; min-width: 0; padding: 12px 10px; }
.nfg-product { min-width: 0; padding: 14px; border: 1px solid var(--nfg-border); border-radius: 12px; background: #fff; text-align: center; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; display: flex; flex-direction: column; gap: 10px; }
.nfg-product--selected { border-color: var(--nfg-green); box-shadow: 0 0 0 3px rgba(105,196,14,.28) inset, 0 14px 24px rgba(34, 71, 9, .10); background: linear-gradient(180deg, #f8fdf3 0%, #fbfef8 100%); }
.nfg-product--replacing { border-color: #3d7f08; box-shadow: 0 0 0 3px rgba(105,196,14,.32) inset; }
.nfg-product--disabled { opacity: .65; }
.nfg-product__image { position: relative; border-radius: 8px; background: var(--nfg-soft); height: clamp(180px, 29vh, 310px); display: grid; place-items: center; overflow: hidden; padding: 20px; }
.nfg-product__image img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.nfg-product__free { position: absolute; top: 12px; left: 12px; background: var(--nfg-green); color: #172b0b; padding: 5px 10px; font-weight: 900; font-size: 11px; letter-spacing: .06em; border-radius: 3px; }
.nfg-modal .nfg-product__action, .nfg-modal button.nfg-product__action {
  width: 100%; min-height: 46px; margin: 2px 0 0; padding: 11px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--nfg-green) !important; border: 1px solid var(--nfg-green) !important;
  color: #fff !important; border-radius: 5px; cursor: pointer;
  font: 700 15px/1.2 Oswald, 'Arial Narrow', Arial, sans-serif;
  letter-spacing: .045em; text-align: center; text-transform: uppercase;
  transition: color .15s ease, background-color .15s ease;
}
.nfg-modal .nfg-product__action:hover:not(:disabled), .nfg-modal .nfg-product__action:focus-visible:not(:disabled) {
  color: var(--nfg-green-dark) !important; background: #fff !important;
}
.nfg-modal .nfg-product__action--current, .nfg-modal .nfg-product__action--current:disabled,
.nfg-modal .nfg-product__action--target { background: #eef7e5 !important; color: #276608 !important; border-color: #9fce79 !important; opacity: 1; cursor: default; }
.nfg-modal .nfg-product__action--target { cursor: pointer; }
.nfg-modal .nfg-product__action:disabled:not(.nfg-product__action--current) { cursor: wait; opacity: .66; }
.nfg-product__status { min-height: 26px; display: flex; justify-content: center; align-items: center; }
.nfg-product__state { font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .05em; color: #466c21; text-transform: uppercase; }
.nfg-product__state--selected { color: #214d07; font-size: 12px; letter-spacing: .08em; }
.nfg-product__state--pending { color: #2f6511; }
.nfg-product__state--unavailable { color: #8c1717; }
.nfg-product__name { color: var(--nfg-ink); font-size: 18px; line-height: 1.3; min-height: 46px; font-weight: 700; margin: 0; }
.nfg-product__footer { margin-top: auto; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.nfg-product__hint { font-size: 13px; color: var(--nfg-muted); font-weight: 600; }
.nfg-product--selected .nfg-product__hint { color: #214d07; font-weight: 700; }
.nfg-product__remove { min-width: 120px; height: 38px; border: 1px solid #cedbc4; background: #fff; border-radius: 6px; color: #1f2c17; font-weight: 800; font-size: 12px; cursor: pointer; letter-spacing: .04em; }
.nfg-product__remove:hover { background: #f4f8ef; }
.nfg-product__unavailable { color: #8c1717; font-size: 11px; font-weight: 700; margin: 7px 0 0; }
.nfg-modal__message { min-height: 18px; text-align: center; font-size: 12px; font-weight: 600; margin: 12px 0 4px; color: #466c21; }
.nfg-modal__actions { display: flex; gap: 14px; align-items: center; justify-content: center; padding-top: 8px; flex-wrap: wrap; }
.nfg-modal .nfg-modal__done, .nfg-modal .nfg-modal__cart-link, .nfg-modal .button.nfg-modal__done, .nfg-modal a.button.nfg-modal__cart-link { display: inline-flex; justify-content: center; align-items: center; gap: 7px; background: var(--nfg-green) !important; color: #fff !important; border: 1px solid var(--nfg-green) !important; border-radius: 5px; cursor: pointer; padding: 14px 26px; min-width: 220px; min-height: 49px; font: 700 15px/1.2 Oswald, 'Arial Narrow', Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; text-align: center; text-decoration: none; box-shadow: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.nfg-modal .nfg-modal__done:hover:not(:disabled), .nfg-modal .nfg-modal__cart-link:hover, .nfg-modal .button.nfg-modal__done:hover:not(:disabled), .nfg-modal a.button.nfg-modal__cart-link:hover { background: #fff !important; border-color: var(--nfg-green) !important; color: var(--nfg-green) !important; text-decoration: none; }
.nfg-sticky-banner { font-family: 'Open Sans',Arial,sans-serif; background: #f2f9eb; color: #143509; border: 1px solid #bcdba5; border-radius: 8px; margin: 12px 12px 6px; padding: 11px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.nfg-sticky-banner__title { font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .035em; }
.nfg-sticky-banner__note { font-size: 11px; line-height: 1.3; color: #405e35; }
.nfg-sticky-banner__button { border: 0; border-radius: 4px; background: #69c40e; color: #13270b; padding: 9px 12px; font-size: 11px; font-weight: 800; white-space: normal; text-align: center; cursor: pointer; width: 100%; }
.nfg-sticky-banner__button:hover { background: #7dda22; }
.nfg-cart-trigger-wrap { margin: 14px 0; }
.nfg-cart-trigger { display: block; width: 100%; padding: 13px 18px; color: #162a08; background: var(--nfg-green); border: 0; font-weight: 800; text-transform: uppercase; cursor: pointer; border-radius: 5px; }
.nfg-cart-trigger:hover { background: #7ad628; }
.nfg-price-free, .nfg-gift-tag { color: #317200; font-weight: 800; }
.nfg-gift-tag { font-size: 10px; padding: 2px 6px; background: #e5f6d7; border-radius: 3px; white-space: nowrap; }
.nfg-modal button:focus-visible, .nfg-sticky-banner button:focus-visible, .nfg-cart-trigger:focus-visible { outline: 3px solid #35730a; outline-offset: 2px; }
@media (max-width: 760px) {
  .nfg-modal { padding: 10px; }
  .nfg-modal__dialog { padding: 19px 13px 16px; max-height: 91dvh; border-radius: 11px; }
  .nfg-modal__close { right: 8px; top: 7px; width: 36px; height: 36px; }
  .nfg-modal__products { grid-template-columns: 1fr; gap: 12px; }
  .nfg-modal__dialog[data-nfg-gift-count="1"],
  .nfg-modal__dialog[data-nfg-gift-count="2"] { width: min(460px, 100%); }
  .nfg-modal__dialog[data-nfg-gift-count="1"] { padding: 19px 13px 16px; }
  .nfg-modal__dialog[data-nfg-gift-count="1"] .nfg-modal__products,
  .nfg-modal__dialog[data-nfg-gift-count="2"] .nfg-modal__products { grid-template-columns: minmax(0, 1fr); }
  .nfg-product__image { height: clamp(150px, 22dvh, 205px); min-height: 150px; }
  .nfg-product__name { min-height: 0; }
  .nfg-modal .nfg-product__action { min-height: 48px; }
  .nfg-modal__meter { margin-top: 11px; }
  .nfg-modal .nfg-modal__done, .nfg-modal .nfg-modal__cart-link { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .nfg-product { transition: none; }
}



/* Product-style gift offer in the regular WooCommerce cart (Blocks and Classic).
   Do not insert a fictitious WooCommerce cart line: only the shopper's selected
   real product is added to the cart via the secure gift endpoint. */
.nfg-cart-gift-row {
  --nfg-gift-green: #69c40e;
  font-family: 'Open Sans', Arial, sans-serif;
  color: #172116;
}
.nfg-cart-gift-row--blocks {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 22px;
  padding: 22px 20px;
  margin: -1px 0 15px;
  border: 1px solid #dbe5d3;
  background: #f8fcf5;
  border-radius: 0 0 10px 10px;
}
.nfg-cart-gift-row--classic td {
  vertical-align: middle !important;
  background: #f8fcf5;
  border-top: 1px solid #dbe5d3;
  border-bottom: 1px solid #dbe5d3;
  padding-top: 18px;
  padding-bottom: 18px;
}
.nfg-cart-gift-row__picture { width: 106px; }
.nfg-cart-gift-row__thumbnails {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 7px; overflow: hidden;
  background: #ecf3e7;
}
.nfg-cart-gift-row__thumbnails--multiple { gap: 3px; padding: 6px; }
.nfg-cart-gift-row__thumb { width: 100%; height: 100%; object-fit: contain; min-width: 0; }
.nfg-cart-gift-row__thumbnails--multiple .nfg-cart-gift-row__thumb { width: 33.33%; height: 80%; flex: 1 1 0; }
.nfg-cart-gift-row__symbol { font-size: 40px; line-height: 1; }
.nfg-cart-gift-row__details { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.nfg-cart-gift-row__eyebrow { color: #387407; font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.nfg-cart-gift-row__title { color: #172116; font: 700 22px/1.2 Oswald, 'Arial Narrow', Arial, sans-serif; text-transform: uppercase; }
.nfg-cart-gift-row__note { color: #52604a; font-size: 13px; line-height: 1.4; margin: 2px 0 7px; }
.nfg-cart-gift-row__price { align-self: center; color: #317200; font: 700 16px/1.2 Oswald, 'Arial Narrow', Arial, sans-serif; letter-spacing: .05em; }
.nfg-cart-gift-row__button, .nfg-cart-gift-row__button.button {
  display: inline-flex; justify-content: center; align-items: center;
  background: var(--nfg-gift-green) !important; border: 1px solid var(--nfg-gift-green) !important;
  color: #fff !important; border-radius: 5px; padding: 11px 17px;
  cursor: pointer; font: 700 14px/1.2 Oswald, 'Arial Narrow', Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .035em; min-height: 42px;
  text-decoration: none; transition: background-color .15s ease, color .15s ease;
}
.nfg-cart-gift-row__button:hover, .nfg-cart-gift-row__button:focus-visible {
  background: #fff !important; color: #397b08 !important;
}
.nfg-cart-gift-row__button:focus-visible { outline: 3px solid #327602; outline-offset: 2px; }
.nfg-cart-gift-row--classic .product-price .nfg-cart-gift-row__price { font-weight: 700; }
@media (max-width: 760px) {
  .nfg-cart-gift-row--blocks { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .nfg-cart-gift-row__picture { width: 76px; }
  .nfg-cart-gift-row__title { font-size: 18px; }
  .nfg-cart-gift-row--blocks .nfg-cart-gift-row__price { grid-column: 1 / -1; justify-self: end; }
  .nfg-cart-gift-row__button { width: 100%; }
  .nfg-cart-gift-row--classic td.product-thumbnail { display: table-cell !important; }
  .nfg-cart-gift-row--classic td.product-remove,
  .nfg-cart-gift-row--classic td.product-quantity,
  .nfg-cart-gift-row--classic td.product-subtotal { display: none !important; }
}

/* Keep the cart gift offer visible in custom Cart Blocks layouts that replace
   the default WooCommerce items table with a custom item wrapper. */
.nfg-cart-gift-row--blocks { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.nfg-cart-gift-row--blocks *, .nfg-cart-gift-row--classic * { box-sizing: border-box; }
.wp-block-woocommerce-cart-items-block > .nfg-cart-gift-row--blocks,
.wp-block-woocommerce-cart-line-items-block + .nfg-cart-gift-row--blocks {
  margin-top: 0;
}

/* Keep the selected reward editable in both regular cart layouts. */
.nfg-cart-gift-row--claimed { border-color: #b3d895; background: #f4faef; }
.nfg-cart-gift-row--claimed .nfg-cart-gift-row__eyebrow { color: #316f09; }
.nfg-cart-gift-row--claimed .nfg-cart-gift-row__thumbnails { background: #edf6e5; }
