/* ==========================================================================
   Single Product Redesign v1 — Matthuset
   Sticky gallery + accordion details layout
   ========================================================================== */

/* ---------- Reset Storefront defaults that conflict ---------- */
/* Match archive page width so product pages are not narrower */@media (min-width: 1024px) {  .single-product .col-full {    max-width: 100em;  }}

/* Fix: overflow-x:hidden on .site kills position:sticky */
.single-product .site {
  overflow-x: visible !important;
  overflow: visible !important;
}

.single-product .site-content,
.single-product #primary,
.single-product #content,
.single-product .content-area,
.single-product .col-full {
  overflow: visible !important;
}

.product-redesign.product {
  overflow: visible !important;
}

.storefront-full-width-content.single-product div.product.product-redesign .images,
.storefront-full-width-content.single-product div.product.product-redesign .summary {
  width: 100% !important;
  float: none !important;
  margin-right: 0 !important;
}

/* Hide the old separate additional-info and description blocks below summary */
.product-redesign ~ .additional-info,
.product-redesign ~ .product-description,
.woocommerce-tabs {
  display: none !important;
}

/* ---------- Two-column layout ---------- */
.product-redesign__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

@media (min-width: 768px) {
  .product-redesign__columns {
    grid-template-columns: 70% 1fr;
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .product-redesign__columns {
    grid-template-columns: 75% 1fr;
    gap: 1.5rem;
  }
}

/* ---------- Sticky Gallery ---------- */
.product-redesign__gallery {
  position: relative;
}

@media (min-width: 768px) {
  .product-redesign__gallery {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

/* Gallery: vertical thumbnails left, main image right */
.product-redesign__gallery .woocommerce-product-gallery {
  margin-bottom: 0 !important;
  float: none !important;
  width: 100% !important;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .product-redesign__gallery .woocommerce-product-gallery {
    display: grid;
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto;
    gap: 6px;
  }

  /* Thumbnails: left column, vertical stack */
  .product-redesign__gallery .flex-control-thumbs {
    grid-column: 1;
    grid-row: 1;
    order: -1;
  }

  /* Main image: right column */
  .product-redesign__gallery .woocommerce-product-gallery__wrapper {
    grid-column: 2;
    grid-row: 1;
  }
}

.product-redesign__gallery .woocommerce-product-gallery__image img {
  border-radius: 8px;
  width: 100%;
}

/* Thumbnail strip */
.product-redesign__gallery .flex-control-thumbs {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  max-height: 600px;
  overflow-y: auto;
}

/* Mobile: horizontal row */
@media (max-width: 767px) {
  .product-redesign__gallery .flex-control-thumbs {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    margin-top: 10px;
  }
}

.product-redesign__gallery .flex-control-thumbs li {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .product-redesign__gallery .flex-control-thumbs li {
    width: 60px !important;
  }
}

.product-redesign__gallery .flex-control-thumbs li img {
  border-radius: 6px;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
  cursor: pointer;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-redesign__gallery .flex-control-thumbs li img:hover,
.product-redesign__gallery .flex-control-thumbs li img.flex-active {
  border-color: #333;
  opacity: 1;
}

/* ---------- Details column ---------- */
.product-redesign__details {
  min-width: 0;
}

.product-redesign__details .summary {
  width: 100% !important;
  float: none !important;
  margin-bottom: 0 !important;
}

/* ---------- Typography ---------- */
.product-redesign__details .product_title.entry-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.product-redesign__details .price,
.product-redesign__details .price .woocommerce-Price-amount {
  font-size: 1.5rem !important;
  font-weight: 700;
  color: #1a1a1a !important;
  margin-bottom: 1rem;
  display: block;
}

.product-redesign__details .price del .woocommerce-Price-amount {
  color: #999 !important;
  font-size: 1.1rem !important;
  font-weight: 400;
}

.product-redesign__details .price ins {
  text-decoration: none;
}

.product-redesign__details .woocommerce-product-details__short-description {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #444;
  margin-bottom: 1.5rem;
}

/* Stock status */
.product-redesign__details .stock {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35em 0.75em;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1rem;
}

.product-redesign__details .stock.in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.product-redesign__details .stock.order-item {
  background: #fff3e0;
  color: #e65100;
}

.product-redesign__details .stock.out-of-stock {
  background: #ffebee;
  color: #c62828;
}

/* ---------- Cart / Order Form ---------- */
.product-redesign__details form.cart {
  background: #faf7f2 !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  margin-top: 1.5rem;
  border: 1px solid #e8e8e8;
}

/* ----- Variation options (WC variable products) — rebuilt as card grid ----- */
.product-redesign__details table.variations {
  margin: 0 0 1rem !important;
  width: 100%;
  border: none !important;
  border-collapse: collapse;
  display: block;
}

.product-redesign__details table.variations tbody,
.product-redesign__details table.variations tr {
  display: block;
  width: 100%;
}

.product-redesign__details table.variations tr.attribute-pa_storlekar,
.product-redesign__details table.variations tr[class*="attribute-"] {
  display: block;
  margin-bottom: 0.75rem;
}

.product-redesign__details table.variations th.label,
.product-redesign__details table.variations td.label {
  display: block;
  width: 100%;
  padding: 0 0 0.55rem !important;
  background: transparent !important;
  border: none !important;
}

.product-redesign__details table.variations th.label label,
.product-redesign__details table.variations td.label label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  text-transform: none;
  letter-spacing: 0;
}

.product-redesign__details table.variations td.value {
  display: block;
  width: 100%;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.product-redesign__details table.variations td.value > div {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
}

/* Card grid for attribute radios */
.product-redesign__details table.variations td.value {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  grid-auto-rows: 1fr;
}

.product-redesign__details table.variations td.value > div {
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.product-redesign__details table.variations td.value > div > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-redesign__details table.variations td.value > div > label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #333 !important;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: background-color, color, border-color;
  text-align: left;
  line-height: 1.25;
  margin: 0 !important;
  box-sizing: border-box;
}

.product-redesign__details table.variations td.value > div > label:hover {
  border-color: #1a1a1a;
  background: #faf7f2;
}

.product-redesign__details table.variations td.value > div > input[type="radio"]:checked + label {
  border-color: #1a1a1a !important;
  background: #1a1a1a !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hide the "Clear" reset link — clutter on a 2-option picker */
.product-redesign__details table.variations tr:has(.reset_variations) {
  display: none !important;
}

.product-redesign__details table.variations .reset_variations {
  display: none !important;
}

/* Info callout (neutralised from legacy green) */
.product-redesign__details .wccc-content-block {
  background: #faf7f2 !important;
  border-left: 4px solid #1a1a1a;
  border-radius: 6px !important;
  padding: 1rem 1.25rem !important;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #333;
  margin: 1rem 0;
}

/* Price total in form */
.product-redesign__details .single_variation .price {
  font-size: 1.75rem !important;
  font-weight: 700;
  color: #1a1a1a !important;
}

/* CTA Button */
.product-redesign__details form.cart .button,
.product-redesign__details form.cart .single_add_to_cart_button {
  width: 100%;
  padding: 1rem 2rem !important;
  font-size: 1.1rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 8px !important;
  background-color: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #fff !important;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-top: 0.5rem;
}

.product-redesign__details form.cart .button:hover,
.product-redesign__details form.cart .single_add_to_cart_button:hover {
  background-color: #333 !important;
  transform: translateY(-1px);
}

/* Inputs in cart form */
.product-redesign__details form.cart select {
  border-radius: 6px !important;
  border: 1px solid #ccc !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  height: auto !important;
}

.product-redesign__details form.cart input[type='text'],
.product-redesign__details form.cart input[type='number'],
.product-redesign__details form.cart .input-text {
  border-radius: 6px !important;
  border: 1px solid #ccc;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

/* Gravity Forms fields inside cart */
.product-redesign__details .ginput_container input,
.product-redesign__details .ginput_container select {
  border-radius: 6px !important;
  border: 1px solid #ccc !important;
}

/* Single variation wrap */
.product-redesign__details .single_variation_wrap {
  border-top: 1px solid #ddd;
  padding-top: 1rem !important;
  margin-top: 1.25rem !important;
}

/* ---------- Delivery info note — clean integration, inline-style overrides ----------
   Template has hard-coded inline styles (width:30% on icon div, width:87% + padding-left:20px on p,
   padding:1.2em + bg #f8f8f8 on container). Force max-specificity overrides. */
html body .product-redesign .delivery-time,
html body .product-redesign__details .delivery-time {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-top: 1px solid #ececec !important;
  border-radius: 0 !important;
  padding: 1rem 0 0 !important;
  margin: 1rem 0 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 0.65rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

html body .product-redesign .delivery-time > div,
html body .product-redesign__details .delivery-time > div {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  flex: 0 0 18px !important;
  padding: 0 !important;
  margin: 2px 0 0 !important;
  box-sizing: border-box !important;
}

html body .product-redesign .delivery-time svg,
html body .product-redesign__details .delivery-time svg {
  width: 16px !important;
  height: 16px !important;
  fill: #aaa !important;
  display: block !important;
  max-width: 16px !important;
}

html body .product-redesign .delivery-time p,
html body .product-redesign__details .delivery-time p {
  font-size: 0.8rem !important;
  line-height: 1.55 !important;
  color: #666 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  max-width: none !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

/* ---------- Accordion ---------- */
.product-redesign__accordions {
  margin-top: 0;
  border-top: none;
}

.product-accordion {
  border-bottom: 1px solid #e5e5e5;
}

.product-accordion__trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 1.1rem 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: var(--font-sans, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transition: color 0.18s ease !important;
}

.product-accordion__trigger:hover,
.product-accordion__trigger:focus {
  background: none !important;
  color: #1a1a1a !important;
  box-shadow: none !important;
}

.product-accordion__trigger:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
  border-radius: 2px;
}

.product-accordion__trigger:focus:not(:focus-visible) {
  outline: none;
}

.product-accordion__icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.product-accordion__trigger[aria-expanded="true"] .product-accordion__icon {
  transform: rotate(180deg);
}

.product-accordion__content {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.product-accordion__content[aria-hidden="true"] {
  max-height: 0;
  opacity: 0;
}

.product-accordion__content[aria-hidden="false"] {
  max-height: 2000px;
  opacity: 1;
}

.product-accordion__inner {
  padding: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
}

.product-accordion__inner p {
  margin-bottom: 0.75rem;
}

.product-accordion__inner p:last-child {
  margin-bottom: 0;
}

/* Attributes table inside accordion */
.product-accordion__inner table.shop_attributes {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.product-accordion__inner table.shop_attributes th {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid #eee;
  width: 35%;
  white-space: nowrap;
}

.product-accordion__inner table.shop_attributes td {
  font-size: 0.85rem;
  color: #555;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
}

.product-accordion__inner table.shop_attributes td p {
  margin: 0;
}

/* ---------- Related / Upsell products ---------- */
.product-redesign ~ .related.products,
.product-redesign ~ .up-sells.upsells,
.woocommerce .related.products,
.woocommerce .up-sells.upsells {
  clear: both;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid #eee;
}

.product-redesign ~ .related.products h2,
.product-redesign ~ .up-sells.upsells h2,
.woocommerce .related.products > h2,
.woocommerce .up-sells.upsells > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: left;
  margin-bottom: 1.5rem;
}

/* ---------- Breadcrumb: hide top one, show in details column ---------- */
.single-product #content ~ .storefront-breadcrumb,
.single-product .site-content ~ .storefront-breadcrumb,
.single-product > .hfeed > .storefront-breadcrumb,
#page > .storefront-breadcrumb {
  display: none;
}

.product-redesign__details > .storefront-breadcrumb {
  display: block;
  margin: 0 0 0.5rem !important;
  padding: 0 !important;
}

/* Force the inner .col-full flush with the surrounding .summary content
   (title, price). Storefront's parent `.col-full` and wp_custom_css both
   apply em-based margin-left on mobile (`.41575em`), and Storefront's base
   sets `padding: 0 2.617924em` — both of which leave the breadcrumb inset
   relative to the title. !important to short-circuit the cascade race. */
.product-redesign__details > .storefront-breadcrumb .col-full,
.product-redesign__details .storefront-breadcrumb .col-full {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Single-line horizontal-scroll breadcrumb. Long crumbs like
   "Matthuset.se > Mattor > Handknutet, Handloomade & Kelim" would otherwise
   wrap to 2+ lines on mobile and steal vertical space above the title.
   Scrollbar is hidden — users swipe to see the rest. */
.product-redesign__details .woocommerce-breadcrumb {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  /* Soft fade at the right edge so the cut-off looks intentional and hints
     "swipe for more". */
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.product-redesign__details .woocommerce-breadcrumb::-webkit-scrollbar {
  display: none; /* WebKit */
}

.product-redesign__details .woocommerce-breadcrumb::before,
.product-redesign__details .storefront-breadcrumb::before,
.product-redesign__details .woocommerce-breadcrumb a:first-child::before {
  display: none !important;
  content: none !important;
}

.product-redesign__details .woocommerce-breadcrumb a {
  color: #666;
  text-decoration: none;
}

.product-redesign__details .woocommerce-breadcrumb a:hover {
  color: #333;
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 767px) {
  .product-redesign__details .product_title.entry-title {
    font-size: 1.4rem;
  }

  .product-redesign__details .price,
  .product-redesign__details .price .woocommerce-Price-amount {
    font-size: 1.3rem !important;
  }

  .product-redesign__details form.cart {
    padding: 1.25rem !important;
    border-radius: 10px !important;
  }

  .product-accordion__trigger {
    padding: 1rem 0;
    font-size: 0.95rem;
  }

  .product-redesign__gallery .flex-control-thumbs {
    flex-direction: row;
    gap: 6px;
  }
}

/* ---------- Hide the old after-summary additional-info ---------- */
.single-product .woocommerce .additional-info:not(.product-accordion__inner .additional-info),
.single-product .woocommerce .product-description:not(.product-accordion__inner .product-description) {
  display: none !important;
}

/* Override old float-based layout for .images and .summary inside redesign */
.product-redesign .woocommerce-product-gallery,
.product-redesign .summary.entry-summary {
  float: none !important;
  width: 100% !important;
  margin-right: 0 !important;
}

/* Product sharing cleanup */
.product-redesign .storefront-product-sharing {
  float: none !important;
  width: 100% !important;
  clear: none !important;
}

/* Excerpt accordion uses the base .product-accordion style — no overrides. */

/* ==========================================================================
   Gravity Forms cart — refined, contemporary
   Scoped to product page form so we don't break other Gravity Forms.
   ========================================================================== */

.product-redesign .gform_wrapper form.cart {
  background: #faf7f2;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
  /* Isolate layout so conditional-logic field toggles don't cascade reflow up the page. */
  contain: layout style;
  will-change: contents;
}

.product-redesign .gform_wrapper .gform_fields {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.product-redesign .gform_wrapper .gfield {
  margin: 0 0 1.25rem !important;
  padding: 0 !important;
  list-style: none !important;
}

.product-redesign .gform_wrapper .gfield::before,
.product-redesign .gform_wrapper .gfield::after {
  display: none !important;
}

/* Hide calculation fields visually but keep them in layout for GF's JS engine */
.product-redesign .gform_wrapper .gf_invisible,
.product-redesign .gform_wrapper .gf_hidden {
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Labels — sentence case, calmer weight */
.product-redesign .gform_wrapper .gfield_label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  margin: 0 0 0.5rem;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
}

/* Parent-theme legacy leak: .gform_wrapper .gform_body .form-notes label
   paints green text + 4px green top border + shadow. Neutralise under our scope. */
.product-redesign .gform_wrapper .gform_body .form-notes label,
.product-redesign .gform_wrapper .gform_body .form-notes label.gfield_label,
.product-redesign .gform_wrapper .form-notes label.gfield_label {
  color: #444 !important;
  background: transparent !important;
  border: none !important;
  border-top: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: none !important;
  border-radius: 0 !important;
  font-weight: 400 !important;
}

/* Parent-theme legacy leak: .woocommerce-Price-amount { color: #060 }
   leaks into any wc_price span including the header price + GF total.
   GF legacy CSS also paints span.ginput_total green.
   Force dark with maximum specificity. */
.product-redesign .woocommerce-Price-amount,
.product-redesign .gform_wrapper .woocommerce-Price-amount,
.product-redesign .gform_wrapper span.ginput_total,
.product-redesign .gform_wrapper .ginput_total,
.product-redesign .gform_wrapper .ginput_total *,
.product-redesign .gform_wrapper .gfield--type-total,
.product-redesign .gform_wrapper .gfield--type-total *,
.product-redesign .gform_wrapper .gfield_total,
.product-redesign .gform_wrapper .gfield_total *,
.product-redesign form.cart .product_totals p.price,
.product-redesign form.cart .product_totals p.price * {
  color: #1a1a1a !important;
}

/* Belt-and-suspenders: override any font-size: 1.6em / display: block from parent
   that would break the flex row layout of our hero TOTAL. */
.product-redesign .gform_wrapper .gfield--type-total .woocommerce-Price-amount,
.product-redesign .gform_wrapper .ginput_total .woocommerce-Price-amount,
.product-redesign .gform_wrapper .ginput_total bdi,
.product-redesign .gform_wrapper .ginput_total span {
  display: inline !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Max-specificity hammer for the persistent green-TOTAL leak — scoped.
   html body prefix bumps specificity past any stubborn inline or legacy rule. */
html body .product-redesign .gform_wrapper .gfield--type-total,
html body .product-redesign .gform_wrapper .gfield--type-total *,
html body .product-redesign .gform_wrapper .ginput_total,
html body .product-redesign .gform_wrapper .ginput_total *,
html body .product-redesign .gform_wrapper .ginput_container_total,
html body .product-redesign .gform_wrapper .ginput_container_total * {
  color: #1a1a1a !important;
}

.product-redesign .gform_wrapper .gfield_required_asterisk {
  color: #999;
  margin-left: 3px;
  font-weight: 400;
}

/* ----- Radio options as refined segmented cards ----- */
.product-redesign .gform_wrapper .ginput_container_radio .gfield_radio {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 0.5rem;
}

.product-redesign .gform_wrapper .gchoice {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: flex;
}

.product-redesign .gform_wrapper .gchoice input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-redesign .gform_wrapper .gchoice label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  /* Only transition properties that can actually smoothly animate. */
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: background-color, color, border-color;
  text-align: left;
  line-height: 1.25;
  margin: 0 !important;
}

.product-redesign .gform_wrapper .gchoice label:hover {
  border-color: #1a1a1a;
  background: #faf7f2;
}

.product-redesign .gform_wrapper .gchoice input[type="radio"]:checked + label {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ----- Number / text inputs ----- */
.product-redesign .gform_wrapper .ginput_container_number input[type="number"],
.product-redesign .gform_wrapper .ginput_container_text input[type="text"] {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.product-redesign .gform_wrapper .ginput_container_number input[type="number"]:hover,
.product-redesign .gform_wrapper .ginput_container_text input[type="text"]:hover {
  border-color: #c4c4c4;
}

.product-redesign .gform_wrapper .ginput_container_number input[type="number"]:focus,
.product-redesign .gform_wrapper .ginput_container_text input[type="text"]:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.product-redesign .gform_wrapper .gfield_description.instruction {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.4rem;
  font-style: normal;
}

/* ----- Info-note fields (form-notes / form-notes-warning).
   These are technically text inputs used as instructional banners.
   Hide the input, render the label as a subtle inline hint. ----- */
.product-redesign .gform_wrapper .form-notes,
.product-redesign .gform_wrapper .form-notes-warning {
  background: #faf7f2 !important;
  border: none !important;
  border-top: none !important;
  border-radius: 6px !important;
  padding: 0.75rem 0.95rem !important;
  margin: 0 0 1.25rem !important;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  box-shadow: none !important;
}

.product-redesign .gform_wrapper .form-notes::before,
.product-redesign .gform_wrapper .form-notes-warning::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><circle cx='8' cy='8' r='7' stroke='%23888' stroke-width='1.4'/><path d='M8 7v4M8 5v.5' stroke='%23888' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

.product-redesign .gform_wrapper .form-notes-warning {
  background: #fef9f0 !important;
  border: 1px solid #f0dfc0 !important;
  border-radius: 6px !important;
}

.product-redesign .gform_wrapper .form-notes-warning::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M8 1.5L15 14H1L8 1.5z' stroke='%23c47900' stroke-width='1.4' stroke-linejoin='round'/><path d='M8 6v3.5M8 11.5v.5' stroke='%23c47900' stroke-width='1.4' stroke-linecap='round'/></svg>");
}

.product-redesign .gform_wrapper .form-notes .gfield_label,
.product-redesign .gform_wrapper .form-notes-warning .gfield_label {
  margin: 0 !important;
  font-weight: 400;
  font-size: 0.78rem;
  color: #555;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

.product-redesign .gform_wrapper .form-notes-warning .gfield_label {
  color: #6b4400;
}

/* Override style.css red banner (line 172) with higher specificity */
.product-redesign .gform_wrapper .gform_body .form-notes-warning label,
.product-redesign .gform_wrapper .form-notes-warning label.gfield_label {
  background: none !important;
  color: #6b4400 !important;
  padding: 0 !important;
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.5 !important;
}

.product-redesign .gform_wrapper .form-notes input,
.product-redesign .gform_wrapper .form-notes-warning input {
  display: none !important;
}

/* ----- Total (hero block) ----- */
.product-redesign .gform_wrapper .gfield--type-total {
  margin: 1.75rem 0 1rem !important;
  padding: 1.5rem 0 0 !important;
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.product-redesign .gform_wrapper .gfield--type-total .gfield_label {
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 !important;
  font-weight: 600;
  flex-shrink: 0;
}

.product-redesign .gform_wrapper .ginput_total {
  font-size: 2.15rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Zero-state em-dash placeholder removed per request — it was overlapping the
   real total (the value lives in a child span that escaped the parent's
   font-size:0 hide). The TOTAL now always shows its real value. JS still toggles
   .mh-calc-empty (now a harmless no-op) — see setupZeroState() in product-calculator.js. */

/* ----- Quantity + add-to-cart button ----- */
.product-redesign form.cart .quantity {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Parent-theme hides .qty globally (.product .quantity .qty { display: none }),
   so the entire .quantity wrapper has no visible content — collapse it. */
.product-redesign form.cart .quantity {
  display: none;
}

.product-redesign form.cart .quantity input[type="number"] {
  width: 64px;
  padding: 0.55rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  text-align: center;
  background: #fff;
}

.product-redesign form.cart .single_add_to_cart_button {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  background: #1a1a1a !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.05s ease;
  margin-top: 0.25rem !important;
  box-shadow: none;
}

.product-redesign form.cart .single_add_to_cart_button:hover {
  background: #333 !important;
}

.product-redesign form.cart .single_add_to_cart_button:active {
  transform: translateY(1px);
}

/* Hide the inner duplicate Gravity Forms wrapper UI noise */
.product-redesign .gform_wrapper .gform_footer {
  display: none !important;
}

.product-redesign .gform_wrapper .product_totals {
  display: none !important;
}

/* Cart accordion: use the unified beige "cart card" treatment for the form. */
.product-accordion--cart .gform_wrapper form.cart {
  background: #faf7f2;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

/* ----- Stock badge inside accordion — subtle inline pill ----- */
.product-accordion--cart .stock {
  font-size: 0.7rem !important;
  font-weight: 600;
  padding: 0.25em 0.7em !important;
  border-radius: 3px !important;
  display: inline-block;
  margin: 0 0 1rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-accordion--cart .stock.in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.product-accordion--cart .stock.on-backorder,
.product-accordion--cart .stock.order-item {
  background: #fff3e0;
  color: #e65100;
}

.product-accordion--cart .stock.out-of-stock {
  background: #ffebee;
  color: #c62828;
}

/* ----- "Tryck Lägg Beställning" info — same treatment inside cart accordion ----- */
/* (Generic .product-redesign .delivery-time rule above handles both cases; this
   block is now redundant but kept empty for locality in case we need special overrides later.) */

/* ==========================================================================
   Color variants gallery
   ========================================================================== */
.product-color-variants {
  margin: 1.5rem 0 1rem;
}

.product-color-variants__title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  margin: 0 0 0.85rem;
}

.product-color-variants__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
}

.product-color-variants__item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #333;
  transition: transform 0.18s ease;
}

.product-color-variants__item:hover {
  transform: translateY(-2px);
}

.product-color-variants__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #faf7f2;
  border: 1px solid #ececec;
}

.product-color-variants__img,
.product-color-variants__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-color-variants__item:hover .product-color-variants__img {
  transform: scale(1.05);
}

.product-color-variants__name {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #666;
  line-height: 1.3;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Produktspecifikation table — refined
   ========================================================================== */
.product-redesign .product-accordion__inner .woocommerce-product-attributes,
.product-redesign .product-accordion__inner .shop_attributes {
  width: 100%;
  border: none !important;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.85rem;
}

.product-redesign .product-accordion__inner .shop_attributes tr {
  border-bottom: 1px solid #f0f0f0;
}

.product-redesign .product-accordion__inner .shop_attributes tr:last-child {
  border-bottom: none;
}

.product-redesign .product-accordion__inner .shop_attributes th {
  background: transparent !important;
  border: none !important;
  padding: 0.65rem 1rem 0.65rem 0 !important;
  font-weight: 600;
  color: #555;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: top;
  width: 40%;
}

.product-redesign .product-accordion__inner .shop_attributes td {
  background: transparent !important;
  border: none !important;
  padding: 0.65rem 0 !important;
  color: #1a1a1a;
  font-style: normal !important;
}

.product-redesign .product-accordion__inner .shop_attributes td p {
  margin: 0;
}

/* ==========================================================================
   Smooth transitions — tame GF conditional-logic jank on radio-option switch
   ========================================================================== */

/* When GF show/hides fields via display:block/none (not transitionable), fade
   the newly-visible fields in with a keyframe so the pop is softer. The
   animation re-runs each time display toggles from none → block. */
@keyframes mh-field-fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-redesign .gform_wrapper .gfield:not(.gf_invisible):not(.gf_hidden) {
  animation: mh-field-fade-in 0.22s ease-out;
}

/* The TOTAL field animates too often (on every recalc) — suppress its fade. */
.product-redesign .gform_wrapper .gfield--type-total {
  animation: none;
}

/* Area readout — fade when it appears/disappears rather than pop. */
.product-redesign .mh-calc-readout {
  transition: opacity 0.18s ease;
}
.product-redesign .mh-calc-readout[hidden] {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
}

/* Zero-state em-dash — crossfade with actual number rather than instant swap. */
.product-redesign .gform_wrapper .ginput_total {
  transition: color 0.18s ease;
}

/* Honor reduced-motion preference — no fade, no slide. */
@media (prefers-reduced-motion: reduce) {
  .product-redesign .gform_wrapper .gfield:not(.gf_invisible):not(.gf_hidden) {
    animation: none;
  }
  .product-redesign .gform_wrapper .gchoice label,
  .product-redesign__details table.variations td.value > div > label,
  .product-redesign .mh-calc-readout {
    transition: none;
  }
}

/* ==========================================================================
   GF calculator — Phase 2/3 additions (variant-aware polish)
   ========================================================================== */

/* --- Number-input "cm" suffix + placeholder polish (Variant A/D/E) --- */
.product-redesign .gform_wrapper .ginput_container_number {
  position: relative;
}

.product-redesign .gform_wrapper .mh-number-with-unit .ginput_container_number::after,
.product-redesign .gform_wrapper .ginput_container_number.mh-has-cm::after {
  content: "cm";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: #999;
  pointer-events: none;
  letter-spacing: 0;
  font-weight: 500;
}

.product-redesign .gform_wrapper .ginput_container_number.mh-has-cm input[type="number"] {
  padding-right: 2.8rem;
}

.product-redesign .gform_wrapper input[type="number"]::placeholder,
.product-redesign .gform_wrapper input[type="text"]::placeholder {
  color: #bbb;
  font-weight: 400;
}

/* --- Radio-card subtitles (Variant A) — injected by JS as <small class="mh-choice-sub"> --- */
.product-redesign .gform_wrapper .gchoice label {
  flex-direction: column;
  gap: 0.25rem;
}

.product-redesign .gform_wrapper .mh-choice-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0;
  text-transform: none;
}

.product-redesign .gform_wrapper .gchoice input[type="radio"]:checked + label .mh-choice-sub {
  color: rgba(255, 255, 255, 0.7);
}

.product-redesign .gform_wrapper .gchoice input[type="radio"]:checked + label {
  /* override gap for stacked layout when subtitle present */
  padding: 0.7rem 1rem;
}

/* --- Area / breakdown readout row (Variant A/D/E) --- */
.product-redesign .mh-calc-readout {
  margin: 0.5rem 0 1.25rem;
  padding: 0.75rem 0.95rem;
  background: #faf7f2;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-redesign .mh-calc-readout[hidden] {
  display: none;
}

.product-redesign .mh-calc-readout__value {
  font-weight: 600;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.product-redesign .mh-calc-readout__sep {
  color: #ccc;
}

.product-redesign .mh-calc-readout__meta {
  color: #888;
}

/* --- Laminatgolv computed readout chips (Variant C) ---
   Target GF number fields rendered read-only / calculated.
   JS tags the enclosing .gfield with .mh-readout-chip on page load based on field class hints.
*/
.product-redesign .gform_wrapper .gfield.mh-readout-chip {
  background: #faf7f2;
  border-radius: 6px;
  padding: 0.85rem 1rem !important;
  margin-bottom: 0.6rem !important;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.product-redesign .gform_wrapper .gfield.mh-readout-chip .gfield_label {
  margin: 0 !important;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.product-redesign .gform_wrapper .gfield.mh-readout-chip .ginput_container input {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 1.25rem !important;
  font-weight: 600;
  color: #1a1a1a !important;
  text-align: right;
  width: auto;
  min-width: 0;
  max-width: 6ch;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.product-redesign .gform_wrapper .gfield.mh-readout-chip .ginput_container {
  width: auto;
  flex-shrink: 0;
}

/* --- Variant B flatten 2-col GF layout --- */
.product-redesign .gform_wrapper .gf_list_2col,
.product-redesign .gform_wrapper .gfield_radio.gfield_list_2col,
.product-redesign .gform_wrapper .gform_fields .gf_left_half,
.product-redesign .gform_wrapper .gform_fields .gf_right_half {
  width: 100% !important;
  float: none !important;
  clear: both;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.product-redesign .gform_wrapper ul.gfield_radio.gf_list_2col,
.product-redesign .gform_wrapper .ginput_container_radio ul.gf_list_2col {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.5rem !important;
  grid-auto-rows: 1fr;
}

/* Backorder chip — sentence-case, soft pill, dialled-down */
.product-redesign .mh-backorder-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  background: rgba(230, 150, 40, 0.14);
  color: #8a5a15;
  padding: 0.2em 0.55em;
  border-radius: 3px;
  margin: 0;
  line-height: 1.25;
  flex-shrink: 0;
}

/* On a selected (dark) card, lift to white-transparent tag */
.product-redesign .gchoice input[type="radio"]:checked + label .mh-backorder-chip,
.product-redesign table.variations td.value > div > input[type="radio"]:checked + label .mh-backorder-chip {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

/* --- Variant D: JS-converted select → radio cards, grid layout --- */
.product-redesign .gform_wrapper .mh-select-cards {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  grid-auto-rows: 1fr;
}

.product-redesign .gform_wrapper .mh-select-cards .gchoice {
  display: flex;
  margin: 0;
  padding: 0;
}

.product-redesign .gform_wrapper .mh-select-cards input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-redesign .gform_wrapper .mh-select-cards label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  line-height: 1.25;
  margin: 0;
  box-sizing: border-box;
}

.product-redesign .gform_wrapper .mh-select-cards label:hover {
  border-color: #1a1a1a;
  background: #faf7f2;
}

.product-redesign .gform_wrapper .mh-select-cards input[type="radio"]:checked + label {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- Variant D: native <select> fallback polish (if JS didn't convert) --- */
.product-redesign .gform_wrapper .ginput_container_select select {
  width: 100%;
  padding: 0.85rem 2.6rem 0.85rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%23666' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 1rem center;
  background-size: 14px 14px;
  color: #1a1a1a;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  font-family: inherit;
  cursor: pointer;
}

.product-redesign .gform_wrapper .ginput_container_select select:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Ensure accordion doesn't create a stacking-context that clips the native select popup */
.product-accordion__content[aria-hidden="false"] {
  overflow: visible;
}

/* --- Remove uppercase on ALTERNATIV / BREDDALTERNATIV / VÄLJ... labels
       (generic rule — applies to all radio group labels + parent .gfield--type-radio label).
   Already toned down in the base .gfield_label rule; this ensures specific overrides don't resurrect uppercase. */
.product-redesign .gform_wrapper .gfield--type-radio > .gfield_label,
.product-redesign .gform_wrapper .gfield--type-select > .gfield_label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  text-transform: none;
  letter-spacing: 0;
}

/* --- Accordion trigger in open state: keep neutral, no green accent anywhere --- */
.product-accordion__trigger[aria-expanded="true"] {
  color: #1a1a1a !important;
}

/* --- Stock/status pill unification --- */
.product-redesign .stock,
.product-accordion--cart .stock {
  font-size: 0.65rem !important;
  font-weight: 600;
  padding: 0.2em 0.6em !important;
  border-radius: 3px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
  margin: 0 0 0.75rem !important;
}
