html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background: var(--gtc-color-canvas);
  color: var(--gtc-color-ink);
  letter-spacing: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.template,
.template *,
.gtc-commerce-shell,
.gtc-commerce-shell * {
  letter-spacing: 0;
}

.template,
.gtc-commerce-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--gtc-color-canvas);
  color: var(--gtc-color-ink);
}

.template > .el-container,
.gtc-commerce-shell > .el-container {
  display: grid !important;
  grid-template-columns: var(--gtc-aside-width) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
}

.template .el-aside,
.template .aside-menu,
.template .aside,
.gtc-commerce-shell .el-aside,
.gtc-commerce-shell .aside-menu,
.gtc-commerce-shell .aside {
  grid-column: 1;
  grid-row: 1;
  width: var(--gtc-aside-width) !important;
  min-width: var(--gtc-aside-width) !important;
  max-width: var(--gtc-aside-width) !important;
  height: 100vh !important;
  flex: 0 0 var(--gtc-aside-width) !important;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--gtc-color-surface);
  border-right: 1px solid var(--gtc-color-border);
}

.template > .el-container > .el-container,
.gtc-commerce-shell > .el-container > .el-container {
  grid-column: 2;
  grid-row: 1;
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin-left: 0 !important;
  padding-top: var(--gtc-topbar-height);
}

.template .el-header,
.gtc-commerce-shell .el-header {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--gtc-aside-width) !important;
  z-index: 1000;
  width: calc(100% - var(--gtc-aside-width)) !important;
  min-width: 0;
  height: var(--gtc-topbar-height) !important;
  min-height: var(--gtc-topbar-height) !important;
  max-height: var(--gtc-topbar-height) !important;
  background: var(--gtc-color-surface);
  border-bottom: 1px solid var(--gtc-color-border);
  box-shadow: var(--gtc-shadow-topbar);
}

.template .el-container,
.template .el-main,
.template .el-main > *,
.gtc-commerce-shell .el-container,
.gtc-commerce-shell .el-main,
.gtc-commerce-shell .el-main > * {
  min-width: 0;
  max-width: 100%;
}

.template:not(.status-page) > .el-container > .el-container > .el-main,
.gtc-commerce-shell > .el-container > .el-container > .el-main {
  width: 100%;
  max-width: var(--gtc-content-max);
  min-height: calc(100vh - var(--gtc-topbar-height) - 24px);
  margin: 24px auto 0;
  padding: 24px;
  overflow: visible;
}

.template .el-table,
.gtc-commerce-shell .el-table {
  max-width: 100%;
}

.template .el-table__body-wrapper,
.template .table-scroll,
.gtc-commerce-shell .el-table__body-wrapper,
.gtc-commerce-shell .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.template .el-card,
.template .el-dialog,
.template .el-message-box,
.template .el-input__inner,
.template .el-textarea__inner,
.template .el-button,
.template .el-dropdown-menu,
.template .el-select-dropdown,
.gtc-commerce-shell .el-card,
.gtc-commerce-shell .el-dialog,
.gtc-commerce-shell .el-message-box,
.gtc-commerce-shell .el-input__inner,
.gtc-commerce-shell .el-textarea__inner,
.gtc-commerce-shell .el-button,
.gtc-commerce-shell .el-dropdown-menu,
.gtc-commerce-shell .el-select-dropdown {
  border-radius: var(--gtc-radius-md);
}

.template .el-button--primary,
.gtc-commerce-shell .el-button--primary {
  background: var(--gtc-color-brand);
  border-color: var(--gtc-color-brand);
}

.template .el-button--primary:hover,
.template .el-button--primary:focus,
.gtc-commerce-shell .el-button--primary:hover,
.gtc-commerce-shell .el-button--primary:focus {
  background: var(--gtc-color-brand-hover);
  border-color: var(--gtc-color-brand-hover);
}

.template a,
.gtc-commerce-shell a {
  color: var(--gtc-color-brand);
}

.template a:hover,
.gtc-commerce-shell a:hover {
  color: var(--gtc-color-brand-hover);
}

.template a:focus-visible,
.template button:focus-visible,
.template [role="button"]:focus-visible,
.template input:focus-visible,
.template select:focus-visible,
.template textarea:focus-visible,
.template [tabindex]:focus-visible,
.gtc-commerce-shell a:focus-visible,
.gtc-commerce-shell button:focus-visible,
.gtc-commerce-shell [role="button"]:focus-visible,
.gtc-commerce-shell input:focus-visible,
.gtc-commerce-shell select:focus-visible,
.gtc-commerce-shell textarea:focus-visible,
.gtc-commerce-shell [tabindex]:focus-visible {
  outline: 2px solid var(--gtc-color-focus);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .template > .el-container,
  .gtc-commerce-shell > .el-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .template > .el-container > .el-container,
  .gtc-commerce-shell > .el-container > .el-container {
    grid-column: 1;
    width: 100% !important;
    margin-left: 0 !important;
    padding-top: var(--gtc-topbar-height);
  }

  .template .el-aside,
  .template .aside-menu,
  .template .aside,
  .gtc-commerce-shell .el-aside,
  .gtc-commerce-shell .aside-menu,
  .gtc-commerce-shell .aside {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0 !important;
    z-index: 1100;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, visibility 180ms ease;
  }

  body.client-shell-drawer-open .template .el-aside,
  body.client-shell-drawer-open .template .aside-menu,
  body.client-shell-drawer-open .template .aside,
  .template .el-aside.is-open,
  .template .aside-menu.is-open,
  .template .aside.is-open,
  body.client-shell-drawer-open .gtc-commerce-shell .el-aside,
  body.client-shell-drawer-open .gtc-commerce-shell .aside-menu,
  body.client-shell-drawer-open .gtc-commerce-shell .aside,
  .gtc-commerce-shell .el-aside.is-open,
  .gtc-commerce-shell .aside-menu.is-open,
  .gtc-commerce-shell .aside.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .template .el-header,
  .gtc-commerce-shell .el-header {
    left: 0 !important;
    width: 100% !important;
    height: var(--gtc-topbar-height) !important;
  }

  .template .el-header .menu-img,
  .gtc-commerce-shell .el-header .menu-img {
    display: inline-block !important;
    width: var(--gtc-topbar-height);
    height: var(--gtc-topbar-height);
    cursor: pointer;
    pointer-events: auto;
  }

  .template:not(.status-page) > .el-container > .el-container > .el-main,
  .gtc-commerce-shell > .el-container > .el-container > .el-main {
    width: 100%;
    min-height: calc(100vh - var(--gtc-topbar-height) - 12px);
    margin: 12px auto 0;
    padding: 16px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .template .el-aside,
  .template .aside-menu,
  .template .aside,
  .gtc-commerce-shell .el-aside,
  .gtc-commerce-shell .aside-menu,
  .gtc-commerce-shell .aside {
    transition: none;
  }
}
