/**
 * Registration flow step indicator (company signup + store creation).
 */
.marketplace-delivery-registration-step {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--gin-bg-app, #e0f2f1);
  border: 1px solid var(--gin-border-color, #93c5c4);
}

.marketplace-delivery-registration-step__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gin-color-primary, #0d9488);
}

/**
 * Registration step 2 and dashboard store add (e.g. /dashboard/add/business): hide the
 * empty secondary column (advanced/meta / Gin sidebar).
 *
 * @see commerce/modules/store/templates/commerce-store-form.html.twig
 *
 * Gin replaces the store form theme with node_edit_form (Claro two-column layout);
 * the sidebar is .layout-region--secondary, not .layout-region--commerce-secondary.
 * form.advanced is also hidden via #access in after_build; these rules collapse the
 * empty column and fix the grid when needed.
 */
body.marketplace-delivery-registration-store-step-2 .layout-store-form .layout-region--commerce-secondary,
body.marketplace-delivery-commerce-store-add-dashboard .layout-store-form .layout-region--commerce-secondary {
  display: none !important;
}

body.marketplace-delivery-registration-store-step-2 .layout-store-form .layout-region--commerce-main,
body.marketplace-delivery-commerce-store-add-dashboard .layout-store-form .layout-region--commerce-main {
  flex: 1 1 100%;
  max-width: 100%;
}

/**
 * Commerce store form template (commerce-store-form.html.twig) uses
 * .layout-commerce-form with a 2-column grid; hiding the secondary region still
 * leaves an empty grid track — collapse to one column.
 *
 * @see commerce/css/commerce.admin-layout.css
 */
@media (min-width: 61rem) {
  body.marketplace-delivery-registration-store-step-2 .layout-store-form.layout-commerce-form,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-store-form.layout-commerce-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.marketplace-delivery-registration-store-step-2 .layout-region--commerce-main,
  body.marketplace-delivery-registration-store-step-2 .layout-region--commerce-footer,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-region--commerce-main,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-region--commerce-footer {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }
}

body.marketplace-delivery-registration-store-step-2 .layout-form .layout-region--secondary,
body.marketplace-delivery-commerce-store-add-dashboard .layout-form .layout-region--secondary {
  display: none !important;
}

/**
 * Gin entity forms (commerce_store add uses #theme node_edit_form): secondary column is
 * #gin_sidebar.layout-region-node-secondary (fixed), not Claro's .layout-region--secondary.
 *
 * @see gin/templates/node/node-edit-form.html.twig
 */
body.marketplace-delivery-registration-store-step-2 #gin_sidebar,
body.marketplace-delivery-registration-store-step-2 .page-wrapper__node-edit-form .layout-region-node-secondary,
body.marketplace-delivery-commerce-store-add-dashboard #gin_sidebar,
body.marketplace-delivery-commerce-store-add-dashboard .page-wrapper__node-edit-form .layout-region-node-secondary {
  display: none !important;
  visibility: hidden !important;
}

body.marketplace-delivery-registration-store-step-2.gin--edit-form,
body.marketplace-delivery-commerce-store-add-dashboard.gin--edit-form {
  padding-inline-end: 0 !important;
}

body.marketplace-delivery-registration-store-step-2 .meta-sidebar__trigger,
body.marketplace-delivery-commerce-store-add-dashboard .meta-sidebar__trigger {
  display: none !important;
}

/**
 * Claro form-two-columns limits main to --layout-region-edit-width (≈60rem) and
 * centers it (margin-inline: auto), leaving empty space beside the form. For
 * registration step 2 we stretch the form to the full content width.
 */
body.marketplace-delivery-registration-store-step-2,
body.marketplace-delivery-commerce-store-add-dashboard {
  --layout-region-edit-width: 100%;
  --layout-region-edit-extended-width: 100%;
}

body.marketplace-delivery-registration-store-step-2 .layout-form,
body.marketplace-delivery-commerce-store-add-dashboard .layout-form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 61rem) {
  body.marketplace-delivery-registration-store-step-2 .layout-form,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-form {
    /* Claro two-column grid: second column stays empty if secondary is hidden. */
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch;
  }

  body.marketplace-delivery-registration-store-step-2 .layout-form .layout-region--main,
  body.marketplace-delivery-registration-store-step-2 .layout-form .layout-region--footer,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-form .layout-region--main,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-form .layout-region--footer {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }

  body.marketplace-delivery-registration-store-step-2 .layout-form .layout-region--main .layout-region__content,
  body.marketplace-delivery-registration-store-step-2 .layout-form .layout-region--footer .layout-region__content,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-form .layout-region--main .layout-region__content,
  body.marketplace-delivery-commerce-store-add-dashboard .layout-form .layout-region--footer .layout-region__content {
    max-width: 100%;
  }
}

/* Gin: entity forms use .block-system-main-block; ensure wrapper does not cap width. */
body.marketplace-delivery-registration-store-step-2 .page-content > .region-content .block-system-main-block,
body.marketplace-delivery-registration-store-step-2 .region-content .block-system-main-block,
body.marketplace-delivery-commerce-store-add-dashboard .page-content > .region-content .block-system-main-block,
body.marketplace-delivery-commerce-store-add-dashboard .region-content .block-system-main-block {
  max-width: 100% !important;
}

/* Gin: sticky entity form toolbar is capped (~1300px); stretch with content width. */
@media (min-width: 64em) {
  body.marketplace-delivery-registration-store-step-2.gin--edit-form .sticky-shadow,
  body.marketplace-delivery-commerce-store-add-dashboard.gin--edit-form .sticky-shadow {
    max-width: none !important;
    width: 100% !important;
  }
}
