/* 06-buttons.css */
/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: center;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-family: var(--font-base);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-spring);
  white-space: nowrap;
  user-select: none;
}

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

.btn:active { transform: scale(.97); }

/* Disabled buttons keep their colour so the user sees them, only the
   opacity and cursor change to signal the inactive state. Without this
   rule the browser default greys-out the button so heavily that
   `.js-submit-review` (Publicar) reads as "missing" on the place
   detail page. */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
}

.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--fs-md);
}

.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-xs);
}

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

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

.btn--primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-md);
}





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

.btn--outline:hover {
  background: var(--primary);
  color: var(--text-on-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

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

.btn--white:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

.btn--outline-white {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,.7);
}

.btn--outline-white:hover {
  background: rgba(255,255,255,.15);
  color: #ffffff;
}





/* ============================================================
   Profile badges grid (rendered on /profile/)
   ============================================================ */



.profile-badges__count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.profile-badges__grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Collapsible per-category section */
.badge-section {
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
}
.badge-section__head::-webkit-details-marker { display: none; }
.badge-section__head::after {
  content: "▾";
  margin-left: var(--sp-3);
  transition: transform 200ms ease;
}
.badge-section[open] .badge-section__head::after { transform: rotate(180deg); }
.badge-section__count { font-size: var(--fs-sm); color: var(--text-muted); }
.badge-section__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
@media (min-width: 720px) {
  .badge-section__grid { grid-template-columns: repeat(4, 1fr); }
}
.profile-badges__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: var(--sp-4);
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.badge-card.is-earned {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.badge-card.is-locked {
  opacity: 0.65;
}
.badge-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  flex-shrink: 0;
}
.badge-card.is-earned .badge-card__icon {
  background: var(--primary);
  color: white;
}
   /* covered by inline <svg use> */

.badge-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.badge-card__desc { display: none; }   /* compact card omits the description */
.badge-card__progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-top: 4px;
}
.badge-card__progress-fill {
  display: block;
  height: 6px;
  background: var(--primary);
}
.badge-card__progress-text {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}


/* Badge unlock celebration toast (fixed, top-right, slides in). */
.badge-unlocked-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--primary);
  color: white;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transform: translateX(140%);
  transition: transform 320ms cubic-bezier(.16,.84,.44,1);
  max-width: 380px;
}
.badge-unlocked-toast.is-visible { transform: translateX(0); }
.badge-unlocked-toast__icon { font-size: 24px; }
.badge-unlocked-toast__title { display: block; font-size: 12px; font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-unlocked-toast__name { font-size: 15px; font-weight: 600; }

/* -----------------------------------------------------------------------------
   4. BUTTONS
   --------------------------------------------------------------------------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: .85rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-base);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base),
              border-color var(--transition-base), transform var(--transition-base),
              box-shadow var(--transition-base);
  white-space: nowrap;
}
.ds-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.ds-btn--primary {
  background: var(--primary);
  color: var(--text-on-primary);
}
.ds-btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.ds-btn--ghost:hover {
  border-color: var(--text);
  background: var(--surface);
}

.ds-btn--invert {
  background: var(--surface);
  color: var(--text);
}
.ds-btn--invert:hover {
  background: var(--text);
  color: #ffffff;
}

.ds-btn--link {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: .25rem 0;
  border-radius: 0;
}
.ds-btn--link::after {
  content: "→";
  display: inline-block;
  transition: transform var(--transition-base);
}
.ds-btn--link:hover::after { transform: translateX(4px); }

.ds-btn--lg {
  padding: 1rem 2rem;
  font-size: var(--fs-md);
}

/* -----------------------------------------------------------------------------
   5. CHIPS / BADGES
   --------------------------------------------------------------------------- */
.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: .35rem .75rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
}
.ds-chip--primary  { background: var(--primary);   color: var(--text-on-primary);  border-color: transparent; }
.ds-chip--accent   { background: var(--accent);    color: var(--text-on-accent);   border-color: transparent; }
.ds-chip--overlay  { background: rgba(255,255,255,.92); color: var(--text); backdrop-filter: blur(6px); border-color: transparent; }

