/* =============================================================
   Nordic-LED · "Komplett pakke" bundle styling  (v4 — UX)
   -------------------------------------------------------------
   WooCommerce Product Bundles, tabular layout. Layout goals (per mock):
     - solid WHITE card that lifts off the page
     - checkboxes / ticks aligned down the left edge
     - each item: [tick/checkbox] [thumb] [name] .......... [price right]
     - optional add-ons: "Legg til for" + price right, stock below
   ============================================================= */

/* ---- Card shell — solid white, clear lift ---- */
.single-product form.bundle_form,
.woocommerce form.cart.bundle_form,
body form.cart.bundle_form {
  background: #fff !important;
  border-radius: var(--nl-radius-lg, 18px);
  box-shadow: 0 14px 36px -16px rgba(15, 40, 25, .22), 0 0 0 1px var(--nl-green-100, #D7EFDD) !important;
  padding: 22px 24px;
  margin-top: 8px;
}
@media (max-width: 1023px) { .single-product form.bundle_form { padding: 16px 18px; } }

/* ---- Heading ---- */
.nl-bundle-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 4px; padding-bottom: 14px; border-bottom: 1px solid var(--nl-ink-100, #EEF1EF);
}
.nl-bundle-head .nl-eyebrow {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--nl-green-700, #0B7A3B);
}
.nl-bundle-head h2 { margin: 4px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.nl-bundle-head .nl-bundle-save {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--nl-red-50, #FEEAEA); color: var(--nl-red-500, #DC2626);
  font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.bundle_form > .nl-bundle-thisitem { display: none !important; }

/* =============================================================
   ITEM ROWS
   ============================================================= */
.bundle_form table.bundled_products,
.bundle_form table.bundled_products.bundled_products_hidden { display: block; width: 100%; margin: 0; border: 0; }
.bundle_form table.bundled_products thead { display: none; }
.bundle_form table.bundled_products tbody { display: block; }

.bundle_form tr.bundled_product {
  position: relative;
  display: flex !important; align-items: center; gap: 14px;
  margin: 0 !important; padding: 14px 0 !important;
  border-bottom: 1px solid var(--nl-ink-100, #EEF1EF); background: none !important;
}
.bundle_form tr.bundled_product:last-child { border-bottom: 0; }
.bundle_form td.bundled_item_col { display: block; padding: 0 !important; border: 0 !important; margin: 0; }

/* Dim out-of-stock rows */
.bundle_form tr.bundled_product:has(.stock.out-of-stock) td.bundled_item_images_col,
.bundle_form tr.bundled_product:has(.stock.out-of-stock) .bundled_product_title { opacity: .55; }

/* Included items (no checkbox) -> locked green tick at the left */
.bundle_form tr.bundled_product:not(:has(.bundled_product_checkbox))::before {
  content: ""; flex: 0 0 22px; order: -2; width: 22px; height: 22px; border-radius: 6px;
  background: var(--nl-green-600, #0F9047)
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}

/* Optional items -> pin the checkbox to the same left edge as the tick */
.bundle_form tr.bundled_product:has(.bundled_product_checkbox) { padding-left: 36px !important; }
.bundle_form .bundled_product_checkbox {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 6px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--nl-ink-300, #B7C0BC);
  cursor: pointer; display: grid; place-items: center; margin: 0;
  transition: background .12s, box-shadow .12s;
}
.bundle_form .bundled_product_checkbox:checked { background: var(--nl-green-600, #0F9047); box-shadow: none; }
.bundle_form .bundled_product_checkbox:checked::after {
  content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
}

/* Thumbnail */
.bundle_form td.bundled_item_images_col { order: -1; flex: 0 0 44px; }
.bundle_form td.bundled_item_images_col:empty { display: none; }
.bundle_form td.bundled_item_images_col img {
  width: 44px; height: 44px; border-radius: 10px; object-fit: contain;
  background: var(--nl-ink-50, #F7F9F8); box-shadow: inset 0 0 0 1px var(--nl-ink-100, #EEF1EF); display: block;
}

/* Details + name */
.bundle_form td.bundled_item_details_col { flex: 1 1 auto; min-width: 0; }
.bundle_form .details .bundled_product_title { margin: 0; padding: 0; }
.bundle_form .details .bundled_product_title_inner { font-size: 13.5px; font-weight: 600; color: var(--nl-ink-700, #2E3936); line-height: 1.3; }
.bundle_form .details .item_qty { color: var(--nl-ink-400, #828D88); font-weight: 600; }
.bundle_form .details .bundled_product_excerpt { display: none; }
.bundle_form .details .bundled_product_title a { color: inherit; text-decoration: none; }
.bundle_form .details .bundled_product_title a:hover { color: var(--nl-green-700, #0B7A3B); }

/* Price (shared) */
.bundle_form .bundled_item_cart_details .price {
  font-size: 14px; font-weight: 800; color: var(--nl-ink-900, #0C1311);
  white-space: nowrap; font-variant-numeric: tabular-nums; margin: 0;
}
.bundle_form .bundled_item_cart_details .price del { display: none; }
.bundle_form .bundled_item_cart_details .price ins { text-decoration: none; }
.bundle_form .bundled_item_cart_details .price .bundled_item_price_quantity { display: none; }
.bundle_form .bundled_item_after_cart_details { display: none; }
.bundle_form .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* INCLUDED row: name left (grows), price far right, on one line */
.bundle_form td.bundled_item_details_col:has(.cart[data-optional="no"]) .details {
  display: flex; align-items: center; gap: 12px;
}
.bundle_form td.bundled_item_details_col:has(.cart[data-optional="no"]) .bundled_product_title { flex: 1 1 auto; min-width: 0; }
.bundle_form .cart[data-optional="no"] { flex: 0 0 auto; margin-left: auto; }
.bundle_form .cart[data-optional="no"] .stock { display: none; }

/* OPTIONAL row: name on top; control row ("Legg til for" left, price right); stock below */
.bundle_form td.bundled_item_details_col:has(.cart[data-optional="yes"]) .details {
  display: flex; flex-direction: column; gap: 3px;
}
.bundle_form .cart[data-optional="yes"] .bundled_item_cart_details {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
}
.bundle_form .cart[data-optional="yes"] .bundled_item_cart_details .price { margin-left: auto; color: var(--nl-green-700, #0B7A3B); }
.bundle_form .cart[data-optional="yes"] .stock { flex-basis: 100%; margin: 0; font-size: 12px; font-weight: 600; }
.bundle_form .stock.in-stock { color: var(--nl-green-700, #0B7A3B); }
.bundle_form .stock.out-of-stock { color: var(--nl-red-500, #DC2626); }

/* Per-item qty column hidden (qty shows in title; hidden input still submits) */
.bundle_form td.bundled_item_qty_col { display: none; }

/* =============================================================
   TOTAL + CTA
   ============================================================= */
.bundle_form .bundle_data .bundle_price:not([style*="display: none"]) {
  margin: 16px 0 14px; padding-top: 16px; border-top: 1px solid var(--nl-ink-100, #EEF1EF);
}
.bundle_form .bundle_price .price { color: var(--nl-green-700, #0B7A3B); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.bundle_form .bundle_price .price del { color: var(--nl-ink-400, #828D88); font-size: 15px; font-weight: 600; margin-left: 10px; }
.bundle_form .bundle_price .price ins { text-decoration: none; }

.bundle_form .bundle_data .bundle_button { margin-top: 18px; display: flex; align-items: center; gap: 14px; }
.bundle_form .bundle_button .quantity { flex: 0 0 auto; }
.bundle_form .bundle_button .single_add_to_cart_button,
.bundle_form button.bundle_add_to_cart_button {
  flex: 1 1 auto;
  padding: 16px 24px; border: 0; border-bottom: 3px solid rgba(0, 0, 0, .18); border-radius: 8px;
  background: var(--nl-green-600, #0F9047); color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; transition: background .15s ease;
}
.bundle_form .bundle_button .single_add_to_cart_button:hover,
.bundle_form button.bundle_add_to_cart_button:hover { background: var(--nl-green-700, #0B7A3B); }