/**
 * Baxi Baxi — Widget 05 · Abas
 * Escopo: .bbx-abas
 */

.bbx-abas {
  --bbx-red: #c8102e;
  --bbx-red2: #e81239;
  --bbx-navy: #152a5c;
  --bbx-text: #5a6472;
  --bbx-line: rgba(21, 42, 92, 0.14);
  --bbx-font: Poppins, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--bbx-navy);
  font-family: var(--bbx-font);
  background: transparent;
}

.bbx-abas .bbx-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.bbx-abas .bbx-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 36px;
}

.bbx-abas .bbx-tab {
  position: relative;
  isolation: isolate;
  appearance: none;
  margin: 0;
  border: 1px solid var(--bbx-line);
  background: #fff;
  color: var(--bbx-navy);
  font: 600 15px/1.25 var(--bbx-font);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.bbx-abas .bbx-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(110deg, #c8102e, #e81239, #ffb3c0, #c8102e);
  background-size: 220% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.bbx-abas .bbx-tab:hover,
.bbx-abas .bbx-tab:focus-visible {
  border-color: transparent;
}

.bbx-abas .bbx-tab:hover::before,
.bbx-abas .bbx-tab:focus-visible::before {
  opacity: 1;
  animation: bbx-abas-border 1.5s linear infinite;
}

.bbx-abas .bbx-tab[aria-selected="true"] {
  background: linear-gradient(90deg, var(--bbx-red), var(--bbx-red2));
  color: #fff;
  border-color: transparent;
}

.bbx-abas .bbx-tab[aria-selected="true"]::before {
  opacity: 0;
  animation: none;
}

.bbx-abas .bbx-tab:focus-visible {
  outline: 2px solid var(--bbx-red);
  outline-offset: 3px;
}

@keyframes bbx-abas-border {
  to {
    background-position: 220% 0;
  }
}

.bbx-abas .bbx-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.bbx-abas .bbx-panel.is-active {
  display: grid;
}

.bbx-abas .bbx-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 28px 26px;
  text-align: left;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(21, 42, 92, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 28px rgba(21, 42, 92, 0.05);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease,
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.bbx-abas.bbx-await .bbx-card:not(.is-in) {
  opacity: 0;
  transform: translateY(12px);
}

.bbx-abas .bbx-card.is-in {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 55ms), 0s, 0s, calc(var(--i, 0) * 55ms);
}

.bbx-abas.bbx-await .bbx-card.bbx-enter:not(.is-in) {
  transform: none;
}

.bbx-abas .bbx-card.bbx-enter,
.bbx-abas .bbx-card.bbx-enter.is-in {
  transition-property: transform, box-shadow, border-color;
  transition-delay: 0s;
}

.bbx-abas .bbx-enter.is-inview {
  animation-fill-mode: backwards;
}

.bbx-abas .bbx-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    transparent 28%,
    rgba(255, 255, 255, 0.55) 46%,
    color-mix(in srgb, var(--bbx-beam, #f5d76e) 7%, transparent) 52%,
    transparent 70%
  );
  opacity: 0.22;
}

.bbx-abas .bbx-card::after {
  content: "";
  position: absolute;
  inset: -40% -65%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.2) 46%,
    color-mix(in srgb, var(--bbx-beam, #f5d76e) 16%, transparent) 50%,
    rgba(255, 255, 255, 0.12) 54%,
    transparent 62%
  );
  transform: translateX(-62%) rotate(8deg);
  opacity: 0;
}

.bbx-abas .bbx-card.is-gleam::after {
  animation: bbx-abas-beam var(--bbx-beam-ms, 1150ms) ease forwards;
}

@keyframes bbx-abas-beam {
  0% {
    opacity: 0;
    transform: translateX(-62%) rotate(8deg);
  }
  38% {
    opacity: 0.42;
  }
  100% {
    opacity: 0;
    transform: translateX(36%) rotate(8deg);
  }
}

.bbx-abas .bbx-card:hover,
.bbx-abas .bbx-card:focus-within {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 28px rgba(21, 42, 92, 0.08);
  border-color: rgba(200, 16, 46, 0.16);
  transition-delay: 0s;
}

.bbx-abas .bbx-ck,
.bbx-abas .bbx-body {
  position: relative;
  z-index: 1;
}

.bbx-abas .bbx-ck {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(200, 16, 46, 0.1);
  color: var(--bbx-red);
  display: grid;
  place-items: center;
  font: 700 16px/1 var(--bbx-font);
}

.bbx-abas .bbx-body {
  min-width: 0;
  flex: 1 1 auto;
}

.bbx-abas .bbx-card h3 {
  margin: 0 0 10px;
  font: 700 18px/1.3 var(--bbx-font);
  color: var(--bbx-navy);
}

.bbx-abas .bbx-card p {
  margin: 0;
  font: 400 15px/1.55 var(--bbx-font);
  color: var(--bbx-text);
}

.bbx-abas[data-bbx-layout="1"] .bbx-panel.is-active,
.bbx-abas[data-bbx-layout="stack"] .bbx-panel.is-active,
.bbx-abas[data-bbx-layout="xs"] .bbx-panel.is-active {
  grid-template-columns: minmax(0, 1fr);
}

.bbx-abas[data-bbx-layout="stack"] .bbx-tab,
.bbx-abas[data-bbx-layout="xs"] .bbx-tab {
  flex: 1 1 100%;
}

.bbx-abas[data-bbx-layout="stack"] .bbx-card,
.bbx-abas[data-bbx-layout="xs"] .bbx-card {
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 20px 24px;
  text-align: center;
}

.bbx-abas[data-bbx-layout="stack"] .bbx-ck {
  flex: 0 0 auto;
}

.bbx-abas[data-bbx-layout="xs"] .bbx-ck {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .bbx-abas:not(.bbx-force-motion) .bbx-card,
  .bbx-abas:not(.bbx-force-motion) .bbx-card::before,
  .bbx-abas:not(.bbx-force-motion) .bbx-card::after,
  .bbx-abas:not(.bbx-force-motion) .bbx-tab,
  .bbx-abas:not(.bbx-force-motion) .bbx-tab::before {
    transition: none !important;
    animation: none !important;
  }

  .bbx-abas:not(.bbx-force-motion) .bbx-card,
  .bbx-abas:not(.bbx-force-motion).bbx-await .bbx-card:not(.is-in),
  .bbx-abas:not(.bbx-force-motion) .bbx-enter {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none !important;
  }

  .bbx-abas:not(.bbx-force-motion) .bbx-card:hover,
  .bbx-abas:not(.bbx-force-motion) .bbx-card:focus-within {
    transform: none;
  }
}
