﻿/* ==========================================================================
   Product detail – full-width backgrounds on rows
   Rows inside the product article are limited to the content width.
   The row's own background colour is extended to both edges of the screen.
   Only rows (swift-v2_row) with a colour scheme selected – not the rows
   inside the buy box (swift-v2_rowflex).
   ========================================================================== */

article:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not(.product-list *) section[data-dw-itemtype="swift-v2_row"][data-dw-colorscheme]:not([data-dw-colorscheme=""]) {
  background-color: var(--dw-color-background);
  box-shadow: 0 0 0 100vmax var(--dw-color-background);
  clip-path: inset(0 -100vmax);
}


/* ==========================================================================
   Product detail – buy box (sticky)
   = the product component that contains "Add to favorites",
     but NOT inside a product slider or product list
   Spacing between the rows comes from Swift's row settings
   (Space top / Space bottom in the Visual Editor)
   ========================================================================== */

/* The box */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) {
  /* Distance from the top of the window while sticky =
     height of the sticky header + a little air.
     Increase if the box goes under the header, decrease if there is too much air. */
  --buybox-sticky-top: 12.5rem;

  align-self: start; /* needed for sticky inside the grid */
  background-color: #ffffff !important;
  border: 1px solid #d2d2d2;
  padding: 0.5rem 1.5rem 1.5rem;
}

/* Sticky from lg (≥992px) */
@media (min-width: 992px) {
  [data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) {
    position: sticky;
    top: var(--buybox-sticky-top);
    z-index: 2;
  }
}

/* All rows in the box: transparent background (spacing = Swift's row settings) */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section {
  background-color: transparent !important;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section > [data-swift-container] {
  padding-left: 0 !important;
  padding-right: 0 !important;
  background-color: transparent !important;
}

/* Info rows (fx Gross pieces, Stock): thin line under */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:not(:has([data-dw-itemtype="swift-v2_productaddtocart"], [data-dw-itemtype="swift-v2_productaddtofavorites"])):not(:empty) {
  border-bottom: 1px solid #e3e3e3;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:not(:has([data-dw-itemtype="swift-v2_productaddtocart"], [data-dw-itemtype="swift-v2_productaddtofavorites"])) > [data-swift-container] {
  align-items: center !important;
  justify-content: space-between;
  gap: 1rem;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:not(:has([data-dw-itemtype="swift-v2_productaddtocart"], [data-dw-itemtype="swift-v2_productaddtofavorites"])) [data-swift-gridcolumn] > * {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
}

/* Label (fx "Gross pieces") */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:not(:has([data-dw-itemtype="swift-v2_productaddtocart"], [data-dw-itemtype="swift-v2_productaddtofavorites"])) [data-swift-gridcolumn] > * > :first-child {
  font-size: 0.875rem;
  font-weight: 400;
  color: #555555;
}

/* Value (fx "13,000", "In stock") */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:not(:has([data-dw-itemtype="swift-v2_productaddtocart"], [data-dw-itemtype="swift-v2_productaddtofavorites"])) [data-swift-gridcolumn] > * > :last-child:not(:first-child) {
  margin-left: auto;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* First info row: big value (fx Gross pieces 13,000) */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) > section:first-of-type [data-swift-gridcolumn] > * > :last-child:not(:first-child) {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Quantity + Add to cart */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] {
  flex: 1 1 100% !important;
  width: 100%;
}

/* Hide the "Quantity" label, if Swift renders one */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] label:not(.form-check) {
  display: none !important;
}

/* The wrapper around quantity + button = full width */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] :has(> :is(button, .btn)[type="submit"], > :is(button, .btn):not([type="button"])) {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100%;
  gap: 0;
}

/* Quantity field (plain) */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] input[type="number"] {
  height: 48px !important;
  min-height: 48px !important;
  width: 96px !important;
  min-width: 96px !important;
  font-size: 1rem !important;
  text-align: center;
}

/* Quantity selector with − / + : same height as the button */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] :has(> input[type="number"]) {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  height: 48px !important;
  min-height: 48px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] :has(> input[type="number"]) > input[type="number"] {
  height: 46px !important;
  min-height: 46px !important;
  width: 48px !important;
  min-width: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] :has(> input[type="number"]) > :is(button, .btn) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

/* Add to cart button – fills the rest of the width */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtocart"] :is(button, .btn):not(:has(> input[type="number"]) > *) {
  flex: 1 1 auto !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0.5rem 1rem !important;
  font-size: 1.0625rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

/* Add to favorites – full-width outline button */
[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtofavorites"] {
  flex: 1 1 100% !important;
  width: 100%;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtofavorites"] :is(button, .btn, a) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 40px;
  padding: 0.375rem 1rem !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 0;
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

[data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) [data-dw-itemtype="swift-v2_productaddtofavorites"] :is(button, .btn, a):hover {
  background-color: #f5f5f5 !important;
}


/* Mobile: a little less padding */
@media (max-width: 575.98px) {
  [data-dw-itemtype="swift-v2_productcomponentselector"]:has([data-dw-itemtype="swift-v2_productaddtofavorites"]):not([id^="ComponentSliderProducts_"] *, .product-list *) {
    padding: 0.25rem 1rem 1rem;
  }
}