/* ==========================================================================
   Chase Design System — Components
   Botões, cards, badges, formulários e componentes reutilizáveis.
   ========================================================================== */

/* ── Reset base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--chase-text);
  background-color: var(--chase-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Tipografia global ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--chase-text);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-top: 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

a {
  color: var(--chase-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--chase-blue-dark);
}

a:focus-visible {
  outline: 2px solid var(--chase-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Container ── */
.chase-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.chase-container--narrow {
  max-width: var(--container-narrow);
}

.chase-container--wide {
  max-width: var(--container-wide);
}

/* ── Botões ── */
.chase-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.chase-btn:focus-visible {
  outline: 2px solid var(--chase-blue);
  outline-offset: 2px;
}

/* Primary */
.chase-btn--primary {
  background-color: var(--chase-blue);
  color: var(--chase-white);
  border-color: var(--chase-blue);
}

.chase-btn--primary:hover {
  background-color: var(--chase-blue-dark);
  border-color: var(--chase-blue-dark);
  color: var(--chase-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.chase-btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary (outline) */
.chase-btn--secondary {
  background-color: transparent;
  color: var(--chase-blue);
  border-color: var(--chase-blue);
}

.chase-btn--secondary:hover {
  background-color: var(--chase-blue);
  color: var(--chase-white);
}

/* Gold accent */
.chase-btn--gold {
  background-color: var(--chase-gold);
  color: var(--chase-white);
  border-color: var(--chase-gold);
}

.chase-btn--gold:hover {
  background-color: var(--chase-gold-dark);
  border-color: var(--chase-gold-dark);
  color: var(--chase-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ghost */
.chase-btn--ghost {
  background-color: transparent;
  color: var(--chase-text);
  border-color: transparent;
}

.chase-btn--ghost:hover {
  background-color: rgba(var(--chase-text-rgb), 0.05);
}

/* Sizes */
.chase-btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
}

.chase-btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-base);
}

/* ── Cards de produto ── */
.chase-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--chase-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.chase-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.chase-product-card__image-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  /* Branco, e nao --chase-gray-100. O card da LOJA ja e branco
     (li.product no woocommerce.css), entao o cinza aqui fazia os dois markups
     de produto mostrarem fundos diferentes para a mesma foto.

     A cor esta cravada no seletor em vez de virar branco no token: o
     --chase-gray-100 tambem pinta o hover do .chase-quantity__btn, o hover do
     fechar do carrinho lateral e o botao do painel dele. Branco no token
     deixaria os dois hovers invisiveis. */
  background-color: var(--chase-white);
}

.chase-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-slow);
  padding: var(--space-4);
}

.chase-product-card:hover .chase-product-card__image {
  transform: scale(1.05);
}

.chase-product-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: var(--space-4);
  gap: var(--space-2);
}

.chase-product-card__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--chase-text);
  line-height: var(--line-height-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

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

.chase-product-card__title a:hover {
  color: var(--chase-blue);
}

.chase-product-card__price {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--chase-text);
  margin-top: auto;
}

/* Oferta no card da HOME. Mesmo tratamento do card da loja e da pagina de
   produto: herda tudo do preco normal e mantem so o risco no antigo.
   Sao TRES markups de preco no projeto -- este, o `li.product` da loja em
   woocommerce.css e o `div.product` da pagina de produto. Mexer num sem os
   outros deixa a loja inconsistente, e foi o que aconteceu em 31/08/2026. */
.chase-product-card__price del {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-decoration: line-through;
  opacity: 1;
}

.chase-product-card__price ins {
  text-decoration: none;
  font-size: inherit;
  font-weight: inherit;
  /* Verde SO no valor novo, a pedido do proprietario em 31/08/2026. O antigo
     fica preto, com o risco. O simbolo R$ nao tem regra propria em nenhum CSS
     nosso -- ele mora num <span class="woocommerce-Price-currencySymbol"> dentro
     do <ins>, entao herda esta cor e fica verde junto, que era o pedido. */
  color: var(--chase-success);
}

.chase-product-card__actions {
  padding: 0 var(--space-4) var(--space-4);
}

.chase-product-card__add-to-cart {
  width: 100%;
  /* .chase-btn usa white-space: nowrap e padding lateral de --space-6.
     Nos cards estreitos do grid o rótulo "Adicionar ao carrinho" não cabe
     em uma linha e transborda da caixa. Aqui liberamos a quebra e
     reduzimos o respiro lateral. */
  white-space: normal;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  line-height: 1.25;
}

/* ── Badges ── */
.chase-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.chase-badge--sale {
  background-color: var(--chase-error);
  color: var(--chase-white);
}

.chase-badge--new {
  background-color: var(--chase-blue);
  color: var(--chase-white);
}

.chase-badge--out-of-stock {
  background-color: var(--chase-gray-500);
  color: var(--chase-white);
}

.chase-badge--preorder {
  background-color: var(--chase-gold);
  color: var(--chase-white);
}

.chase-badge--demo {
  background-color: var(--chase-warning);
  color: var(--chase-text);
}

/* Posição do badge sobre o card.

   A tarja encosta na borda superior esquerda em vez de flutuar 12px para
   dentro. O card tem `border-radius: var(--radius-lg)` e `overflow: hidden`,
   então uma tarja em formato de pílula colada em 0,0 teria o canto externo
   fatiado pelo arredondamento — sobraria um corte torto.

   A saída é inverter a responsabilidade: a tarja fica com o canto externo
   QUADRADO e deixa o próprio card recortá-lo. O `overflow: hidden` do card
   arredonda a tarja exatamente no mesmo raio da moldura, então os dois cantos
   coincidem sem precisar repetir o valor do raio em dois lugares.

   O `gap: 0` empilha as tarjas coladas quando há mais de uma (em oferta e
   esgotado ao mesmo tempo): elas formam uma coluna única, e só a última leva
   o arredondamento interno. */
.chase-product-card__badges {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 2;
}

.chase-product-card__badges .chase-badge {
  border-radius: 0 0 var(--radius-md) 0;
}

.chase-product-card__badges .chase-badge:not(:last-child) {
  border-radius: 0;
}

/* ── Formulários ── */
.chase-input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--chase-text);
  background-color: var(--chase-white);
  border: 1px solid var(--chase-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chase-input:focus {
  outline: none;
  border-color: var(--chase-blue);
  box-shadow: 0 0 0 3px rgba(var(--chase-blue-rgb), 0.15);
}

.chase-input::placeholder {
  color: var(--chase-gray-400);
}

.chase-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--chase-text);
  margin-bottom: var(--space-2);
}

/* ── Select ── */
.chase-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825a.7.7 0 01-.5-.2L2.3 5.4a.7.7 0 111-1L6 7.125l2.7-2.7a.7.7 0 111 1L6.5 8.625a.7.7 0 01-.5.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 12px;
  padding-right: var(--space-10);
}

/* ── Skeleton loader ── */
.chase-skeleton {
  background: linear-gradient(90deg, var(--chase-gray-200) 25%, var(--chase-gray-100) 50%, var(--chase-gray-200) 75%);
  background-size: 200% 100%;
  animation: chase-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes chase-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Estado vazio ── */
.chase-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-4);
  text-align: center;
}

.chase-empty-state__icon {
  font-size: 3rem;
  color: var(--chase-gray-300);
  margin-bottom: var(--space-4);
}

.chase-empty-state__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--chase-text);
  margin-bottom: var(--space-2);
}

.chase-empty-state__description {
  font-size: var(--font-size-base);
  color: var(--chase-gray-500);
  max-width: 400px;
}

/* ── Pendente de conteúdo (marcador visual) ── */
.chase-pending-content {
  position: relative;
  border: 2px dashed var(--chase-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  background-color: rgba(var(--chase-bg-rgb), 0.5);
}

.chase-pending-content::before {
  content: 'PENDENTE_DE_CONTEUDO';
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--chase-gold-dark);
  background-color: var(--chase-gold-light);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.chase-pending-content__text {
  font-size: var(--font-size-sm);
  color: var(--chase-gray-500);
}

/* ── Breadcrumbs ── */
.chase-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-size: var(--font-size-sm);
  color: var(--chase-gray-500);
}

.chase-breadcrumbs a {
  color: var(--chase-gray-500);
}

.chase-breadcrumbs a:hover {
  color: var(--chase-blue);
}

.chase-breadcrumbs__separator {
  color: var(--chase-gray-300);
}

.chase-breadcrumbs__current {
  color: var(--chase-text);
  font-weight: var(--font-weight-medium);
}

/* ── Section titles ── */
.chase-section-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--chase-text);
  margin-bottom: var(--space-8);
  position: relative;
  padding-bottom: var(--space-3);
}

.chase-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background-color: var(--chase-gold);
  border-radius: var(--radius-full);
}

.chase-section-title--center {
  text-align: center;
}

.chase-section-title--center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ── Alertas / Mensagens ── */
.chase-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.chase-alert--info {
  background-color: var(--chase-info-light);
  color: var(--chase-blue-dark);
  border: 1px solid rgba(var(--chase-blue-rgb), 0.2);
}

.chase-alert--success {
  background-color: var(--chase-success-light);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.chase-alert--warning {
  background-color: var(--chase-warning-light);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.chase-alert--error {
  background-color: var(--chase-error-light);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ── Quantity selector ── */
.chase-quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--chase-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chase-quantity__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--chase-text);
  transition: background-color var(--transition-fast);
}

.chase-quantity__btn:hover {
  background-color: var(--chase-gray-100);
}

.chase-quantity__input {
  width: 48px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--chase-border);
  border-right: 1px solid var(--chase-border);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--chase-text);
}

.chase-quantity__input:focus {
  outline: none;
  background-color: var(--chase-blue-lightest);
}
