/* Utilidades globales */
.hidden {
  display: none !important;
}

.text-right {
  text-align: right;
}

.m-auto {
  margin: auto;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.p-sm {
  padding: var(--space-sm);
}

.rounded {
  border-radius: var(--radius-md);
}

.shadow {
  box-shadow: var(--shadow-sm);
}

.transition-base {
  transition: all 180ms ease;
}

.loader-container {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(19, 41, 75, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader--inline {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

.loader-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton for product card */
.skeleton-card {
  background: linear-gradient(90deg, rgba(19,41,75,0.03) 0%, rgba(19,41,75,0.06) 50%, rgba(19,41,75,0.03) 100%);
  border-radius: var(--radius-md);
  min-height: 220px;
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
}

.skeleton-card .skeleton-row {
  border-radius: var(--radius-sm);
  background: rgba(19, 41, 75, 0.08);
}

.skeleton-card .skeleton-image {
  width: 100%;
  min-height: 140px;
}

.skeleton-card .skeleton-title {
  width: 60%;
  height: 16px;
}

.skeleton-card .skeleton-text {
  width: 100%;
  height: 12px;
}

.skeleton-card .skeleton-text.short {
  width: 70%;
}

.skeleton-card .skeleton-price {
  width: 50%;
  height: 18px;
}

.skeleton-card .skeleton-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.skeleton-card .skeleton-buttons::before,
.skeleton-card .skeleton-buttons::after {
  content: '';
  display: block;
  height: 38px;
  background: rgba(19, 41, 75, 0.08);
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .loader,
  .button--loading::after {
    animation: none;
  }
}

.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* small spinner for button icon uses existing loader styles but smaller */
.btn-spinner {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}
