#clostech-root {
  --bg-color: #000000;
  --text-color: #ffffff;
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --primary-button-active-color: #000000;
  --primary-button-hover-color: #1a1a1a;
  --secondary-button-hover-color: #f3f4f6;
  --secondary-button-active-color: #e5e7eb;
  --colorful-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.40) inset, 0px 2px 4px 0px rgba(0, 0, 0, 0.20) inset;
  --colorful-shadow-lg: 0px -8px 12px 0px rgba(0, 0, 0, 0.40) inset, 0px 4px 8px 0px rgba(0, 0, 0, 0.25) inset;
  --button-shadow: inset 0px -4px 2px 0px rgba(0, 0, 0, 0.25), inset 0px 2px 1px 0px rgba(255, 255, 255, 0.25);

  position: fixed;
  z-index: 2147483000;
  top: 0;
  left: 0;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  min-height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.65);
  color: #1a1a1a;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

#clostech-root * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Utility classes used in dynamic templates */
#clostech-root .flex {
  display: flex;
}

#clostech-root .flex-col {
  flex-direction: column;
}

#clostech-root .gap-4 {
  gap: 16px;
}

#clostech-root .w-full {
  width: 100%;
}

#clostech-root .px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

#clostech-snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  translate: -50%;
  width: 320px;
  min-height: 56px;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  font-size: 14px;
  color: #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 2147483001;
  animation: clostech-slideUp 0.3s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#clostech-root #snackbar-text {
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.4;
  margin-right: 12px;
}

#clostech-root #clostech-x-mark-snackbar {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

#clostech-root #clostech-x-mark-snackbar:hover {
  opacity: 1;
}

#clostech-root .clostech-login {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  height: 680px;
  padding: 0 20px;
  border-radius: 24px;
  background-color: var(--bg-color);
  box-shadow: var(--colorful-shadow-lg);
}

#clostech-root .clostech-login__title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 30px;
}

#clostech-root .clostech-login h2 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  font-family: sans-serif;
  color: var(--text-color);
}

#clostech-root .clostech-login h3 {
  font-size: 24px;
  font-weight: 400;
  text-align: center;
  font-family: sans-serif;
  color: var(--text-color);
}

#clostech-root .clostech-login img {
  object-fit: contain;
}

#clostech-root .clostech-login .clostech-img-logo {
  width: 65px;
  height: 94px;
}

#clostech-root .clostech-login .clostech-img-name {
  width: 213px;
  margin-top: 40px;
}

#clostech-root .clostech-login form {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#clostech-root .clostech-login form input {
  height: 40px;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  width: 100%;
  font-size: 14px;
  border: none;
  outline: none;
  background-color: var(--bg-color);
  box-shadow: var(--colorful-shadow);
  box-sizing: border-box;
  font-family: sans-serif;
}

#clostech-root .clostech-login form button {
  padding: 0.5rem;
  border-radius: 8px;
  border: none;
  width: 100%;
  height: 40px;
  color: #fff;
  font-size: 14px;
  background-color: var(--primary-button-active-color);
  box-shadow: var(--button-shadow);
}

#clostech-root .clostech-login form button:hover {
  background-color: var(--primary-button-hover-color);
  cursor: pointer;
}

#clostech-root .clostech-login__link {
  color: var(--secondary-color);
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  text-decoration: none;
  font-size: 14px;
}

#clostech-root .clostech-login__link:hover {
  color: var(--secondary-button-hover-color);
  cursor: pointer;
}

#clostech-root .clostech-select-type,
#clostech-root .clostech-avatar {
  margin: auto;
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  padding: 20px;
  border-radius: 0;
  background-color: #fff;
}

#clostech-root .clostech-avatar-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
  transition: transform 0.3s ease;
  margin: 16px 0;
}

#clostech-root .clostech-logo {
  height: 32px;
  object-fit: contain;
  background-color: var(--bg-color);
}

#clostech-root .clostech-select-type button,
#clostech-root .clostech-avatar button {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

#clostech-root .clostech-file-upload {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  border: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#clostech-root .clostech-select-type form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 0;
  animation: clostech-fadeIn 0.3s ease-out;
}

#clostech-root .clostech-select-type form select {
  border-radius: 16px;
  border: 2px solid #c6c6c6;
  width: 100%;
  height: 48px;
  padding: 0 16px;
}

#clostech-root .clostech-select-type form div {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#clostech-root .clostech-business-logo {
  height: 32px;
  object-fit: contain;
}

#clostech-root .clostech-select-action {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin: auto;
  width: 92vw;
  max-width: 918px;
  height: auto;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 0; /* sin bordes redondeados */
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 2147483002; /* popup above close button */
}

#clostech-root .clostech-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#clostech-root .clostech-modal-close:hover {
  background: #e5e7eb;
  color: #1f2937;
  transform: scale(1.05);
}

#clostech-root .clostech-modal-close svg {
  width: 20px;
  height: 20px;
}

#clostech-root .clostech-select-action__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  width: 100%;
}

#clostech-root .clostech-select-action__right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

#clostech-root .clostech-select-action__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#clostech-root .clostech-select-action__text p {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

/* Montserrat title style */
#clostech-root .clostech-title {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

#clostech-root .clostech-select-action__example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
}

#clostech-root .clostech-reuse-modal {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  padding: 16px;
}

#clostech-root .clostech-reuse-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 0;
  padding: 36px 28px 32px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

#clostech-root .clostech-reuse-card .clostech-x-mark {
  position: absolute;
  top: 14px;
  right: 14px;
  cursor: pointer;
}

#clostech-root .clostech-reuse-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#clostech-root .clostech-reuse-title {
  font-family: "Montserrat", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

#clostech-root .clostech-reuse-description {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

#clostech-root .clostech-reuse-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

#clostech-root .clostech-reuse-actions .clostech-secondary-button {
  height: 52px;
  border-radius: 12px;
}

#clostech-root .clostech-reuse-actions .clostech-primary-button {
  font-weight: 700;
}

#clostech-root .clostech-example-text {
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
}

#clostech-root .clostech-example-caption {
  color: #6B7280;
  font-size: 12px;
  font-weight: 500;
}

#clostech-root .clostech-example-img {
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 0;
  border: none;
  transition: transform 0.3s ease;
}

#clostech-root .clostech-example-img:hover {
  transform: scale(1.05);
}

#clostech-root .clostech-select-action__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Gap between requirements and CTA button per design */
#clostech-root .clostech-select-action__buttons .clostech-primary-button {
  margin-top: 27px;
}

#clostech-root .clostech-discount-badge {
  text-align: center;
  padding: 8px 16px;
  background: #f0f9ff;
  border-radius: 8px;
  animation: clostech-pulse 2s infinite;
}

#clostech-root .clostech-discount-badge span {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

/* Requirements list (icons + text) */
#clostech-root .clostech-requirements {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 18px;
  width: 100%;
}

#clostech-root .clostech-requirements .item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #111827;
}

#clostech-root .clostech-requirements .item-wide {
  grid-column: 1 / -1;
  justify-content: center;
  text-align: center;
  gap: 8px; /* acercar texto al icono */
}

#clostech-root .clostech-requirements .svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

/* En el item-wide, hacer el icono levemente más chico para reducir separación visual */
#clostech-root .clostech-requirements .item-wide .svg-icon,
#clostech-root .clostech-requirements .item-wide .svg-icon svg {
  width: 28px;
  height: 28px;
}

#clostech-root .clostech-requirements .svg-icon svg {
  width: 32px;
  height: 32px;
  display: block; /* elimina baseline gap */
  vertical-align: middle;
}

#clostech-root .clostech-requirements .item span:last-child {
  display: flex;
  align-items: center; /* centra verticalmente el texto con el icono */
}

#clostech-root .clostech-primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#clostech-root .clostech-primary-button:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#clostech-root .clostech-button-icon {
  width: 20px;
  height: 20px;
}

/* XL primary button variant for 56px height */
#clostech-root .clostech-primary-xl {
  height: 56px;
  border-radius: 12px;
  font-weight: 700;
}

/* Secondary button (white background, gray border) */
#clostech-root .clostech-secondary-button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  height:56px;
  border-radius:12px;
  background:#ffffff;
  color:#111827;
  border:1px solid #e5e7eb;
  cursor:pointer;
  transition: background .15s ease;
}
#clostech-root .clostech-secondary-button:hover { background:#f9fafb; }

/* Privacy text */
#clostech-root .clostech-privacy { font-size:12px; color:#6b7280; text-align:center; }
/* En vistas de previsualización, mantenerlo lo más abajo posible */
#clostech-root .clostech-select-type .clostech-privacy,
#clostech-root .clostech-select-action .clostech-privacy {
  margin-top: auto;
  margin-bottom: 8px;
}

.clostech__invisible {
  display: none !important;
}

#clostech-root .clostech-avatar {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  min-height: 620px;
  padding: 32px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#clostech-root .clostech-ai-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
  line-height: 1.4;
  padding: 0 16px;
}

#clostech-root #clostech-loader,
#clostech-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center; /* centra perfecto en ambos ejes */
  background: rgba(0, 0, 0, 0.45);
  z-index: 2147483005;
  animation: clostech-fadeIn 0.2s ease-out;
  width: 100dvw;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}

/* Loader card */
#clostech-root .clostech-loader-card {
  width: 90%;
  max-width: 720px;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  /* Ensure card stays centered within loader overlay */
  margin: auto;
}

#clostech-root .clostech-loader-gradient {
  position: relative;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #000000 0%, #9ca3af 50%, #000000 100%);
  background-size: 200% 100%;
  animation: clostechGradientShift 8s ease-in-out infinite alternate;
}
#clostech-root .clostech-loader-gradient::before { content: none; }
#clostech-root .clostech-loader-gradient::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%; height: 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0));
  pointer-events: none;
}
@keyframes clostechGradientShift { 0% { background-position: 0% 0; } 100% { background-position: 100% 0; } }

#clostech-root .clostech-loader-content {
  padding: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* centra verticalmente el bloque */
  gap: 14px;
  flex: 1; /* ocupa el espacio entre el degradado y el disclaimer */
}

#clostech-root .clostech-loader-icon {
  font-size: 56px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#clostech-root .clostech-loader-icon svg {
  width: 72px;
  height: 72px;
  display: block;
}

#clostech-root .clostech-loader-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

#clostech-root .clostech-loader-text {
  opacity: 0;
  transition: opacity .3s ease;
}

#clostech-root .clostech-loader-sub {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
}

#clostech-root .clostech-loader-disclaimer {
  padding: 24px;
  width: 100%;
  color: #6b7280;
  text-align: center;
  font-size: 12px;
}

/* ===== Size Wizard (loader-like card) ===== */
#clostech-root .clostech-size-wizard {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center; /* centra perfecto en ambos ejes */
  background: rgba(0, 0, 0, 0.45);
  z-index: 2147483005;
  animation: clostech-fadeIn 0.2s ease-out;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}
#clostech-root .clostech-wizard-card {
  margin: auto;
  width: 90%;
  max-width: 720px; /* igual al loader */
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
#clostech-root .clostech-wizard-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
#clostech-root .clostech-wizard-back:hover { background: #e5e7eb; transform: translateX(-1px); }
#clostech-root .clostech-wizard-content {
  padding: 28px 24px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
/* Centrado específico para sexo y edad */
#clostech-root #clostech-wizard-step-sex { width:100%; flex:1 1 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; }
#clostech-root #clostech-wizard-step-sex > .clostech-wizard-title { text-align:center; margin-bottom:16px; }
#clostech-root #clostech-wizard-step-sex > div { align-self:center; margin-top:20px !important; }
#clostech-root #clostech-wizard-step-age { width:100%; flex:1 1 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; }
#clostech-root #clostech-wizard-step-age .clostech-wizard-title { margin-bottom:8px; }
#clostech-root #clostech-wizard-step-age #clostech-wizard-age-form { margin-top:6px; }
#clostech-root #clostech-wizard-step-age .clostech-wizard-disclaimer { margin-top:8px; }

/* Age/Weight pill table */
#clostech-root .clo-age-wrap { width:100%; max-width:520px; display:flex; flex-direction:column; align-items:center; gap:8px; }
#clostech-root .clo-age-table { width:100%; position:relative; }
#clostech-root .clo-age-pill { background:#f9fafb; border:1px solid #e5e7eb; border-radius:18px; box-shadow: 0 6px 18px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02); padding:12px 16px; width:100%; }
#clostech-root .clo-age-row { display:flex; align-items:center; justify-content:center; gap:12px; }
#clostech-root .clo-age-neighbor { font-size:28px; font-weight:800; color:#111827; opacity:.35; user-select:none; cursor:pointer; }
#clostech-root .clo-age-neighbor:hover { opacity:.55; }
#clostech-root .clo-age-input { width:82px; height:48px; text-align:center; font-size:30px; font-weight:900; border:none; outline:none; background:#fff; color:#111827; border-radius:12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(0,0,0,.04); border:1px solid #e5e7eb; }
#clostech-root .clo-age-input::-webkit-outer-spin-button, #clostech-root .clo-age-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#clostech-root .clo-age-secondary { color:#000000; font-weight:600; font-size:14px; text-align:center; margin-top:2px; }
#clostech-root .clostech-why-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
}
#clostech-root .clostech-pill-btn {
  width: 100%;
  height: 64px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
#clostech-root .clostech-pill-btn:hover { box-shadow: 0 4px 10px rgba(0,0,0,.06); border-color: #d1d5db; }
#clostech-root .clostech-pill-btn:active { transform: scale(0.995); }
#clostech-root .clostech-wizard-title { font-size: 24px; font-weight: 700; text-align: center; }
#clostech-root .clostech-wizard-sub { font-size: 14px; color: #6b7280; text-align: center; }
#clostech-root .clostech-wizard-input {
  height: 56px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0 16px;
  font-size: 16px;
  width: 100%;
  background: #f9fafb;
}
#clostech-root .clostech-wizard-disclaimer { font-size: 12px; color:#6b7280; text-align:center; }

/* Height step styles (ruler-like) */
#clostech-root .clo-height-grid { width:100%; max-width: 620px; display:flex; gap:16px; align-items:stretch; justify-content:center; }
#clostech-root .clo-left-box { flex: 1 1 44%; display:flex; flex-direction:column; gap:12px; align-items:center; justify-content:center; }
#clostech-root .clo-number-box { width:100%; height:120px; border:1px solid #e5e7eb; border-radius:16px; display:flex; align-items:center; justify-content:center; background:#fff; }
#clostech-root .clo-number-input { width: 80%; text-align:center; font-size:48px; font-weight:800; color:#111827; border:none; outline:none; background:transparent; caret-color:#000000; }
#clostech-root .clo-unit-toggle { display:inline-flex; border:1px solid #e5e7eb; border-radius:999px; overflow:hidden; }
#clostech-root .clo-unit-btn { padding:8px 14px; border:none; background:#fff; color:#111827; cursor:pointer; font-weight:600; }
#clostech-root .clo-unit-btn.active { background: rgba(0,0,0,0.08); color:#000000; }
#clostech-root .clo-unit-btn + .clo-unit-btn { border-left:1px solid #e5e7eb; }

#clostech-root .clo-ruler-box { flex: 1 1 56%; display:flex; align-items:center; justify-content:center; }
#clostech-root .clo-ruler { position:relative; width: 140px; height: 360px; border:1px solid #e5e7eb; border-radius: 16px; background:#f7f7f8; overflow: hidden; cursor: ns-resize; }
#clostech-root .clo-ruler::before, #clostech-root .clo-ruler::after { content:""; position:absolute; left:0; right:0; height:48px; pointer-events:none; z-index:3; }
#clostech-root .clo-ruler::before { top:0; background: linear-gradient(to bottom, #ffffff, rgba(255,255,255,0)); }
#clostech-root .clo-ruler::after  { bottom:0; background: linear-gradient(to top,   #ffffff, rgba(255,255,255,0)); }
#clostech-root .clo-ruler-track { position:absolute; left:50%; transform:translateX(-50%); top:16px; bottom:16px; width:4px; background:#e5e7eb; border-radius:4px; z-index:1; }
#clostech-root .clo-scale { position:absolute; left:0; right:0; top:0; will-change: transform; transition: transform .12s ease-out; z-index:4; }
#clostech-root .clo-tick { position:absolute; left: 50%; transform: translateX(-50%); width: 100%; height: 2px; }
#clostech-root .clo-tick .clo-tick-line { position:absolute; height:2px; background:#cdd1d6; }
#clostech-root .clo-tick.c1  .clo-tick-line { width:12px; left: calc(50% - 12px); opacity:.45; }
#clostech-root .clo-tick.c5  .clo-tick-line { width:28px; left: calc(50% - 28px); opacity:.7; }
#clostech-root .clo-tick.c10 .clo-tick-line { width:44px; left: calc(50% - 44px); opacity:1; }
#clostech-root .clo-tick .clo-tick-label { position:absolute; right:12px; top:-12px; color:#6b7280; font-size:18px; font-weight:700; letter-spacing:.4px; z-index:5; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
#clostech-root .clo-indicator { position:absolute; top:50%; transform:translateY(-50%); left:0; width:100%; pointer-events:none; z-index:4; }
#clostech-root .clo-indicator-line { position:absolute; left:0; right:0; height:2px; background:#000000; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
#clostech-root .clo-indicator-dot-right { position:absolute; right:10px; width:16px; height:16px; background:#000000; border-radius:999px; border:2px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,0.3); transform:translateY(-50%); }
#clostech-root .clo-indicator-dot-left  { position:absolute; left:12px; width:8px; height:8px; background:#000000; border-radius:999px; border:2px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,0.25); transform:translateY(-50%); opacity:.9; }

@media (max-width: 560px) {
  #clostech-root {
    align-items: flex-start;
    padding-top: 24px;
    padding-bottom: 24px;
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  #clostech-root .clo-height-grid { flex-direction:column; max-width:420px; }
  #clostech-root .clo-ruler { height:300px; width:120px; }
}

@media (max-width: 480px) {
  #clostech-root .clostech-select-action {
    width: 88vw;
    max-width: 420px;
    height: auto;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    overscroll-behavior: contain;
  }

  #clostech-root .clostech-select-action__content {
    gap: 10px;
  }

  #clostech-root .clostech-select-action__example {
    order: 1;
    width: 100%;
    margin-bottom: 8px;
  }

  #clostech-root .clostech-select-action__right {
    order: 2;
    width: 100%;
    align-items: center;
    padding: 8px;
  }

  #clostech-root .clostech-select-action__text {
    align-items: center;
    text-align: center;
  }

  #clostech-root .clostech-select-action__text p {
    font-size: 18px;
  }

  #clostech-root .clostech-select-action__text span {
    font-size: 13px !important;
  }

  #clostech-root .clostech-example-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 40vh;
    object-fit: contain;
  }

  #clostech-root .clostech-requirements {
    justify-items: start;
  }

  #clostech-root .clostech-requirements .item {
    justify-content: flex-start;
    font-size: 14px;
    gap: 8px;
  }

  #clostech-root .clostech-requirements .svg-icon,
  #clostech-root .clostech-requirements .svg-icon svg {
    width: 24px;
    height: 24px;
  }

  #clostech-root .clostech-select-action__buttons {
    margin-top: auto;
  }

  #clostech-root .clostech-primary-button {
    padding: 10px 16px;
    font-size: 15px;
  }

  #clostech-root .clostech-select-action .clostech-x-mark {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    z-index: 2147483004;
  }

  #clostech-root .clostech-select-type .clostech-select-action__example {
    order: 1;
    width: 100%;
  }

  #clostech-root .clostech-select-type .clostech-select-action__right {
    order: 2;
    width: 100%;
    align-items: center;
  }

  #clostech-root .clostech-select-type {
    width: 86vw;
    max-width: 380px;
    height: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
  }

  #clostech-root .clostech-avatar {
    max-width: 340px;
    min-height: 580px;
    padding: 24px;
  }

  #clostech-root .clostech-avatar-img {
    max-height: 380px;
  }

  #clostech-root .clostech-select-type form div {
    gap: 12px;
  }

  #clostech-root .clostech-file-upload,
  #clostech-root .clostech-select-type button {
    height: 52px !important;
    font-size: 15px !important;
  }

  #clostech-root .clostech-spinner {
    width: 48px;
    height: 48px;
  }

  #clostech-root .clostech-loader-text {
    font-size: 16px;
  }

  #clostech-root .clostech-wizard-card {
    max-width: 340px;
  }

  #clostech-root .clo-size-ui {
    max-width: 100%;
    margin: 8px auto 0;
    padding: 0 8px;
  }

  #clostech-root .clo-rec-list {
    border-radius: 10px;
  }

  #clostech-root .clo-rec-item {
    padding: 8px 10px;
  }

  #clostech-root .clo-rec-item .label {
    font-size: 13px;
  }

  #clostech-root .clo-rec-item .value {
    font-size: 14px;
  }

  #clostech-root .clo-availability-note {
    font-size: 13px;
    padding: 8px 10px;
  }

  #clostech-root .clo-scale {
    gap: 8px;
    padding: 14px 4px 4px;
    margin: 6px 0;
  }

  #clostech-root .clo-tick .label {
    font-size: 11px;
  }

  #clostech-root .clo-tick .arrow {
    font-size: 11px;
    top: -12px;
  }
}

@media (max-width: 360px) {
  #clostech-root .clo-rec-item {
    padding: 6px 8px;
  }

  #clostech-root .clo-rec-item .label {
    font-size: 12px;
  }

  #clostech-root .clo-rec-item .value {
    font-size: 13px;
  }

  #clostech-root .clo-availability-note {
    font-size: 12px;
  }
}

@keyframes clostechFadePink { from { opacity: 1; } to { opacity: 0; } }
@keyframes clostechFadeBlue { from { opacity: 0; } to { opacity: 1; } }

/* Fade states for dynamic content */
#clostech-root .fade-out { opacity: 0; transition: opacity .3s ease; }
#clostech-root .fade-in { opacity: 1; transition: opacity .3s ease; }

#clostech-root .clostech-x-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1000;
}

#clostech-root .clostech-x-mark:hover {
  background: #e5e7eb;
  color: #1f2937;
  transform: scale(1.05);
}

#clostech-root .clostech-x-mark svg {
  width: 20px;
  height: 20px;
}

/* Desktop: move close button outside the popup on the select-action view */
@media (min-width: 1024px) {
  #clostech-root .clostech-select-action .clostech-x-mark {
    top: 20px; /* más arriba */
    right: -20px; /* más pegado al borde */
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 0; /* cuadrado */
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: none; /* sin sombra */
    z-index: 2147483001; /* debajo del popup para que quede por atrás */
  }

  #clostech-root .clostech-select-action .clostech-x-mark svg {
    width: 22px;
    height: 22px;
  }
}

#clostech-root .clostech-logout {
  position: absolute;
  top: 20px;
  right: 60px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #000;
}

#clostech-root .clostech-password {
  position: relative;
}

#clostech-root .clostech-toggle-password {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  opacity: 50%;
  right: 20px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

#clostech-root .clostech-select-type {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  width: 92vw;
  max-width: 918px;
  height: auto;
  padding: 0; /* sin padding base para evitar bordes en desktop */
  box-sizing: border-box;
  border-radius: 0; /* sin bordes redondeados */
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
#clostech-root .clostech-select-type .clostech-select-action__content {
  width: 100%;
}

#clostech-root .clostech-select-type .clostech-select-action__right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

#clostech-root .clostech-avatar-img:hover {
  transform: scale(1.02);
}

#clostech-root .clostech-select-type form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 0;
  animation: clostech-fadeIn 0.3s ease-out;
}

#clostech-root .clostech-select-type form select {
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  font-size: 16px;
  background-color: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 24px;
}

#clostech-root .clostech-select-type form select:hover {
  border-color: #d1d5db;
  background-color: #f3f4f6;
}

#clostech-root .clostech-select-type form select:focus {
  outline: none;
  border-color: #9ca3af;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

#clostech-root .clostech-select-type form div {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#clostech-root .clostech-file-upload,
#clostech-root .clostech-select-type button {
  height: 56px !important;
  font-size: 16px !important;
  border-radius: 16px !important;
  width: 100% !important;
}

#clostech-root .clostech-logo {
  height: 32px;
  object-fit: contain;
  background-color: var(--bg-color);
  padding: 6px 12px;
  border-radius: 8px;
  transition: opacity 0.2s ease;
  margin-bottom: 12px;
}

#clostech-root .clostech-logo:hover {
  opacity: 0.9;
}

#clostech-root .clostech-business-logo {
  height: 32px;
  object-fit: contain;
  transition: transform 0.2s ease;
  margin-top: 16px;
}

#clostech-root .clostech-business-logo:hover {
  transform: scale(1.05);
}

/* Nuevo estilo para la vista de tallas */
#clostech-root .clostech-size-form {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  min-height: 620px;
  padding: 32px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-align: center;
  animation: clostech-fadeIn 0.3s ease-out;
}

#clostech-root .clostech-size-form h2 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

#clostech-root .clostech-size-form p {
  font-size: 16px;
  color: #4B5563;
  margin-bottom: 24px;
}

#clostech-root .clostech-size-form form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#clostech-root .clostech-size-form .clostech-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

#clostech-root .clostech-size-form label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

#clostech-root .clostech-size-form input,
#clostech-root .clostech-size-form select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  background-color: #f9fafb;
}

#clostech-root .clostech-size-form input:focus,
#clostech-root .clostech-size-form select:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

/* Nuevo estilo para la recomendación de talle */
#clostech-root .clostech-size-recommendation {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  text-align: left;
}

#clostech-root .clostech-size-recommendation p {
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
}

@media (min-width: 1024px) {
  #clostech-root .clostech-select-action {
    width: 918px;
    height: 500px;
    padding: 0; /* sin padding en desktop para imagen full-bleed */
    box-sizing: border-box;
    border-radius: 0; /* asegurar sin bordes en desktop */
  }

  #clostech-root .clostech-select-action__content {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 0; /* sin separación, mitad y mitad */
    height: 100%;
  }

  #clostech-root .clostech-select-action__example {
    width: 50%;
    height: 100%;
    padding: 0; /* sin padding: imagen al ras del borde del popup */
    background: none;
    border: none;
    overflow: hidden; /* recorte limpio */
    align-items: flex-start; /* no centrada */
    justify-content: center;
  }

  #clostech-root .clostech-select-action__right {
    width: 50%;
    align-items: center; /* centrado según diseño */
    padding: 24px; /* padding sólo en derecha */
    box-sizing: border-box;
  }

  #clostech-root .clostech-select-action__buttons {
    width: 100%;
  }

  #clostech-root .clostech-requirements {
    grid-template-columns: 1fr 1fr; /* dos columnas en desktop */
    align-items: start;
  }

  #clostech-root .clostech-requirements .item {
    font-size: 16px; /* igual al diseño */
  }

  #clostech-root .clostech-example-img {
    height: 100%;
    width: auto;
    max-width: 100%;
  }

  #clostech-root .clostech-example-caption {
    display: none; /* ocultar caption en desktop */
  }

  /* Select-type desktop matches layout */
  #clostech-root .clostech-select-type {
    width: 918px;
    height: 500px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: 0 24px 80px rgba(0,0,0,.30);
  }
  #clostech-root .clostech-select-type .clostech-select-action__content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    height: 100%;
    width: 100%;
  }
  #clostech-root .clostech-select-type .clostech-select-action__example {
    flex: 1 1 50%;
    height: 100%;
    min-height: 100%;
    padding: 0 !important; /* sin padding */
    margin: 0 !important;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    position: relative;
    border-radius: 0;
  }
  #clostech-root .clostech-select-type .clostech-avatar-img {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover; /* sin bordes, llena toda la mitad izquierda */
    border-radius: 0;
    margin: 0;
    transform: none !important; /* evita efecto hover que cambia el tamaño percibido */
  }
  #clostech-root .clostech-select-type .clostech-select-action__right {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px; /* padding generoso */
    box-sizing: border-box;
    height: 100%;
    gap: 24px;
  }
  /* Close outside for select-type */
  #clostech-root .clostech-select-type .clostech-x-mark {
    top: 20px;
    right: -20px;
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 0;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: none;
    z-index: 2147483001;
  }
}

/* Tablet/Phablet range: 560px–1023px */
@media (min-width: 560px) and (max-width: 1023px) {
  #clostech-root .clostech-select-action {
    width: 80vw;
    max-width: 880px;
    height: auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
  }

  #clostech-root .clostech-select-action__content {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  #clostech-root .clostech-select-action__example {
    width: 50%;
    max-height: 48vh;
    padding: 0;
  }

  #clostech-root .clostech-example-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }

  #clostech-root .clostech-select-action__right {
    width: 50%;
    padding: 16px;
    box-sizing: border-box;
    align-items: center;
  }

  #clostech-root .clostech-requirements {
    grid-template-columns: 1fr;
  }

  #clostech-root .clostech-requirements .item {
    font-size: 16px;
  }

  #clostech-root .clostech-requirements .svg-icon,
  #clostech-root .clostech-requirements .svg-icon svg {
    width: 28px;
    height: 28px;
  }

  #clostech-root .clostech-select-action .clostech-x-mark {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    z-index: 2147483004;
  }

  #clostech-root .clostech-select-type {
    width: 80vw;
    max-width: 880px;
    height: auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
  }

  #clostech-root .clostech-select-type .clostech-select-action__content {
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
  }

  #clostech-root .clostech-select-type .clostech-select-action__example {
    flex: 1 1 50%;
    max-height: 48vh;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: stretch;
    position: relative;
  }

  #clostech-root .clostech-select-type .clostech-avatar-img {
    height: 100%;
    width: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
  }

  #clostech-root .clostech-select-type .clostech-select-action__right {
    flex: 1 1 50%;
    padding: 16px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  #clostech-root .clostech-select-type .clostech-x-mark {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    z-index: 2147483004;
  }
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.clostech-anim-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.clostech-anim-slide-out-left {
    animation: slideOutLeft 0.3s ease-out forwards;
}

.clostech-anim-slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

.clostech-anim-slide-out-right {
    animation: slideOutRight 0.3s ease-out forwards;
}

.clostech-anim-slide-in-left {
    animation: slideInLeft 0.3s ease-out forwards;
}

/* Add pointer-events none during transition to prevent clicking */
.clostech-wizard-step.is-transitioning {
    pointer-events: none;
}

/* ===== Post-upload status (aviso estilo Tiendanube) ===== */
#clostech-root .clostech-upload-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

#clostech-root .clostech-upload-status.is-ready {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

#clostech-root .clostech-upload-status.is-ready .clostech-upload-status__spinner svg path {
  fill: #ffffff;
}

#clostech-root .clostech-upload-status.is-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

#clostech-root .clostech-upload-status__spinner {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#clostech-root .clostech-upload-status:not(.is-ready):not(.is-error) .clostech-upload-status__spinner::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #d1d5db;
  border-top-color: #000000;
  border-radius: 50%;
  animation: clostech-spin 0.8s linear infinite;
}

@keyframes clostech-spin {
  to { transform: rotate(360deg); }
}

/* Evita que players/iframes queden por encima del modal */
#clostech-root,
#clostech-root .clostech-select-action,
#clostech-root .clostech-select-type,
#clostech-loader,
#clostech-snackbar {
  isolation: isolate;
}
