/* ============================================================
   iGod — Componentes
   ============================================================ */

/* ---------- BOTÕES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  user-select: none;
  white-space: nowrap;
  position: relative;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

/* Sizes */
.btn--sm { font-size: 13px; height: 32px; padding: 0 12px; gap: 6px; }
.btn--md { font-size: 14px; height: 40px; padding: 0 16px; }
.btn--lg { font-size: 16px; height: 48px; padding: 0 20px; }

/* Variants */
.btn--primary {
  background: var(--ember-500);
  color: #FFFFFF;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover:not(:disabled) { background: var(--ember-600); }
.btn--primary:active:not(:disabled)  { background: var(--ember-700); }

.btn--secondary {
  background: transparent;
  color: var(--neutral-900);
  border-color: var(--hairline-strong);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--neutral-900);
  background: var(--neutral-50);
}

.btn--ghost {
  background: transparent;
  color: var(--neutral-700);
}
.btn--ghost:hover:not(:disabled) { background: var(--neutral-100); color: var(--neutral-900); }

.btn--dark {
  background: var(--plum-800);
  color: var(--sand-50);
}
.btn--dark:hover:not(:disabled) { background: var(--plum-900); }

.btn--destructive {
  background: var(--error-500);
  color: #FFFFFF;
}
.btn--destructive:hover:not(:disabled) { background: var(--error-700); }

.btn--full { width: 100%; }

.btn--icon { padding: 0; aspect-ratio: 1; }
.btn--icon.btn--sm { width: 32px; }
.btn--icon.btn--md { width: 40px; }
.btn--icon.btn--lg { width: 48px; }
.btn--circle { border-radius: var(--radius-full); }

.btn__spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- INPUTS ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-800);
}
.field__hint {
  font-size: 12px;
  color: var(--neutral-500);
}
.field__hint--error { color: var(--error-500); }
.field__hint--success { color: var(--success-500); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap__icon {
  position: absolute;
  left: 12px;
  color: var(--neutral-400);
  display: flex;
  pointer-events: none;
}
.input-wrap__icon--right { left: auto; right: 12px; pointer-events: auto; cursor: pointer; }

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--neutral-900);
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--neutral-400); }
.input:hover { border-color: var(--neutral-400); }
.input:focus {
  outline: none;
  border-color: var(--ember-500);
  box-shadow: var(--shadow-focus);
}
.input--icon-left { padding-left: 40px; }
.input--icon-right { padding-right: 40px; }
.input--error { border-color: var(--error-500); }
.input--error:focus { box-shadow: 0 0 0 3px rgba(184,58,58,.22); }
.input--success { border-color: var(--success-500); }
.input:disabled {
  background: var(--neutral-100);
  color: var(--neutral-500);
  cursor: not-allowed;
}

textarea.input {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--neutral-500);
  border-bottom: 1.5px solid var(--neutral-500);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select.input {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}

/* Checkbox + Radio */
.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--neutral-800);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box {
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 1.5px solid var(--neutral-400);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.choice__box--radio { border-radius: 50%; }
.choice:hover .choice__box { border-color: var(--neutral-700); }
.choice input:checked + .choice__box {
  background: var(--ember-500);
  border-color: var(--ember-500);
}
.choice input:checked + .choice__box.choice__box--radio { background: var(--bg-elevated); border-color: var(--ember-500); border-width: 6px; }
.choice__box svg { opacity: 0; transition: opacity var(--dur-fast); color: white; }
.choice input:checked + .choice__box svg { opacity: 1; }

/* Toggle */
.toggle {
  position: relative;
  width: 40px;
  height: 24px;
  background: var(--neutral-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  left: 2px; top: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
  transition: transform var(--dur-fast) var(--ease-out);
}
.toggle.is-on { background: var(--ember-500); }
.toggle.is-on::after { transform: translateX(16px); }

/* ---------- TAGS / BADGES ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--neutral-700);
  white-space: nowrap;
}
.tag--cat-food { background: #FBE9D5; color: #8A4516; }
.tag--cat-svc  { background: #E3ECF3; color: var(--info-700); }
.tag--cat-tech { background: #ECE3F3; color: #4F2A6E; }
.tag--cat-edu  { background: #E8F3EC; color: var(--success-700); }
.tag--cat-cause{ background: #FBE3E3; color: var(--error-700); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.badge--new       { background: var(--ember-500); color: white; }
.badge--verified  { background: var(--success-500); color: white; }
.badge--featured  { background: var(--plum-800); color: var(--sand-50); }
.badge--pending   { background: var(--warning-50); color: var(--warning-700); }
.badge--active    { background: var(--success-50); color: var(--success-700); }

.badge--notif {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ember-500);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--neutral-900);
}
.price-tag__currency { font-size: 12px; color: var(--neutral-500); }
.price-tag__value { font-size: 20px; }
.price-tag__cents { font-size: 12px; color: var(--neutral-500); }

/* ---------- AVATAR ---------- */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--plum-200);
  color: var(--plum-800);
  font-family: var(--font-display);
  font-weight: 600;
  overflow: visible;
  flex-shrink: 0;
}
.avatar__img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar--sm { width: 24px; height: 24px; font-size: 11px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar--xl { width: 96px; height: 96px; font-size: 32px; }

.avatar__verify {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 38%;
  aspect-ratio: 1;
  background: var(--ember-500);
  border-radius: 50%;
  border: 2px solid var(--bg-elevated);
  display: grid;
  place-items: center;
  color: white;
}
.avatar--sm .avatar__verify { border-width: 1.5px; }

.avatar__status {
  position: absolute;
  right: 0; bottom: 0;
  width: 28%;
  aspect-ratio: 1;
  background: var(--success-500);
  border-radius: 50%;
  border: 2px solid var(--bg-elevated);
}
.avatar__status--off { background: var(--neutral-300); }

/* ---------- DIVIDERS ---------- */
.divider {
  height: 1px;
  background: var(--hairline);
  border: none;
}
.divider--with-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--neutral-500);
  letter-spacing: 0.04em;
  background: transparent;
  height: auto;
}
.divider--with-label::before,
.divider--with-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ============================================================
   MOLÉCULAS
   ============================================================ */

/* ---------- PRODUCT CARD ---------- */
.product {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.product:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.product__media {
  aspect-ratio: 1;
  background: var(--sand-200);
  position: relative;
  overflow: hidden;
}
.product__media-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--plum-800);
  opacity: .25;
}
.product__badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.product__fav {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  color: var(--neutral-700);
  z-index: 2;
  backdrop-filter: blur(6px);
}
.product__fav.is-fav { color: var(--ember-500); }
.product__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product__cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neutral-500);
}
.product__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-900);
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.product__company {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--neutral-500);
}
.product__price {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--neutral-100) 0%,
    var(--neutral-200) 50%,
    var(--neutral-100) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---------- COMPANY CARD ---------- */
.company {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.company__logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}
.company__body { flex: 1; min-width: 0; }
.company__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.company__meta {
  font-size: 12px;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* ---------- CATEGORY ---------- */
.cat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
  min-width: 120px;
}
.cat-card:hover { transform: translateY(-2px); }
.cat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.cat-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-900);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--neutral-800);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip:hover { background: var(--neutral-200); }
.chip.is-active { background: var(--plum-800); color: var(--sand-50); }
.chip--outline {
  background: transparent;
  border-color: var(--hairline-strong);
}

/* ---------- TOAST ---------- */
.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--neutral-900);
  color: var(--sand-50);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-high);
  font-size: 14px;
  min-width: 280px;
  max-width: 380px;
}
.toast__icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.toast__body { flex: 1; }
.toast__title { font-weight: 600; }
.toast__desc { color: rgba(255,252,246,.7); margin-top: 2px; font-size: 13px; }
.toast--success .toast__icon { color: var(--success-500); }
.toast--error .toast__icon { color: var(--error-500); }
.toast--warning .toast__icon { color: var(--warning-500); }
.toast--info .toast__icon { color: var(--ember-300); }
