/* ==========================================================================
   Shopibaby Design System — single source of truth for brand & components
   Loaded after bootstrap.min.css and shop-homepage.css via partials/head.php.
   Layer 1: tokens · Layer 2: base · Layer 3: components (.sb-*)
   Layer 4: legacy bridge (restyles existing Bootstrap 4 / template classes)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --sb-primary: #7b28ff;
  --sb-primary-600: #631be1;
  --sb-primary-700: #5316bd;
  --sb-primary-100: #ede2ff;
  --sb-primary-50: #f7f2ff;

  --sb-accent: #00e8d2;          /* decorative only — fails contrast on white */
  --sb-accent-700: #008577;      /* AA-compliant teal for text/icons on white */
  --sb-accent-100: #d4fbf7;

  --sb-ink: #00324b;
  --sb-ink-soft: #4a6274;
  --sb-ink-muted: #7d919f;

  --sb-surface: #ffffff;
  --sb-surface-alt: #f8f7fc;
  --sb-border: #e7e4f2;

  /* Semantic */
  --sb-success: #0e9f6e;
  --sb-success-bright: #1be082;
  --sb-danger: #e0455a;
  --sb-warning: #f59e0b;

  /* Shape */
  --sb-radius-sm: 8px;
  --sb-radius: 14px;
  --sb-radius-lg: 20px;
  --sb-radius-pill: 999px;

  /* Elevation */
  --sb-shadow-card: 0 2px 12px rgba(0, 50, 75, 0.08);
  --sb-shadow-hover: 0 8px 24px rgba(123, 40, 255, 0.14);
  --sb-shadow-drawer: -8px 0 32px rgba(0, 50, 75, 0.18);

  /* Typography */
  --sb-font-body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sb-font-display: 'Baloo 2', 'Nunito Sans', system-ui, sans-serif;

  /* Motion */
  --sb-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
body {
  font-family: var(--sb-font-body);
  color: var(--sb-ink);
  background-color: var(--sb-surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .sb-display {
  font-family: var(--sb-font-display);
  font-weight: 600;
  color: var(--sb-ink);
}

a {
  color: var(--sb-primary);
}

a:hover {
  color: var(--sb-primary-600);
}

/* Visible focus for keyboard users, on everything interactive */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(123, 40, 255, 0.4);
  outline-offset: 2px;
  border-radius: var(--sb-radius-sm);
}

::selection {
  background: var(--sb-primary-100);
  color: var(--sb-primary-700);
}

/* Skip link: visually hidden until keyboard focus */
.sb-skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 2200;
  background: var(--sb-primary);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--sb-radius-pill);
  transition: top 0.15s var(--sb-ease);
}

.sb-skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. COMPONENTS
   -------------------------------------------------------------------------- */

/* --- Section title (successor of .main-subtitle) --- */
.sb-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sb-font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: var(--sb-ink);
  margin-bottom: 1rem;
}

.sb-section-title .fa,
.sb-section-title .bi {
  color: var(--sb-primary);
  background: var(--sb-primary-50);
  border-radius: var(--sb-radius-pill);
  width: 2.2em;
  height: 2.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
}

/* --- Product card --- */
.sb-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s var(--sb-ease), transform 0.2s var(--sb-ease);
}

.sb-product-card:hover {
  box-shadow: var(--sb-shadow-hover);
  transform: translateY(-3px);
}

.sb-product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--sb-surface-alt);
  display: block;
}

.sb-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sb-product-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
  flex-grow: 1;
}

.sb-product-card__brand {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sb-ink-muted);
  text-decoration: none;
}

.sb-product-card__brand:hover {
  color: var(--sb-primary);
  text-decoration: none;
}

.sb-product-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sb-ink);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.sb-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.sb-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

/* --- Price block --- */
.sb-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-price__now {
  font-family: var(--sb-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sb-primary);
}

.sb-price__now--lg {
  font-size: 1.8rem;
}

.sb-price__old {
  font-size: 0.85rem;
  color: var(--sb-ink-muted);
  text-decoration: line-through;
}

/* --- Badges --- */
.sb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--sb-radius-pill);
  line-height: 1.4;
}

.sb-badge--discount {
  background: var(--sb-danger);
  color: #fff;
}

.sb-badge--presale {
  background: var(--sb-primary-100);
  color: var(--sb-primary-700);
}

.sb-badge--out {
  background: var(--sb-surface-alt);
  color: var(--sb-ink-muted);
  border: 1px solid var(--sb-border);
}

.sb-badge--stock {
  background: var(--sb-accent-100);
  color: var(--sb-accent-700);
}

/* Discount badge pinned on card media */
.sb-product-card__flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

/* --- Icon button (cart, wishlist, close…) --- */
.sb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--sb-radius-pill);
  border: none;
  background: var(--sb-primary-50);
  color: var(--sb-primary);
  cursor: pointer;
  transition: background 0.15s var(--sb-ease), color 0.15s var(--sb-ease), transform 0.15s var(--sb-ease);
}

.sb-icon-btn:hover {
  background: var(--sb-primary);
  color: #fff;
  transform: scale(1.06);
}

.sb-icon-btn--solid {
  background: var(--sb-primary);
  color: #fff;
}

.sb-icon-btn--solid:hover {
  background: var(--sb-primary-600);
}

/* --- Quantity stepper --- */
.sb-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-pill);
  overflow: hidden;
  background: var(--sb-surface);
}

.sb-stepper button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--sb-primary);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.sb-stepper button:hover {
  background: var(--sb-primary-50);
}

.sb-stepper button:disabled {
  color: var(--sb-ink-muted);
  cursor: not-allowed;
  background: transparent;
}

.sb-stepper input {
  width: 44px;
  height: 40px;
  border: none;
  text-align: center;
  font-weight: 700;
  color: var(--sb-ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.sb-stepper input::-webkit-outer-spin-button,
.sb-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- Filter chips --- */
.sb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sb-primary-700);
  background: var(--sb-primary-50);
  border: 1px solid var(--sb-primary-100);
  border-radius: var(--sb-radius-pill);
  padding: 6px 12px;
  margin: 2px;
}

.sb-chip__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--sb-radius-pill);
  color: var(--sb-primary-700);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.sb-chip__close:hover {
  background: var(--sb-primary);
  color: #fff;
}

/* --- Skeleton loading --- */
.sb-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--sb-surface-alt);
  border-radius: var(--sb-radius-sm);
  min-height: 1em;
}

.sb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: sb-shimmer 1.4s infinite;
}

@keyframes sb-shimmer {
  100% { transform: translateX(100%); }
}

.sb-skeleton--media { aspect-ratio: 1 / 1; border-radius: var(--sb-radius-lg) var(--sb-radius-lg) 0 0; }
.sb-skeleton--text { height: 0.9em; margin: 4px 0; }
.sb-skeleton--text.w-50 { width: 50%; }
.sb-skeleton--text.w-75 { width: 75%; }

/* --- Top progress bar (replaces the full-screen curtain loader) --- */
.sb-progress-top {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--sb-primary), var(--sb-accent));
  z-index: 2000;
  transition: width 0.3s var(--sb-ease), opacity 0.4s;
}

/* --- Toast --- */
.sb-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sb-ink);
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--sb-ease), transform 0.25s var(--sb-ease);
  z-index: 2100;
  max-width: min(92vw, 480px);
}

.sb-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.sb-toast .fa {
  color: var(--sb-accent);
}

.sb-toast--error {
  background: var(--sb-danger);
}

.sb-toast--error .fa {
  color: #fff;
}

/* --- Rating stars --- */
.sb-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--sb-warning);
  font-size: 0.9rem;
}

.sb-stars .is-empty {
  color: var(--sb-border);
}

/* --- Value props strip (envío / garantía / pago seguro) --- */
.sb-value-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.sb-value-prop {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sb-surface-alt);
  border-radius: var(--sb-radius);
  padding: 14px 16px;
}

.sb-value-prop .fa {
  font-size: 1.3rem;
  color: var(--sb-primary);
  background: var(--sb-primary-100);
  border-radius: var(--sb-radius-pill);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-value-prop strong {
  display: block;
  font-size: 0.9rem;
}

.sb-value-prop span {
  font-size: 0.8rem;
  color: var(--sb-ink-soft);
}

/* --- Horizontal snap rail (product rows, category chips) --- */
.sb-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--sb-primary-100) transparent;
}

.sb-rail > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.sb-rail--products > * {
  width: clamp(170px, 42vw, 240px);
}

/* Edge fade affordance */
.sb-rail-wrap {
  position: relative;
}

.sb-rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 14px;
  width: 40px;
  background: linear-gradient(90deg, transparent, var(--sb-surface));
  pointer-events: none;
}

/* --- Category chip (successor of the bordered circles) --- */
.sb-cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  width: 92px;
}

.sb-cat-chip__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-primary-50);
  border: 2px solid var(--sb-primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.15s var(--sb-ease), box-shadow 0.15s var(--sb-ease), transform 0.15s var(--sb-ease);
}

.sb-cat-chip img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.sb-cat-chip:hover .sb-cat-chip__icon,
.sb-cat-chip.is-active .sb-cat-chip__icon {
  border-color: var(--sb-primary);
  box-shadow: var(--sb-shadow-hover);
  transform: translateY(-2px);
}

.sb-cat-chip__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sb-ink-soft);
  text-align: center;
  line-height: 1.2;
}

/* Brand-filled icon (for white line-art SVGs) */
.sb-cat-chip__icon--brand {
  background: var(--sb-primary);
  border-color: var(--sb-primary-600);
}

/* Larger tile (home "Explora y descubre") */
.sb-cat-chip--lg {
  width: 116px;
}

.sb-cat-chip--lg .sb-cat-chip__icon {
  width: 96px;
  height: 96px;
}

.sb-cat-chip--lg .sb-cat-chip__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sb-cat-chip.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sb-cat-chip:hover .sb-cat-chip__label {
  color: var(--sb-primary);
}

/* --- Mini-cart drawer --- */
.sb-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 50, 75, 0.45);
  opacity: 0;
  transition: opacity 0.25s var(--sb-ease);
  z-index: 1040;
}

.sb-drawer-overlay.is-open {
  opacity: 1;
}

.sb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(92vw, 400px);
  background: var(--sb-surface);
  box-shadow: var(--sb-shadow-drawer);
  transform: translateX(100%);
  transition: transform 0.28s var(--sb-ease);
  z-index: 1050;
  display: flex;
  flex-direction: column;
}

.sb-drawer.is-open {
  transform: translateX(0);
}

.sb-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sb-border);
}

.sb-drawer__title {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sb-drawer__title .fa {
  color: var(--sb-primary);
}

.sb-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 20px;
}

.sb-drawer__foot {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sb-border);
  background: var(--sb-surface-alt);
}

.sb-minicart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sb-border);
}

.sb-minicart-item:last-child {
  border-bottom: none;
}

.sb-minicart-item__img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: var(--sb-radius);
  background: var(--sb-surface-alt);
  overflow: hidden;
}

.sb-minicart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sb-minicart-item__info {
  flex: 1 1 auto;
  min-width: 0;
}

.sb-minicart-item__title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sb-minicart-item__title a {
  color: var(--sb-ink);
  text-decoration: none;
}

.sb-minicart-item__meta {
  font-size: 0.78rem;
  color: var(--sb-ink-muted);
}

.sb-minicart-item__remove {
  border: none;
  background: transparent;
  color: var(--sb-ink-muted);
  font-size: 1.1rem;
  cursor: pointer;
  align-self: flex-start;
  padding: 2px 6px;
}

.sb-minicart-item__remove:hover {
  color: var(--sb-danger);
}

.sb-minicart-empty {
  text-align: center;
  padding: 40px 10px;
  color: var(--sb-ink-muted);
}

body.sb-drawer-open {
  overflow: hidden;
}

/* --- Mobile bottom navigation --- */
.sb-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 985;
  display: flex;
  background: var(--sb-surface);
  border-top: 1px solid var(--sb-border);
  box-shadow: 0 -4px 16px rgba(0, 50, 75, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.sb-mobile-nav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  min-height: 54px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--sb-ink-muted);
  text-decoration: none;
}

.sb-mobile-nav__item:hover,
.sb-mobile-nav__item:focus {
  color: var(--sb-primary);
  text-decoration: none;
}

.sb-mobile-nav__item .fa {
  font-size: 1.15rem;
}

.sb-mobile-nav__icon-wrap {
  position: relative;
  display: inline-block;
}

.sb-mobile-nav__badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

@media (max-width: 767.98px) {
  /* keep page content and floating buttons clear of the bottom nav */
  body:has(.sb-mobile-nav) {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  body:has(.sb-mobile-nav) .float {
    bottom: 88px;
  }

  body:has(.sb-mobile-nav) .scrollToTop {
    bottom: 62px;
  }
}

/* --------------------------------------------------------------------------
   4. LEGACY BRIDGE — restyle existing template/Bootstrap 4 classes so every
   page picks up the new look before its markup is rebuilt in Phase 3.
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  border-radius: var(--sb-radius-pill);
  font-weight: 700;
}

.btn-primary {
  background: var(--sb-primary);
  border-color: var(--sb-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background: var(--sb-primary-600);
  border-color: var(--sb-primary-600);
}

.btn-primary:disabled {
  background: var(--sb-primary-100);
  border-color: var(--sb-primary-100);
  color: var(--sb-primary-600);
}

.btn-outline-secondary {
  color: var(--sb-primary);
  border-color: var(--sb-border);
}

.btn-outline-secondary:hover {
  background: var(--sb-primary);
  border-color: var(--sb-primary);
  color: #fff;
}

.btn-link {
  color: var(--sb-primary);
}

.btn-link:hover {
  color: var(--sb-primary-600);
}

/* Forms */
.form-control {
  border-radius: var(--sb-radius);
  border-color: var(--sb-border);
  color: var(--sb-ink);
}

.form-control:focus {
  border-color: var(--sb-primary);
  box-shadow: 0 0 0 3px rgba(123, 40, 255, 0.15);
}

/* Cards & modals */
.card {
  border-radius: var(--sb-radius-lg);
  border-color: var(--sb-border);
}

.modal-content {
  border-radius: var(--sb-radius-lg);
  border: none;
  box-shadow: var(--sb-shadow-hover);
}

.modal-backdrop.show {
  opacity: 0.55 !important;
}

/* Badges */
.badge {
  border-radius: var(--sb-radius-pill);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge-primary {
  background: var(--sb-primary-100);
  color: var(--sb-primary-700);
}

.badge-secondary {
  background: var(--sb-surface-alt);
  color: var(--sb-ink-muted);
  border: 1px solid var(--sb-border);
}

/* Navbar */
#navi-page {
  box-shadow: 0 1px 12px rgba(0, 50, 75, 0.06);
  border-bottom: 1px solid var(--sb-border) !important;
}

/* Section headings (legacy) */
.main-subtitle {
  font-family: var(--sb-font-display);
  color: var(--sb-ink);
  text-align: left;
}

.main-subtitle .fa {
  color: var(--sb-primary);
}

.main-subtitle .subt-line-divider {
  width: 64px;
  height: 4px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-accent);
}

/* Discount label on legacy cards */
.label-discount {
  background-color: var(--sb-danger);
  font-weight: 800;
}

/* Filter alerts → chip look */
.filter-alert {
  background: var(--sb-primary-50);
  color: var(--sb-primary-700);
  border: 1px solid var(--sb-primary-100);
  font-weight: 700;
}

.filter-alert .clear-filter {
  color: var(--sb-primary-700);
}

/* Category circles: soften the 3pt teal borders site-wide */
.btn-familia,
.btn-extra-opt {
  border-width: 2px !important;
  border-color: var(--sb-primary-100) !important;
  box-shadow: var(--sb-shadow-card);
}

.btn-familia:hover,
.btn-extra-opt:hover {
  border-color: var(--sb-primary) !important;
  box-shadow: var(--sb-shadow-hover);
}

.familia-button-label,
.btn-extra-label {
  color: var(--sb-ink-soft);
  font-weight: 700;
}

/* Sidebar */
.sidebar {
  background-color: var(--sb-primary-700);
}

/* Search */
.searchbar,
.searchbar2 {
  border-color: var(--sb-border);
}

.searchbtn {
  border-color: var(--sb-border) !important;
}

/* Curtain loader: fade fast instead of the 1s curtain-split animation */
.loaded #loader-wrapper {
  transition: all 0.2s ease-out !important;
}

.loaded #loader-wrapper .loader-section.section-left,
.loaded #loader-wrapper .loader-section.section-right {
  transition: all 0.25s ease-out !important;
}

/* Footer */
footer {
  background: var(--sb-surface-alt);
  color: var(--sb-ink-soft);
}

/* --------------------------------------------------------------------------
   5. NAVBAR (.sb-nav) — frosted bar, scroll elevation, single-logo rule
   -------------------------------------------------------------------------- */
#navi-page.sb-nav {
  z-index: 999;
  min-height: 56px;
  padding: 0.35rem 1rem;
  background: rgba(255, 255, 255, 0.94) !important;
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--sb-border) !important;
  box-shadow: none;
  transition: box-shadow 0.25s var(--sb-ease);
}

#navi-page.sb-nav--scrolled {
  box-shadow: 0 4px 20px rgba(0, 50, 75, 0.1);
}

.sb-nav__brand {
  display: flex;
  align-items: center;
  padding: 0;
  margin-right: 1rem;
}

.sb-nav__brand img {
  display: block;
}

/* pages with a hero logo (home, store, cart): navbar brand appears on scroll only */
@media (min-width: 992px) {
  .sb-nav__brand {
    transition: opacity 0.3s var(--sb-ease), transform 0.3s var(--sb-ease);
  }

  .sb-nav--brand-hidden .sb-nav__brand {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
}

#navi-page .nav-link {
  color: var(--sb-ink-soft);
  font-weight: 600;
}

#navi-page .nav-link:hover,
#navi-page .nav-link:focus {
  color: var(--sb-primary);
}

/* cart icon with floating count bubble */
.sb-nav__iconlink {
  padding-right: 1.05rem !important;
}

.sb-nav__icon-wrap {
  position: relative;
  display: inline-block;
}

.sb-nav__badge {
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--sb-surface);
}

/* search */
.sb-nav__search {
  width: 40%;
  max-width: 480px;
}

.sb-nav__search .input-group {
  width: 100%;
}

.sb-nav__search .searchbar {
  height: 42px;
  padding-left: 18px;
  background: var(--sb-surface-alt);
  border: 1px solid var(--sb-border);
  border-right: 0;
  border-radius: var(--sb-radius-pill) 0 0 var(--sb-radius-pill);
}

.sb-nav__search .searchbar:focus {
  background: #fff;
  border-color: var(--sb-primary);
  box-shadow: none;
}

.sb-nav__search .searchbtn {
  width: 52px;
  background: var(--sb-primary) !important;
  color: #fff !important;
  border: 1px solid var(--sb-primary) !important;
  border-radius: 0 var(--sb-radius-pill) var(--sb-radius-pill) 0 !important;
}

.sb-nav__search .searchbtn:hover,
.sb-nav__search .searchbtn:focus {
  background: var(--sb-primary-600) !important;
  border-color: var(--sb-primary-600) !important;
}

/* delivery location chip */
.sb-nav__location {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  margin-left: 6px;
  padding: 6px 14px !important;
  background: var(--sb-primary-50);
  border: 1px solid var(--sb-primary-100);
  border-radius: var(--sb-radius-pill);
  line-height: 1.2;
}

.sb-nav__location:hover {
  border-color: var(--sb-primary);
}

.sb-nav__location .fa {
  color: var(--sb-primary);
  font-size: 1.1rem;
}

.sb-nav__location-label {
  display: none;
}

.sb-nav__location-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sb-ink);
}

.sb-nav__location-text--empty {
  color: var(--sb-primary-700);
}

/* desktop: two-line "Enviar a / DISTRITO · DIRECCIÓN" like top ecommerce bars */
@media (min-width: 992px) {
  .sb-nav__location {
    display: inline-grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    text-align: left;
  }

  .sb-nav__location .fa {
    grid-row: 1 / span 2;
  }

  .sb-nav__location-label {
    display: block;
    grid-column: 2;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--sb-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .sb-nav__location-text {
    grid-column: 2;
  }
}

/* collapsed (mobile/tablet) menu: center the chip, give items air */
@media (max-width: 767.98px) {
  #client-menu {
    padding: 8px 0 12px;
  }

  .sb-nav__location {
    justify-content: center;
    max-width: 92%;
    margin: 8px auto 0;
  }

  .sb-nav__location-text {
    max-width: 70vw;
  }
}

/* account dropdown */
.sb-nav__dropdown {
  padding: 6px;
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow-card);
}

.sb-nav__dropdown .dropdown-item {
  padding: 8px 12px;
  border-radius: var(--sb-radius-sm);
  font-weight: 600;
  color: var(--sb-ink-soft);
}

.sb-nav__dropdown .dropdown-item:hover,
.sb-nav__dropdown .dropdown-item:focus {
  background: var(--sb-primary-50);
  color: var(--sb-primary-700);
}

.sb-nav__dropdown .dropdown-divider {
  border-color: var(--sb-border);
}

/* --------------------------------------------------------------------------
   6. LOCATION MODAL (.sb-locmodal) — confirm/edit delivery location
   -------------------------------------------------------------------------- */
.sb-locmodal {
  border-radius: var(--sb-radius-lg);
  overflow: hidden;
}

.sb-locmodal__dialog {
  max-width: 480px;
}

.sb-locmodal__head {
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sb-border);
}

.sb-locmodal__title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-locmodal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--sb-primary-50);
  color: var(--sb-primary);
  font-size: 1.2rem;
}

.sb-locmodal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.sb-locmodal__subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--sb-ink-muted);
}

.sb-locmodal__close {
  padding: 4px 8px;
  margin: -4px -8px auto auto;
  font-size: 1.6rem;
  color: var(--sb-ink-muted);
  opacity: 1;
}

.sb-locmodal__close:hover {
  color: var(--sb-ink);
}

.sb-locmodal__body {
  padding: 18px 20px;
}

.sb-locmodal__group label {
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--sb-ink-soft);
}

.sb-locmodal__optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--sb-ink-muted);
}

.sb-locmodal__loginbtn {
  padding: 10px;
  background: var(--sb-primary-50);
  color: var(--sb-primary-700);
  border: 1px dashed var(--sb-primary-100);
  border-radius: var(--sb-radius);
  font-weight: 700;
}

.sb-locmodal__loginbtn:hover {
  background: var(--sb-primary-100);
  color: var(--sb-primary-700);
}

.sb-locmodal__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--sb-ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sb-locmodal__divider::before,
.sb-locmodal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sb-border);
}

.sb-locmodal__mapwrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
}

#changelocation_map {
  height: 260px;
  width: 100%;
}

.sb-locmodal__maphint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 14px;
  background: rgba(0, 50, 75, 0.85);
  color: #fff;
  border-radius: var(--sb-radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.sb-locmodal__refselect {
  max-width: 45%;
  flex: 0 0 45%;
}

.sb-locmodal__zip {
  max-width: 200px;
}

.sb-locmodal__zip input[readonly] {
  background: var(--sb-surface-alt);
  color: var(--sb-ink-soft);
  font-weight: 700;
}

.sb-locmodal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--sb-border);
}

.sb-locmodal__save {
  padding: 12px;
  border-radius: var(--sb-radius-pill);
  font-weight: 800;
  background: var(--sb-primary);
  border-color: var(--sb-primary);
}

.sb-locmodal__save:not(:disabled):hover {
  background: var(--sb-primary-600);
  border-color: var(--sb-primary-600);
}

.sb-locmodal__save:disabled {
  background: var(--sb-border);
  border-color: var(--sb-border);
  color: var(--sb-ink-muted);
}

/* selectize controls inside the modal match the rounded inputs */
.sb-locmodal .selectize-input {
  padding: 9px 12px;
  border-color: var(--sb-border);
  border-radius: var(--sb-radius-sm);
}

.sb-locmodal .selectize-input.focus {
  border-color: var(--sb-primary);
  box-shadow: 0 0 0 3px rgba(123, 40, 255, 0.15);
}

/* desktop: cap height, scroll the body under sticky head/foot */
@media (min-width: 576px) {
  .sb-locmodal {
    max-height: calc(100vh - 3.5rem);
  }

  .sb-locmodal__body {
    overflow-y: auto;
  }
}

/* mobile: full-width bottom sheet */
@media (max-width: 575.98px) {
  #locationModal {
    padding: 0 !important;
  }

  #locationModal .modal-dialog.sb-locmodal__dialog {
    display: flex;
    align-items: flex-end;
    max-width: 100%;
    min-height: 100%;
    margin: 0;
  }

  .sb-locmodal {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--sb-radius-lg) var(--sb-radius-lg) 0 0;
  }

  .sb-locmodal__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #changelocation_map {
    height: 210px;
  }

  .sb-locmodal__zip {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   5b. NAVBAR ADDITIONS — hero search reveal, mobile location strip, badge pulse
   -------------------------------------------------------------------------- */

/* pages with an in-page hero search (home, store): navbar search on scroll only */
@media (min-width: 992px) {
  .sb-nav__search {
    transition: opacity 0.3s var(--sb-ease), transform 0.3s var(--sb-ease);
  }

  .sb-nav--search-hidden .sb-nav__search {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
}

/* cart badge pulses when the count changes */
@keyframes sb-badge-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.sb-nav__badge--pulse {
  animation: sb-badge-pulse 0.45s var(--sb-ease);
}

/* mobile location strip: always-visible second row under the bar */
.sb-nav-locstrip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 6px -4px 0;
  padding: 7px 12px;
  background: var(--sb-primary-50);
  border: 1px solid var(--sb-primary-100);
  border-radius: var(--sb-radius-pill);
  color: var(--sb-ink);
  text-decoration: none;
  min-height: 38px;
}

.sb-nav-locstrip:hover,
.sb-nav-locstrip:focus {
  color: var(--sb-ink);
  text-decoration: none;
  border-color: var(--sb-primary);
}

.sb-nav-locstrip .fa-map-marker {
  color: var(--sb-primary);
  font-size: 1.05rem;
}

.sb-nav-locstrip__text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
}

.sb-nav-locstrip__label {
  color: var(--sb-ink-muted);
  font-weight: 600;
}

.sb-nav-locstrip__text--empty {
  color: var(--sb-primary-700);
}

.sb-nav-locstrip__chev {
  color: var(--sb-ink-muted);
}

/* navbar grows a row on mobile: push page content down accordingly */
@media (max-width: 767.98px) {
  body {
    padding-top: 104px !important;
  }
}

/* --------------------------------------------------------------------------
   7. SUPPORT CHAT (.sb-chat) — Tina assistant
   -------------------------------------------------------------------------- */
.sb-chat {
  max-width: 720px;
  margin: 0 auto;
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-lg);
  box-shadow: var(--sb-shadow-card);
  overflow: hidden;
}

.sb-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--sb-surface-alt);
  border-bottom: 1px solid var(--sb-border);
}

.sb-chat__avatar {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.sb-chat__name {
  display: block;
  font-family: var(--sb-font-display);
  font-size: 1.05rem;
  color: var(--sb-ink);
  line-height: 1.1;
}

.sb-chat__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sb-success);
}

.sb-chat__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sb-success-bright);
  animation: sb-chat-dot 2.2s ease-in-out infinite;
}

@keyframes sb-chat-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* botui overrides: full-width, brand bubbles */
.sb-chat .botui-app-container {
  width: 100% !important;
  height: 460px !important;
  margin: 0 !important;
}

.sb-chat .botui-container {
  font-family: var(--sb-font-body);
  font-size: 0.95rem;
  background: transparent;
}

.sb-chat .botui-messages-container {
  padding: 18px 20px;
}

.sb-chat .botui-actions-container {
  padding: 4px 20px 16px;
}

.sb-chat .botui-message-content {
  padding: 10px 16px;
  border-radius: 16px 16px 16px 4px;
  background: var(--sb-surface-alt);
  border: 1px solid var(--sb-border);
  color: var(--sb-ink);
  line-height: 1.45;
}

.sb-chat .botui-message-content.human {
  border-radius: 16px 16px 4px 16px;
  background: var(--sb-primary);
  border-color: var(--sb-primary);
  color: #fff;
}

.sb-chat .botui-message-content.loading {
  background: var(--sb-surface-alt);
  border-color: var(--sb-border);
}

.sb-chat .dot {
  background-color: var(--sb-primary);
}

.sb-chat .botui-actions-buttons-button {
  font-family: var(--sb-font-body);
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--sb-radius-pill);
  background: var(--sb-primary);
  box-shadow: none;
  transition: background 0.2s var(--sb-ease), transform 0.2s var(--sb-ease);
}

.sb-chat .botui-actions-buttons-button:hover,
.sb-chat .botui-actions-buttons-button:focus {
  background: var(--sb-primary-600);
  transform: translateY(-1px);
}

.sb-chat .botui-actions-text-input {
  font-family: var(--sb-font-body);
  color: var(--sb-ink);
  border-bottom: 2px solid var(--sb-primary-100);
}

.sb-chat .botui-actions-text-input:focus {
  border-bottom-color: var(--sb-primary);
}

.sb-chat .botui-actions-text-submit {
  background: var(--sb-primary);
  border-color: var(--sb-primary);
}

@media (max-width: 575.98px) {
  .sb-chat .botui-app-container {
    height: 58vh !important;
  }

  .sb-chat .botui-messages-container,
  .sb-chat .botui-actions-container {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* --------------------------------------------------------------------------
   8. POLISH — image fallback, category states, tap targets
   -------------------------------------------------------------------------- */

/* broken product images swap to a branded placeholder (see head.php script) */
img.sb-img-fallback {
  object-fit: contain;
  background: var(--sb-surface-alt);
}

/* category circles: make disabled ones read as "próximamente", not broken */
.btn-familia.disabled,
.btn-extra-opt.disabled {
  opacity: 0.45;
  filter: saturate(0.4);
  box-shadow: none;
}

.btn-familia.disabled:hover,
.btn-extra-opt.disabled:hover {
  border-color: var(--sb-primary-100) !important;
  box-shadow: none;
}

/* footer links: comfortable tap targets */
footer a {
  display: inline-block;
  padding: 4px 0;
}

/* --------------------------------------------------------------------------
   9. ORDER RESPONSE (.sb-resp) — public incident reply page
   -------------------------------------------------------------------------- */
.sb-resp {
  max-width: 620px;
  margin: 0 auto;
}

.sb-resp__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.sb-resp__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sb-radius-pill);
  font-size: 1.25rem;
}

.sb-resp__icon--warn {
  background: #fff4e5;
  color: var(--sb-warning);
}

.sb-resp__icon--info {
  background: var(--sb-primary-50);
  color: var(--sb-primary);
}

.sb-resp__title {
  font-size: 1.35rem;
  margin: 0 0 4px;
  line-height: 1.2;
}

.sb-resp__sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--sb-ink-muted);
}

.sb-resp__reason {
  background: var(--sb-surface-alt);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.sb-resp__reason-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sb-primary);
  margin-bottom: 4px;
}

.sb-resp__reason p {
  margin: 0;
  color: var(--sb-ink-soft);
}

.sb-resp__lead {
  color: var(--sb-ink-soft);
  margin-bottom: 16px;
}

.sb-resp__optional {
  font-weight: 600;
  color: var(--sb-ink-muted);
}

.sb-resp__done {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8f8f1;
  color: #0b7a55;
  border-radius: var(--sb-radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

.sb-resp__send {
  border-radius: var(--sb-radius-pill);
  font-weight: 800;
  padding: 13px;
  margin-top: 6px;
}

.sb-resp__result {
  margin-top: 14px;
  font-weight: 700;
  font-size: 0.92rem;
}

.sb-resp__result--ok {
  color: var(--sb-success);
}

.sb-resp__result--err {
  color: var(--sb-danger);
}

.sb-resp__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--sb-ink-muted);
  font-size: 0.82rem;
}

.sb-resp__divider::before,
.sb-resp__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--sb-border);
}

.sb-resp__wa {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
  font-weight: 800;
  border-radius: var(--sb-radius-pill);
  padding: 12px;
}

.sb-resp__wa:hover,
.sb-resp__wa:focus {
  background: #1eb457;
  border-color: #1eb457;
  color: #fff;
}

/* --------------------------------------------------------------------------
   10. BK INCIDENT PANEL (.sb-inc) — failed delivery / data request in bkorders
   -------------------------------------------------------------------------- */
.sb-inc {
  border: 1px solid var(--sb-border);
  border-left: 4px solid var(--sb-warning);
  border-radius: var(--sb-radius);
  background: var(--sb-surface-alt);
  padding: 14px 16px;
  margin: 14px 0;
}

.sb-inc--data {
  border-left-color: var(--sb-primary);
}

.sb-inc--answered {
  border-left-color: var(--sb-success);
}

.sb-inc__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.sb-inc__title {
  font-weight: 800;
  color: var(--sb-ink);
  margin: 0;
  font-size: 0.95rem;
}

.sb-inc__meta {
  font-size: 0.75rem;
  color: var(--sb-ink-muted);
}

.sb-inc__body p {
  margin: 0 0 6px;
  color: var(--sb-ink-soft);
  font-size: 0.9rem;
}

.sb-inc__reply {
  background: #fff;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}

.sb-inc__reply-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sb-success);
  margin-bottom: 4px;
}

.sb-inc__data {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.sb-inc__data li {
  padding: 3px 0;
  border-bottom: 1px dashed var(--sb-border);
  color: var(--sb-ink-soft);
}

.sb-inc__data li:last-child {
  border-bottom: 0;
}

.sb-inc__data strong {
  color: var(--sb-ink);
}
