/* ══════════════════════════════════════════════════════════
   Tiendas Colombia — Frontend Styles
   Premium grid layout with Colombian-inspired design
   ══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────── */
.tiendas-colombia-wrapper {
  --tc-primary: #1a2744;
  --tc-primary-light: #2d4a7a;
  --tc-accent: #f2c94c;
  --tc-accent-hover: #e0b830;
  --tc-whatsapp: #25d366;
  --tc-whatsapp-hover: #1ebe5d;
  --tc-bg: #f7f8fa;
  --tc-card-bg: #ffffff;
  --tc-text: #1a2744;
  --tc-text-muted: #6b7a90;
  --tc-border: #e2e6ec;
  --tc-radius: 0;
  --tc-radius-sm: 8px;
  --tc-shadow:
    0 1px 3px rgba(26, 39, 68, 0.06), 0 4px 12px rgba(26, 39, 68, 0.04);
  --tc-shadow-hover:
    0 4px 12px rgba(26, 39, 68, 0.1), 0 12px 28px rgba(26, 39, 68, 0.08);
  --tc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  position: relative;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: var(--tc-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.tiendas-colombia-wrapper *,
.tiendas-colombia-wrapper *::before,
.tiendas-colombia-wrapper *::after {
  box-sizing: border-box;
}

/* ── Filters ────────────────────────────────────────────── */
.tc-filters {
  background: var(--tc-card-bg);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--tc-shadow);
}

.tc-filters__inner {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.tc-filters__group {
  flex: 1;
  min-width: 200px;
}

.tc-filters__group--btn {
  flex: 0 0 auto;
  min-width: auto;
}

.tc-filters__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tc-text-muted);
  margin-bottom: 8px;
}

.tc-filters__select-wrap {
  position: relative;
}

.tc-filters__select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  background-color: var(--tc-bg);
  font-size: 14px;
  font-weight: 500;
  color: var(--tc-text);
  cursor: pointer;
  transition:
    border-color var(--tc-transition),
    box-shadow var(--tc-transition);
  line-height: 1.5;
}

.tc-filters__select:hover {
  border-color: var(--tc-primary-light);
}

.tc-filters__select:focus {
  outline: none;
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1);
}

.tc-filters__select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tc-filters__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--tc-text-muted);
}

.tc-filters__clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  background: var(--tc-bg);
  color: var(--tc-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tc-transition);
  white-space: nowrap;
}

.tc-filters__clear:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fdf2f2;
}

.tc-filters__count {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--tc-border);
  font-size: 13px;
  color: var(--tc-text-muted);
}

.tc-filters__count span {
  font-weight: 700;
  color: var(--tc-primary);
}

/* ── Grid ───────────────────────────────────────────────── */
.tc-grid {
  display: grid;
  gap: 24px;
}

.tc-grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.tc-grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.tc-grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .tc-grid--cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .tc-grid--cols-3,
  .tc-grid--cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tc-filters__inner {
    flex-direction: column;
  }

  .tc-filters__group {
    min-width: 100%;
  }

  .tc-filters {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .tc-grid--cols-2,
  .tc-grid--cols-3,
  .tc-grid--cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Card ───────────────────────────────────────────────── */
.tc-card {
  background: var(--tc-card-bg);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  overflow: hidden;
  box-shadow: var(--tc-shadow);
  transition:
    transform var(--tc-transition),
    box-shadow var(--tc-transition);
  display: flex;
  flex-direction: column;
  animation: tcFadeIn 0.4s ease both;
}

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

@keyframes tcFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation */
.tc-card:nth-child(1) {
  animation-delay: 0.02s;
}
.tc-card:nth-child(2) {
  animation-delay: 0.06s;
}
.tc-card:nth-child(3) {
  animation-delay: 0.1s;
}
.tc-card:nth-child(4) {
  animation-delay: 0.14s;
}
.tc-card:nth-child(5) {
  animation-delay: 0.18s;
}
.tc-card:nth-child(6) {
  animation-delay: 0.22s;
}
.tc-card:nth-child(7) {
  animation-delay: 0.26s;
}
.tc-card:nth-child(8) {
  animation-delay: 0.3s;
}
.tc-card:nth-child(9) {
  animation-delay: 0.34s;
}
.tc-card:nth-child(10) {
  animation-delay: 0.38s;
}
.tc-card:nth-child(11) {
  animation-delay: 0.42s;
}
.tc-card:nth-child(12) {
  animation-delay: 0.46s;
}

/* Card image */
.tc-card__image {
  position: relative;
  width: 100%;
  padding-top: 62%;
  overflow: hidden;
  background: linear-gradient(135deg, #e8ecf1 0%, #d5dce6 100%);
}

.tc-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc-card:hover .tc-card__image img {
  transform: scale(1.05);
}

.tc-card__placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0bec5;
}

/* Card body */
.tc-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.tc-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--tc-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tc-card__meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--tc-text-muted);
  line-height: 1.4;
}

.tc-card__meta svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--tc-primary-light);
}

/* WhatsApp button */
.tc-card__whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 16px;
  background: var(--tc-whatsapp);
  color: #ffffff !important;
  border-radius: var(--tc-radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition:
    background var(--tc-transition),
    transform var(--tc-transition);
  cursor: pointer;
  border: none;
}

.tc-card__whatsapp:hover {
  background: var(--tc-whatsapp-hover);
  transform: translateY(-1px);
  color: #ffffff !important;
  text-decoration: none !important;
}

.tc-card__whatsapp:active {
  transform: translateY(0);
}

.tc-card__whatsapp svg {
  flex-shrink: 0;
}

/* ── Pagination ─────────────────────────────────────────── */
.tc-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.tc-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  background: var(--tc-card-bg);
  color: var(--tc-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tc-transition);
}

.tc-pagination__btn:hover {
  border-color: var(--tc-primary-light);
  color: var(--tc-primary);
  background: var(--tc-bg);
}

.tc-pagination__btn--active {
  background: var(--tc-primary) !important;
  border-color: var(--tc-primary) !important;
  color: #fff !important;
  cursor: default;
}

/* ── Empty state ────────────────────────────────────────── */
.tc-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--tc-text-muted);
}

.tc-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.tc-empty p {
  font-size: 15px;
  margin: 0;
}

/* ── Loading ────────────────────────────────────────────── */
.tc-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--tc-radius);
  backdrop-filter: blur(2px);
}

.tc-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--tc-border);
  border-top-color: var(--tc-primary);
  border-radius: 50%;
  animation: tcSpin 0.7s linear infinite;
}

@keyframes tcSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Results container ──────────────────────────────────── */
.tc-results {
  min-height: 100px;
}
