body.checkout-index-index .page-title-wrapper,
body.checkout-index-index .page-title,
body.checkout-index-index h1.page-title,
body.checkout-index-index .base {
  display: none !important;
}

#react-checkout {
  background: #fff !important;
  color: #0f172a !important;
}

#react-checkout .nwc-checkout-page {
  width: min(1440px, calc(100vw - 64px)) !important;
  margin: 0 auto !important;
  padding: 10px 0 60px !important;
}

#react-checkout .nwc-checkout-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 470px !important;
  gap: 42px !important;
  align-items: start !important;
}

#react-checkout .nwc-checkout-summary {
  position: sticky !important;
  top: 24px !important;
  align-self: start !important;
}

#react-checkout .nwc-checkout-summary .sticky {
  position: static !important;
  width: 100% !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 26px !important;
  background: #fff !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .08) !important;
}

#react-checkout .card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#react-checkout .nwc-checkout-card,
#react-checkout .nwc-native-step {
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  background: #fff !important;
  padding: 26px !important;
  margin-bottom: 18px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045) !important;
}

#react-checkout .nwc-step-title,
#react-checkout .nwc-native-step header {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  text-align: left !important;
  margin-bottom: 20px !important;
}

#react-checkout .nwc-step-number,
#react-checkout .nwc-step-2 header::before,
#react-checkout .nwc-step-3 header::before,
#react-checkout .nwc-step-4 header::before {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  border: 1px solid #cbd5e1 !important;
  color: #174ee8 !important;
  background: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
}

#react-checkout .nwc-step-2 header::before { content: "2"; }
#react-checkout .nwc-step-3 header::before { content: "3"; }
#react-checkout .nwc-step-4 header::before { content: "4"; }

#react-checkout .nwc-step-title h2,
#react-checkout .nwc-native-step header span.font-bold {
  font-size: 22px !important;
  font-weight: 850 !important;
  margin: 0 !important;
  color: #0f172a !important;
  text-align: left !important;
}

#react-checkout .nwc-login-choice-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  margin-bottom: 22px !important;
}

#react-checkout .nwc-choice {
  display: grid !important;
  grid-template-columns: 22px 34px 1fr !important;
  gap: 12px !important;
  align-items: center !important;
  min-height: 96px !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 14px !important;
  padding: 18px !important;
  background: #fff !important;
  text-align: left !important;
}

#react-checkout .nwc-choice.active {
  border: 2px solid #174ee8 !important;
}

#react-checkout input:not([type="radio"]):not([type="checkbox"]),
#react-checkout select {
  min-height: 52px !important;
  border: 1px solid #d8dee9 !important;
  border-radius: 8px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
}

#react-checkout .nwc-login-actions {
  display: flex !important;
  justify-content: flex-end !important;
}

#react-checkout .btn-primary,
#react-checkout button.btn-primary {
  background: #174ee8 !important;
  color: #fff !important;
  border-color: #174ee8 !important;
  border-radius: 9px !important;
  font-weight: 800 !important;
}

#react-checkout form#items {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding-bottom: 20px !important;
  margin-bottom: 20px !important;
}

#react-checkout .nwc-items-box,
#react-checkout .nwc-items-card {
  display: block !important;
  width: 100% !important;
}

#react-checkout .nwc-items-head {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: #0f172a !important;
}

#react-checkout .nwc-items-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}

#react-checkout .nwc-items-title strong {
  font-size: 24px !important;
  font-weight: 900 !important;
}

#react-checkout .nwc-items-arrow {
  font-size: 24px !important;
  line-height: 1 !important;
}

#react-checkout .nwc-items-body {
  display: block !important;
  margin-top: 18px !important;
}

#react-checkout .nwc-items-body table,
#react-checkout .nwc-items-body tbody {
  display: block !important;
  width: 100% !important;
}

#react-checkout .cart-item-row {
  display: grid !important;
  grid-template-columns: 68px minmax(0,1fr) auto !important;
  gap: 14px !important;
  align-items: center !important;
  border: 0 !important;
}

#react-checkout .cart-product-cell,
#react-checkout .cart-product-wrapper {
  display: contents !important;
}

#react-checkout .cart-product-image {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9px !important;
  padding: 4px !important;
}

#react-checkout .cart-product-name {
  max-width: 220px !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

#react-checkout .cart-product-sku {
  margin-top: 4px !important;
  color: #64748b !important;
  font-size: 12px !important;
}

#react-checkout .cart-product-sku::after {
  content: " · Qtà: 1";
}

#react-checkout .cart-qty-cell,
#react-checkout .cart-price-cell,
#react-checkout .cart-action-cell {
  display: none !important;
}

#react-checkout .cart-subtotal-cell {
  font-size: 14px !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
}

#react-checkout .text-xl.font-bold {
  font-size: 28px !important;
  font-weight: 900 !important;
}

#react-checkout .text-xl.font-bold > div:last-child::after {
  content: "IVA inclusa";
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

#react-checkout .nwc-sidebar-trust {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  border-top: 1px solid #e5e7eb !important;
  margin-top: 22px !important;
  padding-top: 22px !important;
}

#react-checkout .nwc-trust-row {
  display: flex !important;
  align-items: center !important;
  gap: 13px !important;
}

#react-checkout .nwc-trust-icon {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 50% !important;
  background: #eef2ff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#react-checkout .nwc-trust-text strong,
#react-checkout .nwc-trust-text small {
  display: block !important;
}

#react-checkout .nwc-trust-text small {
  color: #64748b !important;
}

#react-checkout .nwc-card-icons,
#react-checkout .nwc-payment-icons {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 18px 0 !important;
  padding: 11px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
}

#react-checkout .nwc-card-icons span,
#react-checkout .nwc-payment-icons span {
  color: #174ee8 !important;
  background: #f8fafc !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  padding: 4px 7px !important;
  border-radius: 4px !important;
}

#react-checkout button.btn-primary.btn-size-lg {
  width: 100% !important;
  min-height: 58px !important;
  font-size: 16px !important;
}

#react-checkout button.btn-primary.btn-size-lg::before {
  content: "🔒";
  margin-right: 8px;
}

#react-checkout .nwc-bottom-trust,
#react-checkout .nwc-bottom-row,
#react-checkout .nwc-bottom-item {
  display: none !important;
}

@media (max-width: 768px) {
  #react-checkout .nwc-checkout-page {
    width: 100% !important;
    padding: 10px 14px 46px !important;
  }

  #react-checkout .nwc-checkout-layout {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  #react-checkout .nwc-login-choice-grid {
    grid-template-columns: 1fr !important;
  }

  #react-checkout .nwc-checkout-summary {
    position: static !important;
    width: 100% !important;
  }

  #react-checkout .nwc-checkout-summary .sticky {
    position: static !important;
    padding: 22px !important;
  }

  #react-checkout form#items,
  #react-checkout .nwc-items-box,
  #react-checkout .nwc-items-head {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #react-checkout .nwc-items-head {
    display: flex !important;
  }

  #react-checkout .nwc-items-title strong {
    font-size: 22px !important;
  }

  #react-checkout .cart-item-row {
    grid-template-columns: 58px minmax(0,1fr) auto !important;
    gap: 10px !important;
  }

  #react-checkout .cart-product-image {
    width: 56px !important;
    height: 56px !important;
  }

  #react-checkout .cart-product-name {
    font-size: 13px !important;
  }

  #react-checkout .nwc-sidebar-trust {
    display: none !important;
  }
}

/* nasconde titolo pagina Magento duplicato */
body.checkout-index-index span.base[data-ui-id="page-title-wrapper"],
body.checkout-index-index .page-title-wrapper,
body.checkout-index-index .page-title,
body.checkout-index-index h1.page-title {
  display: none !important;
}

/* centra il logo header solo nel checkout */
body.checkout-index-index .page-header .logo {
  float: none !important;
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
}

body.checkout-index-index .page-header .logo img {
  display: block !important;
  margin: 0 auto !important;
}

/* box codice sconto coerente con gli altri blocchi */
#react-checkout .nwc-discount-step,
#react-checkout .nwc-discount-step .card,
#react-checkout form#coupon_code,
#react-checkout form#coupon_code .card {
  display: block !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 22px 26px !important;
  margin-bottom: 18px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045) !important;
}

#react-checkout form#coupon_code header {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

#react-checkout form#coupon_code header span.font-bold {
  font-size: 20px !important;
  font-weight: 850 !important;
  color: #0f172a !important;
}

/* nasconde titolo pagina Magento duplicato */
body.checkout-index-index span.base[data-ui-id="page-title-wrapper"],
body.checkout-index-index .page-title-wrapper,
body.checkout-index-index .page-title,
body.checkout-index-index h1.page-title {
  display: none !important;
}

/* centra il logo header solo nel checkout */
body.checkout-index-index .page-header .logo {
  float: none !important;
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
}

body.checkout-index-index .page-header .logo img {
  display: block !important;
  margin: 0 auto !important;
}

/* box codice sconto coerente con gli altri blocchi */
#react-checkout .nwc-discount-step,
#react-checkout .nwc-discount-step .card,
#react-checkout form#coupon_code,
#react-checkout form#coupon_code .card {
  display: block !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 22px 26px !important;
  margin-bottom: 18px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045) !important;
}

#react-checkout form#coupon_code header {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

#react-checkout form#coupon_code header span.font-bold {
  font-size: 20px !important;
  font-weight: 850 !important;
  color: #0f172a !important;
}

/* FIX coupon: un solo bordo */
#react-checkout .nwc-discount-step {
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 18px !important;
  background: transparent !important;
}

#react-checkout .nwc-discount-step > form,
#react-checkout .nwc-discount-step form#coupon_code {
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent !important;
}

#react-checkout .nwc-discount-step form#coupon_code .card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 22px 26px !important;
  margin-bottom: 0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045) !important;
}

/* header checkout: logo centrato e titolo pagina nascosto */
body.checkout-index-index .page-header .header.content {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding-top: 18px !important;
  padding-bottom: 10px !important;
}

body.checkout-index-index .page-header .logo {
  float: none !important;
  margin: 0 auto !important;
  display: block !important;
}

body.checkout-index-index .page-header .logo img {
  display: block !important;
  margin: 0 auto !important;
}

body.checkout-index-index .page-main > .page-title-wrapper,
body.checkout-index-index .page-title-wrapper,
body.checkout-index-index .page-title,
body.checkout-index-index h1.page-title,
body.checkout-index-index span.base[data-ui-id="page-title-wrapper"],
body.checkout-index-index .base[data-ui-id="page-title-wrapper"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* riduce spazio sopra il checkout */
body.checkout-index-index .page-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

#react-checkout .nwc-checkout-page {
  padding-top: 0 !important;
  margin-top: -8px !important;
}

/* NASCONDE DAVVERO IL TITOLO CHECKOUT MAGENTO */
body:has(#react-checkout) .page-title-wrapper,
body:has(#react-checkout) .page-title,
body:has(#react-checkout) h1.page-title,
body:has(#react-checkout) span.base[data-ui-id="page-title-wrapper"],
body:has(#react-checkout) .base[data-ui-id="page-title-wrapper"],
body:has(#react-checkout) main#maincontent > .page-title-wrapper,
body:has(#react-checkout) .page-main > .page-title-wrapper {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* LOGO HEADER CENTRATO SOLO CHECKOUT */
body:has(#react-checkout) .page-header .header.content {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 0 8px !important;
}

body:has(#react-checkout) .page-header .logo {
  float: none !important;
  margin: 0 auto !important;
  display: block !important;
  position: static !important;
}

body:has(#react-checkout) .page-header .logo img {
  display: block !important;
  margin: 0 auto !important;
}

/* RIDUCE SPAZIO TRA HEADER E CHECKOUT */
body:has(#react-checkout) .page-main,
body:has(#react-checkout) #maincontent {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

#react-checkout .nwc-checkout-page {
  padding-top: 0 !important;
  margin-top: -12px !important;
}

/* TESTI NON ATTACCATI NELLE SCELTE LOGIN */
#react-checkout .nwc-choice strong {
  display: block !important;
  margin-bottom: 7px !important;
  line-height: 1.25 !important;
}

#react-checkout .nwc-choice small {
  display: block !important;
  line-height: 1.45 !important;
  margin-top: 0 !important;
}

/* TESTI INFO RIEPILOGO NON ATTACCATI */
#react-checkout .nwc-trust-text strong {
  display: block !important;
  margin-bottom: 4px !important;
  line-height: 1.25 !important;
}

#react-checkout .nwc-trust-text small {
  display: block !important;
  line-height: 1.45 !important;
}

/* CHECKBOX BEN DISTANZIATI DAL TESTO */
#react-checkout .nwc-newsletter,
#react-checkout .form-control label {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

#react-checkout input[type="checkbox"] {
  margin-right: 9px !important;
  flex: 0 0 auto !important;
}
