/* Elementor Pro forces single-product form.cart as flex; this breaks OP blocks in custom templates. */
.single-product.opw-enabled-product.woocommerce div.product.elementor form.cart:not(.grouped_form):not(.variations_form) {
  display: block !important;
}

.single-product.opw-enabled-product .opw-ui {
  --opw-surface: #ffffff;
  --opw-surface-soft: #f7f9fc;
  --opw-border: #dbe3ee;
  --opw-border-strong: #c3cfde;
  --opw-text: #1f2937;
  --opw-muted: #64748b;
  --opw-accent: #0f6cbf;
  --opw-accent-dark: #0b5aa0;
  --opw-accent-contrast: #ffffff;
  --opw-shadow: 0 8px 22px rgba(15, 38, 70, 0.08);
  --opw-radius: 14px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 0;
}

.single-product.opw-enabled-product .opw-ui,
.single-product.opw-enabled-product .opw-ui * {
  box-sizing: border-box;
}

.single-product.opw-enabled-product .opw-ui #opw-dynamic,
.single-product.opw-enabled-product .opw-ui #opw-extra-options,
.single-product.opw-enabled-product .opw-ui #opw-base-price,
.single-product.opw-enabled-product .opw-ui #opw-final-price,
.single-product.opw-enabled-product .opw-ui #opw-debug-rule {
  width: 100%;
  max-width: 100%;
  float: none;
  clear: both;
  margin-left: 0;
  margin-right: 0;
}

.single-product.opw-enabled-product .opw-ui #opw-extra-options > p {
  margin: 6px 0 10px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--opw-text);
  letter-spacing: 0.01em;
}

.opw-accordion {
  width: 100%;
  border: 1px solid var(--opw-border);
  margin-bottom: 10px;
  border-radius: var(--opw-radius);
  background: var(--opw-surface);
  box-shadow: var(--opw-shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.opw-accordion:hover {
  border-color: var(--opw-border-strong);
  transform: translateY(-1px);
}

.opw-accordion[open] {
  border-color: #9fbfdf;
  box-shadow: 0 12px 28px rgba(11, 48, 87, 0.12);
}

.opw-accordion summary {
  cursor: pointer;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fcfdff 0%, var(--opw-surface-soft) 100%);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.35;
  transition: background-color 0.2s ease;
  position: relative;
  padding-right: 38px;
}

.opw-accordion summary:hover {
  background: #f1f6fc;
}

.opw-accordion summary::-webkit-details-marker {
  display: none;
}

.opw-accordion summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--opw-muted);
  border-bottom: 2px solid var(--opw-muted);
  position: absolute;
  right: 16px;
  top: 16px;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.opw-accordion[open] summary::after {
  transform: rotate(225deg);
  border-color: var(--opw-accent);
}

.opw-accordion summary strong {
  display: block;
  flex: 0 0 auto;
  margin-right: 8px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: var(--opw-text);
}

.opw-accordion summary .opw-value {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--opw-muted);
  text-align: right;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.opw-accordion-content {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 16px;
  background: var(--opw-surface);
  border-top: 1px solid var(--opw-border);
}

.opw-option {
  border: 1px solid var(--opw-border-strong);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  flex: 0 1 auto;
  text-align: center;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--opw-text);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.opw-accordion-qty .opw-accordion-content.opw-qty-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.opw-accordion-qty .opw-option {
  border-radius: 14px;
  min-height: 60px;
  padding: 8px 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.opw-option-main {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 700;
  color: inherit;
}

.opw-option-sub {
  display: block;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 500;
  color: #6f8096;
}

.opw-accordion-qty .opw-option.selected .opw-option-sub {
  color: rgba(255, 255, 255, 0.82);
}

.opw-option:hover {
  border-color: #8db3d9;
  color: var(--opw-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15, 108, 191, 0.16);
}

.opw-option.selected {
  background: linear-gradient(180deg, var(--opw-accent) 0%, var(--opw-accent-dark) 100%);
  border-color: var(--opw-accent-dark);
  color: var(--opw-accent-contrast);
  box-shadow: 0 5px 14px rgba(15, 108, 191, 0.26);
}

.opw-option:focus-visible,
.opw-accordion summary:focus-visible {
  outline: 2px solid #6ba5d9;
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  .opw-accordion-qty .opw-accordion-content.opw-qty-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .opw-accordion-qty .opw-accordion-content.opw-qty-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.opw-price-line {
  margin: 10px 0 0;
}

#opw-final-price.opw-pricing-error {
  color: #b32d2e;
}

#opw-final-price.opw-pricing-loading {
  opacity: 0.8;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .opw-custom-price-loading {
  opacity: 0.85;
  font-style: italic;
}

@media (max-width: 767px) {
  .opw-accordion summary {
    display: block;
    padding-right: 16px;
  }

  .opw-accordion summary::after {
    right: 12px;
    top: 14px;
  }

  .opw-accordion summary .opw-value {
    margin-top: 5px;
    text-align: left;
  }

  .opw-accordion-content {
    padding: 12px 12px 14px;
  }

  .opw-accordion-qty .opw-accordion-content.opw-qty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .opw-accordion-qty .opw-option {
    min-height: 54px;
    padding: 8px 8px;
  }

  .opw-option-main {
    font-size: 15px;
  }

  .opw-option-sub {
    font-size: 11px;
  }
}

/* Legacy custom add-to-cart summary block (grupozonaproductos / onlineprinstrs style). */
.single-product.opw-enabled-product.opw-custom-cart-enabled form.cart .single_add_to_cart_button:not(.buttonCTAprimary) {
  display: none !important;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart #resumentotal.productConfigTotal {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between;
  background-color: #f6f6f7 !important;
  border-top: 0.0625rem solid #cfcfcf !important;
  border-radius: 15px;
  padding: 1.3rem 10px 10px;
  margin-top: 1rem;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPrice {
  display: flex;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto,
.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto {
  display: flex;
  flex-direction: column;
  margin-left: 1.5rem;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto {
  margin-right: 1.5rem;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNettoTxt,
.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart #priceSinIva {
  color: #999999;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto :first-child,
.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto :first-child {
  font-size: 0.75156rem;
  white-space: nowrap;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto :last-child,
.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto :last-child {
  font-size: 1.42188rem;
  font-weight: 700;
  white-space: nowrap;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .buttonCTAprimary {
  display: inline-block;
  min-width: 7.625rem;
  border: 0.0625rem solid;
  border-radius: 0.4375rem;
  color: #ffffff !important;
  background-color: #35a7ff !important;
  font-weight: 700;
  text-align: center;
  margin-top: 0.4rem;
  padding: 10px 14px !important;
  transition: all ease .3s;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .buttonCTAprimary:focus,
.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .buttonCTAprimary:hover {
  filter: brightness(0.9);
  box-shadow: rgba(100, 100, 111, 0.2) 0 7px 29px 0;
}

.single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart #resumentotal.sticky {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0;
  right: 0;
  width: 50%;
  margin: auto;
  z-index: 1000 !important;
  overflow: hidden;
  border-radius: 15px 15px 0 0;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.29), inset 0 0 0 0 rgba(0, 0, 0, 0) !important;
  padding: 0 0.5rem !important;
}

@media (max-width: 767px) {
  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart #resumentotal.productConfigTotal {
    padding: 1rem 0.75rem;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPrice {
    flex-wrap: wrap;
    margin-bottom: -1rem !important;
    width: 100%;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto,
  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto {
    width: 100%;
    justify-content: space-between;
    flex-direction: row;
    margin: 0;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .buttonCTAprimary {
    width: 100%;
    font-size: 13px;
    padding: 1px 14px !important;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto :first-child,
  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceBrutto :last-child {
    font-size: 1rem !important;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto :first-child,
  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart .productConfigTotalPriceNetto :last-child {
    font-size: 0.8rem !important;
  }

  .single-product.opw-enabled-product.opw-custom-cart-enabled .opw-ui-custom-cart #resumentotal.sticky {
    width: 100%;
    border-radius: 0;
    padding: 5px 10px !important;
  }
}
