/**
 * Variables, botón CTA y modal del plugin Shopping Brand Applications.
 * Diseño neutro namespaced (.sba-*) para reutilizar en distintos shoppings.
 */

.sba-open-button,
.sba-modal,
.sba-success-popup {
  --sba-primary-color: #1a1a1a;
  --sba-primary-hover: #333333;
  --sba-text-color: #1f1f1f;
  --sba-muted-color: #6b6b6b;
  --sba-background: #ffffff;
  --sba-overlay: rgba(17, 17, 17, 0.55);
  --sba-border-color: #dcdcdc;
  --sba-border-focus: #9a9a9a;
  --sba-error-color: #b42318;
  --sba-border-radius: 12px;
  --sba-input-radius: 8px;
  --sba-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
  --sba-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sba-max-width: 680px;
}

/* -------------------------------------------------------------------------- */
/* Botón CTA                                                                  */
/* -------------------------------------------------------------------------- */

.sba-open-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--sba-primary-color);
  border-radius: var(--sba-input-radius);
  background: var(--sba-primary-color);
  color: #ffffff;
  font-family: var(--sba-font);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sba-open-button:hover {
  background: var(--sba-primary-hover);
  border-color: var(--sba-primary-hover);
}

.sba-open-button:focus-visible {
  background: var(--sba-primary-hover);
  border-color: var(--sba-primary-hover);
  outline: 2px solid var(--sba-primary-color);
  outline-offset: 2px;
}

.sba-open-button:active {
  transform: translateY(1px);
}

/* -------------------------------------------------------------------------- */
/* Modal                                                                      */
/* -------------------------------------------------------------------------- */

.sba-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: contain;
}

.sba-modal[hidden] {
  display: none !important;
}

.sba-modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--sba-overlay);
}

.sba-modal-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: calc(100% - 24px);
  max-width: min(var(--sba-max-width), 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  background: var(--sba-background);
  border-radius: var(--sba-border-radius);
  box-shadow: var(--sba-shadow);
  font-family: var(--sba-font);
  color: var(--sba-text-color);
}

.sba-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--sba-background);
  color: var(--sba-text-color);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sba-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.sba-modal-close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  outline: 2px solid var(--sba-primary-color);
  outline-offset: 2px;
}

.sba-modal-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 1.5rem 1.75rem;
  max-width: 100%;
}

html.sba-modal-open,
body.sba-modal-open {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: none;
}
