/* Idea storefront: shared controls and responsive commerce layout.
   Loaded after the theme; never loaded in wp-admin. */
body:not(.wp-admin) {
  --idea-action-bg: #000;
  --idea-action-hover: #292929;
  --idea-action-text: #fff;
}

/* The theme's generic .button rule overrides its own white button text.
   Keep one complete, explicit treatment for commerce actions and auth forms. */
body:not(.wp-admin) :is(.woocommerce, .modal_login_frames) :is(a.button, button.button, input.button, input[type="submit"], .bios_btn),
body:not(.wp-admin) :is(.checkout-button, #place_order, .single_add_to_cart_button) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px !important;
  border: 1px solid var(--idea-action-bg) !important;
  border-radius: 3px !important;
  background: var(--idea-action-bg) !important;
  color: var(--idea-action-text) !important;
  -webkit-text-fill-color: var(--idea-action-text);
  font: inherit;
  font-weight: 700;
  line-height: 1.4 !important;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
}

body:not(.wp-admin) :is(.woocommerce, .modal_login_frames) :is(a.button, button.button, input.button, input[type="submit"], .bios_btn):is(:hover, :focus-visible),
body:not(.wp-admin) :is(.checkout-button, #place_order, .single_add_to_cart_button):is(:hover, :focus-visible) {
  background: var(--idea-action-hover) !important;
  border-color: var(--idea-action-hover) !important;
  color: var(--idea-action-text) !important;
}

body:not(.wp-admin) :is(.woocommerce, .modal_login_frames) :is(button, a.button, input[type="submit"]):focus-visible {
  outline: 3px solid #c72828;
  outline-offset: 3px;
}

body:not(.wp-admin) :is(.woocommerce, .modal_login_frames) :is(button.button, input[type="submit"]):disabled {
  background: #555 !important;
  border-color: #555 !important;
  color: #fff !important;
  opacity: 1;
  cursor: not-allowed;
}

body:not(.wp-admin) .wc-proceed-to-checkout :is(a.checkout-button, button.checkout-button),
body:not(.wp-admin) .modal_login_frames :is(button.button, .bios_btn),
body:not(.wp-admin) #place_order {
  width: 100%;
  max-width: none;
}

/* Full-width checkout wrapper; two equal columns at every desktop width. */
body.woocommerce-checkout form.checkout {
  width: 100%;
  max-width: none;
  float: none;
}

body.woocommerce-checkout form.checkout .bios_checkout_form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  width: 100%;
}

body.woocommerce-checkout .bios_checkout_form > :is(#customer_details, #order_review),
body.woocommerce-checkout #customer_details > :is(.col-1, .col-2) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none;
  min-width: 0;
  float: none !important;
  grid-column: auto;
  margin: 0;
}

body.woocommerce-checkout .woocommerce-NoticeGroup {
  grid-column: 1 / -1;
}

/* This Woo element holds hidden attribution inputs. Before its consent-gated
   script loads it must not consume a visible checkout grid cell. */
body.woocommerce-checkout .bios_checkout_form > wc-order-attribution-inputs {
  display: none;
}

body:not(.wp-admin) :is(.woocommerce, .modal_login_frames) :is(input.input-text, textarea, select, .select2-container) {
  box-sizing: border-box;
  max-width: 100%;
}

body.woocommerce-checkout .form-row :is(input.input-text, textarea, select:not(.select2-hidden-accessible), .select2-container),
body:not(.wp-admin) .modal_login_frames input.input-text {
  width: 100% !important;
  min-width: 0;
}

body.woocommerce-checkout form.checkout_coupon {
  box-sizing: border-box;
  width: 100%;
}

body.woocommerce-checkout form.checkout_coupon .form-row {
  min-width: 0;
  float: none;
}

body.woocommerce-checkout form.checkout_coupon button.button {
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 !important;
}

/* An order confirmation has no page-title block to separate it from the
   fixed navigation bar. Reserve that space explicitly. */
body.woocommerce-order-received #primary.site-main {
  padding-top: 150px;
}

body.woocommerce-order-received :is(.woocommerce-order-overview, .woocommerce-order-details, .woocommerce-customer-details) {
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.woocommerce-order-received .woocommerce-order-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

body.woocommerce-order-received .woocommerce-order-overview li {
  min-width: 0;
  margin: 0;
  float: none;
}

/* Privacy preferences are an ordinary footer action, not a floating widget. */
body:not(.wp-admin) .oroi .idea-privacy-settings {
  display: inline;
  position: static;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  font: inherit;
  line-height: inherit;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
}

body:not(.wp-admin) .oroi .idea-privacy-settings:hover {
  background: transparent;
  color: inherit;
  text-decoration: underline;
}

body:not(.wp-admin) .oroi .idea-privacy-settings:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* The maintained contact form replaces WPForms, so it needs its own complete
   field layout rather than relying on selectors for the removed plugin. */
body:not(.wp-admin) form.idea-contact-form {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  text-align: left;
}

body:not(.wp-admin) form.idea-contact-form > p {
  margin: 0 0 16px;
}

body:not(.wp-admin) form.idea-contact-form label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
}

body:not(.wp-admin) form.idea-contact-form :is(input[name="contact_name"], input[name="contact_email"], textarea[name="contact_message"]) {
  box-sizing: border-box;
  display: block;
  float: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  background: #fff;
  color: #111;
  -webkit-text-fill-color: #111;
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: none;
}

body:not(.wp-admin) form.idea-contact-form textarea[name="contact_message"] {
  min-height: 160px;
  height: auto;
  resize: vertical;
}

body:not(.wp-admin) form.idea-contact-form :is(input[name="contact_name"], input[name="contact_email"]) {
  height: 50px;
}

body:not(.wp-admin) form.idea-contact-form button[type="submit"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 12px 20px !important;
  border: 1px solid #111;
  border-radius: 3px;
  background: #111 !important;
  color: #fff !important;
  -webkit-text-fill-color: currentColor;
  font: inherit;
  font-size: 16px;
  line-height: 1.5 !important;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

body:not(.wp-admin) form.idea-contact-form button[type="submit"]:hover {
  background: #333 !important;
}

body:not(.wp-admin) .forma-epik form.idea-contact-form button[type="submit"] {
  background: #fff !important;
  color: #9c1717 !important;
  border-color: #fff;
}

body:not(.wp-admin) .forma-epik form.idea-contact-form button[type="submit"]:hover {
  background: #f0f0f0 !important;
  border-color: #f0f0f0;
}

body:not(.wp-admin) form.idea-contact-form :is(input, textarea, button):focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

body:not(.wp-admin) form.idea-contact-form button[type="submit"]:disabled {
  opacity: .7;
  cursor: wait;
}

body:not(.wp-admin) form.idea-contact-form [role="status"] {
  margin: 16px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body:not(.wp-admin) form.idea-contact-form [role="status"]:empty {
  display: none;
}

@media (min-width: 900px) {
  body.woocommerce-checkout form.checkout .bios_checkout_form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

@media (max-width: 899px) {
  body.woocommerce-checkout form.checkout .bios_checkout_form {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  body.woocommerce-checkout :is(.woocommerce-billing-fields, #order_review) {
    min-width: 0;
  }

  body.woocommerce-checkout form.checkout_coupon .form-row {
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  body:not(.wp-admin) .modal_login_frames {
    box-sizing: border-box;
    width: 100%;
    max-width: 450px;
    padding-inline: 16px;
  }

  body:not(.wp-admin) .modal_login_frames input.input-text {
    font-size: 16px;
  }

  body.woocommerce-order-received #primary.site-main {
    padding-top: 120px;
  }
}
