/**
 * B2B wholesale gate — matches Gommans theme
 */
:root {
  --b2b-font: 'Poppins', system-ui, sans-serif;
  --b2b-black: #1a1a1a;
  --b2b-red: #e31e24;
  --b2b-red-dark: #c4191f;
  --b2b-gray-100: #f7f7f7;
  --b2b-gray-200: #ececec;
  --b2b-gray-500: #6b6b6b;
  --b2b-radius: 10px;
  --b2b-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

/* ── Overlay ── */
.b2b-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.b2b-gate-backdrop:not(.b2b-gate-hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal shell ── */
.b2b-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.b2b-gate-modal:not(.b2b-gate-hidden) {
  opacity: 1;
  pointer-events: auto;
}

.b2b-gate-hidden {
  display: none !important;
}

body.b2b-gate-active {
  overflow: hidden !important;
}

/* ── Dialog card ── */
.b2b-gate-dialog {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--b2b-radius);
  box-shadow: var(--b2b-shadow);
  font-family: var(--b2b-font);
  color: var(--b2b-black);
  transform: translateY(0) scale(1);
  transition: transform 0.25s ease, max-width 0.2s ease;
  overflow: hidden;
}

.b2b-gate-modal:not(.b2b-gate-hidden) .b2b-gate-dialog {
  animation: b2b-gate-in 0.25s ease;
}

@keyframes b2b-gate-in {
  from {
    transform: translateY(12px) scale(0.98);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.b2b-gate-dialog.is-register-view {
  max-width: 820px;
}

/* ── Header ── */
.b2b-gate-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--b2b-gray-200);
  flex-shrink: 0;
}

.b2b-gate-header__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--b2b-red);
  margin-bottom: 4px;
}

.b2b-gate-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.b2b-gate-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--b2b-gray-100);
  color: var(--b2b-black);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease;
}

.b2b-gate-close span {
  display: block;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-1px);
}

.b2b-gate-close:hover {
  background: var(--b2b-red);
  color: #fff;
}

/* ── Body ── */
.b2b-gate-body {
  padding: 16px 24px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Tabs ── */
.b2b-gate-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  list-style: none;
  background: var(--b2b-gray-100);
  border-radius: 8px;
  flex-shrink: 0;
}

.b2b-gate-tabs > li {
  flex: 1;
  margin: 0;
}

.b2b-gate-tabs > li > a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--b2b-gray-500);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.b2b-gate-tabs > li > a:hover {
  color: var(--b2b-black);
}

.b2b-gate-tabs > li.active > a {
  background: #fff;
  color: var(--b2b-black);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Tab panes ── */
.b2b-gate-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.b2b-gate-tab-content > .tab-pane {
  display: none;
  height: 100%;
}

.b2b-gate-tab-content > .tab-pane.active {
  display: block;
}

/* ── Forms ── */
.b2b-gate-form .form-group {
  margin-bottom: 10px;
}

.b2b-gate-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--b2b-black);
}

.b2b-gate-form .form-control {
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--b2b-font);
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.b2b-gate-form select.form-control {
  padding-right: 28px;
}

.b2b-gate-form .form-control:focus {
  border-color: var(--b2b-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.12);
}

.b2b-gate-form--register .b2b-gate-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.b2b-gate-form__agree {
  margin-top: 4px;
  margin-bottom: 12px;
}

.b2b-gate-form__agree label {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--b2b-gray-500);
}

.b2b-gate-form__agree input {
  margin-right: 6px;
  vertical-align: middle;
}

.b2b-gate-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  background: var(--b2b-red);
  color: #fff;
  font-family: var(--b2b-font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.b2b-gate-btn:hover {
  background: var(--b2b-red-dark);
}

/* ── Alerts ── */
.b2b-gate-alert {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #fdecea;
  color: #a94442;
  border: 1px solid #f5c6cb;
}

.b2b-field-error {
  color: #a94442;
  font-size: 11px;
  margin-top: 3px;
}

/* ── Admin product edit link ── */
.b2b-admin-edit-product {
  margin: 0 0 15px;
}

.b2b-admin-edit-product .btn {
  font-weight: 600;
}

/* ── Standalone register page ── */
.gc-b2b-register-page {
  padding-bottom: 48px;
}

.gc-b2b-register-card {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--b2b-gray-200);
  border-radius: var(--b2b-radius);
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.gc-b2b-register-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}

.gc-b2b-register-card__intro {
  margin-bottom: 24px;
  color: var(--b2b-gray-500);
}

.gc-b2b-register-card legend {
  font-size: 18px;
  font-weight: 600;
  border: none;
  margin-bottom: 16px;
}

.gc-b2b-register__submit,
.gc-b2b-register-card .btn-primary {
  background: var(--b2b-red) !important;
  border-color: var(--b2b-red) !important;
  font-weight: 600;
  padding: 12px 16px;
}

.gc-b2b-register-card .btn-primary:hover {
  background: var(--b2b-red-dark) !important;
  border-color: var(--b2b-red-dark) !important;
}

@media (max-width: 767px) {
  .b2b-gate-dialog,
  .b2b-gate-dialog.is-register-view {
    max-width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .b2b-gate-form--register .b2b-gate-form__grid {
    grid-template-columns: 1fr;
  }

  .b2b-gate-header,
  .b2b-gate-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
