/* ═══ checkout.css — EDD checkout: purchase button, fieldsets, card containers, final polish ═══ */

/* ═══════════════════════════════════════════════════════════════════════
   EDD — Purchase Buttons, Cart, Checkout Styling
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Purchase Button ── (no display rule; don't fight inline display:none on no-js/checkout-link) */
.edd-add-to-cart,
.edd_purchase_submit_wrapper .edd-submit,
.edd_purchase_submit_wrapper button {
  align-items: center;
  justify-content: center;
  padding: 14px 32px !important;
  background: #6C3AED !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(108, 58, 237, 0.25);
}
/* Only visible Add-to-Cart buttons get inline-flex; hidden variants stay hidden */
.edd-add-to-cart:not(.edd-no-js),
.edd_purchase_submit_wrapper button.edd-submit {
  display: inline-flex !important;
}

.edd-add-to-cart:hover,
.edd_purchase_submit_wrapper .edd-submit:hover,
.edd_purchase_submit_wrapper button:hover {
  background: #5B21B6 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108, 58, 237, 0.35);
}

/* "Go to Checkout" link — EDD toggles its inline display via JS when cart changes.
   Keep hidden by default; let EDD's JS reveal it by removing its inline style. */
.edd_go_to_checkout {
  padding: 14px 32px;
  background: #059669;
  color: #FFFFFF !important;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-left: 12px;
}
.edd_go_to_checkout:hover { background: #047857; color: #FFFFFF !important; }

/* ═════════ Checkout styles — see FINAL POLISH block below ═════════ */

/* ═══════════════════════════════════════════════════════════════════════
   FINAL CHECKOUT POLISH — consolidated overrides (last wins)
   ═══════════════════════════════════════════════════════════════════════ */

/* Cart sidebar: product name should stay on 1-2 lines */
.edd-blocks__cart .edd_cart_item_name,
.edd-blocks__cart .edd-blocks-cart__row-item > *:first-child {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
  line-height: 1.35 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1E293B !important;
  max-width: 65% !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Pricing page: responsive grid (desktop inline uses repeat(3,1fr) / 5-col compare) */
@media (max-width: 768px) {
  body.page-id-88 .entry-content [style*="grid-template-columns:repeat(3"],
  body.page-id-88 .entry-content [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  body.page-id-88 .entry-content [style*="grid-template-columns:2fr 1fr 1fr 1fr 1fr"],
  body.page-id-88 .entry-content [style*="grid-template-columns: 2fr 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

.edd-blocks__cart .edd-blocks-cart__row-item > *:last-child,
.edd-blocks__cart .edd_cart_item_price {
  white-space: nowrap !important;
  font-weight: 700 !important;
  color: #6C3AED !important;
  font-size: 14px !important;
}

/* Register/Login tabs — equal width, pill-tab active look */
.edd-blocks__checkout-forms {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
  padding: 4px !important;
  background: #F1F5F9 !important;
  border-radius: 10px !important;
  margin: 0 0 24px !important;
  justify-content: stretch !important;
}
.edd-blocks__checkout-forms button {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: transparent !important;
  color: #64748B !important;
  border: none !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all .15s !important;
  box-shadow: none !important;
}
.edd-blocks__checkout-forms button:hover {
  background: #FFFFFF !important;
  color: #1E293B !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
}
/* Hide "Continue as guest" — it's redundant when guest is default */
.edd-blocks__checkout-forms button.edd-blocks__checkout-guest { display: none !important; }

/* Personal Info / Credit Card Info headings — left-aligned, tight */
#edd_checkout_user_info > legend,
#edd_cc_fields > legend,
.edd-blocks__user-details legend,
.edd-blocks__payment-details legend,
#edd_cc_fields h2,
.edd-blocks__payment-details h2 {
  text-align: left !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1E293B !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  width: 100% !important;
  display: block !important;
  float: none !important;
}
#edd_checkout_user_info > legend::before,
.edd-blocks__payment-details legend::before { content: none !important; }

/* Form group spacing — tighter vertical rhythm */
#edd_purchase_form .edd-blocks-form__group {
  margin-bottom: 14px !important;
}
#edd_purchase_form .edd-blocks-form__group label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  margin-bottom: 6px !important;
  display: block !important;
}
#edd_purchase_form .edd-blocks-form__group .edd-description {
  font-size: 12px !important;
  color: #94A3B8 !important;
  margin: 4px 0 0 !important;
  line-height: 1.4 !important;
}
#edd_purchase_form input[type="text"],
#edd_purchase_form input[type="email"],
#edd_purchase_form input[type="tel"] {
  padding: 11px 14px !important;
  font-size: 14px !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Checkout wrapper — let EDD's native two-thirds layout handle grid placement */
#edd_checkout_form_wrap {
  max-width: 1200px !important;
  margin: 0 auto !important;
  gap: 40px !important;
  align-items: start !important;
  padding: 40px 24px 80px !important;
}
body.page-id-5 .entry-header,
body.page-id-5 .entry-title { display: none !important; }

/* Card containers — white card look */
.edd-blocks__user-details,
.edd-blocks__payment-details {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin-bottom: 16px !important;
}

/* Cart sidebar as sticky white card with 'Order Summary' label */
.edd-blocks__cart {
  position: sticky !important;
  top: 100px !important;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
.edd-blocks__cart::before {
  content: 'Order Summary';
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94A3B8;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.edd-blocks-cart__row-header { display: none !important; }
.edd-blocks-cart__row-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 14px 0 !important;
  border-bottom: 1px solid #F1F5F9 !important;
  gap: 12px !important;
}
.edd-blocks-cart__row-footer:last-of-type {
  margin-top: 12px !important;
  padding-top: 16px !important;
  border-top: 2px solid #E2E8F0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #1E293B !important;
}
.edd-blocks-cart__row-footer:last-of-type .edd_cart_amount {
  color: #6C3AED !important;
  font-size: 22px !important;
}

/* checkout-user wraps Register/Login tabs AND personal-info — stack vertically */
.edd-blocks__checkout-user {
  display: block !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin: 0 !important;
}
/* Inner .edd-blocks__checkout-forms = Register/Login button row */
.edd-blocks__user-details > * {
  width: 100% !important;
}
@media (max-width: 960px) {
  .edd-blocks__cart { position: static !important; }
}

/* Purchase button — full width within form card, not overly huge */
#edd_purchase_submit { margin-top: 8px !important; }
#edd_purchase_submit #edd-purchase-button,
#edd_purchase_submit input[type="submit"] {
  width: 100% !important;
  padding: 14px 28px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: #6C3AED !important;
  color: #FFFFFF !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(108,58,237,.25) !important;
  transition: all .15s !important;
}
#edd_purchase_submit #edd-purchase-button:hover {
  background: #5B21B6 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(108,58,237,.35) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Checkout: Company / Billing details block
   ═══════════════════════════════════════════════════════════════════════ */

fieldset#np_company_toggle_wrap.np-company-block {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin: 0 0 16px !important;
}
fieldset#np_company_toggle_wrap.np-company-block > legend {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1E293B !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  float: none !important;
  width: auto !important;
}

.np-company-toggle {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #1E293B;
  transition: all .15s;
  user-select: none;
}
.np-company-toggle:hover { border-color: #CBD5E1; background: #F1F5F9; }
.np-company-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: #6C3AED;
  cursor: pointer;
  flex-shrink: 0;
}
.np-company-toggle span { font-weight: 500; }

.np-company-fields {
  overflow: hidden;
  margin-top: 16px;
  opacity: 1;
  transition: max-height .35s ease, opacity .25s, margin-top .25s;
}
.np-company-fields[hidden] {
  display: block !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  visibility: hidden;
}

.np-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.np-field-row:has(> p:nth-child(3)) {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 640px) {
  .np-field-row, .np-field-row:has(> p:nth-child(3)) {
    grid-template-columns: 1fr;
  }
}
.np-company-fields .edd-blocks-form__group {
  margin-bottom: 12px !important;
}
.np-company-fields label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  margin-bottom: 6px !important;
}
.np-company-fields input[type="text"],
.np-company-fields select {
  width: 100% !important;
  padding: 11px 14px !important;
  font-size: 14px !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  box-sizing: border-box !important;
}
.np-company-fields input:focus,
.np-company-fields select:focus {
  border-color: #6C3AED !important;
  box-shadow: 0 0 0 3px rgba(108,58,237,.12) !important;
  outline: none !important;
}
.np-company-hint {
  font-size: 12px !important;
  color: #94A3B8 !important;
  margin: 8px 0 0 !important;
  line-height: 1.5;
}
