/* ============================================================
   AGX DIRECTORIO DE PROVEEDORES · Estilos frontend
   Idéntico al widget original. Scoped a .agx-dir-wrapper
   ============================================================ */

/* ====== RESET LOCAL (scoped al wrapper) ====== */
.agx-dir-wrapper *,
.agx-dir-wrapper *::before,
.agx-dir-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ====== VARIABLES DE MARCA ====== */
.agx-dir-wrapper {
  --agx-deep: #013E48;
  --agx-mid: #0B6571;
  --agx-deep-dark: #002F36;
  --agx-beige: #C7A900;
  --agx-beige-light: #F8F5E6;
  --agx-beige-soft: #E9DB8D;
  --agx-white: #ffffff;
  --agx-text: #052F36;
  --agx-text-soft: rgba(1, 62, 72, 0.72);
  --agx-text-mute: rgba(1, 62, 72, 0.5);

  --agx-glass-bg: rgba(255, 255, 255, 0.55);
  --agx-glass-bg-hover: rgba(255, 255, 255, 0.78);
  --agx-glass-border: rgba(1, 62, 72, 0.12);
  --agx-glass-border-strong: rgba(1, 62, 72, 0.26);

  --agx-radius-lg: 22px;
  --agx-radius-md: 16px;
  --agx-radius-sm: 12px;
  --agx-radius-pill: 999px;

  --agx-shadow-card: 0 8px 32px rgba(1, 62, 72, 0.10), 0 2px 8px rgba(1, 62, 72, 0.06);
  --agx-shadow-card-hover: 0 18px 50px rgba(1, 62, 72, 0.18), 0 4px 14px rgba(1, 62, 72, 0.10);

  --agx-ease: cubic-bezier(0.22, 1, 0.36, 1);

  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  width: 100%;
  padding: 56px 24px;
  overflow: hidden;
  isolation: isolate;
  color: var(--agx-text);
  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(1, 62, 72, 0.13), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(199, 169, 0, 0.09), transparent 62%),
    linear-gradient(135deg, #F7FAF9 0%, #EEF6F5 52%, #F8F4E4 100%);
}

/* ====== ORBES ATMOSFÉRICOS (decorativos, GPU only) ====== */
.agx-dir-wrapper::before,
.agx-dir-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  will-change: transform;
  pointer-events: none;
}
.agx-dir-wrapper::before {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--agx-deep), transparent 70%);
  top: -120px; left: -100px;
  animation: agxFloatA 18s ease-in-out infinite;
}
.agx-dir-wrapper::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--agx-beige), transparent 70%);
  bottom: -100px; right: -80px;
  opacity: 0.18;
  animation: agxFloatB 22s ease-in-out infinite;
}
@keyframes agxFloatA {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(40px, 60px) scale(1.08); }
}
@keyframes agxFloatB {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-50px, -40px) scale(1.05); }
}

/* ====== CAPA DE CONTENIDO ====== */
.agx-dir-wrapper > * { position: relative; z-index: 1; }

/* ====== HEADER ====== */
.agx-dir-header {
  text-align: center;
  margin-bottom: 36px;
}
.agx-dir-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.28em;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--agx-deep);
  background: rgba(1, 62, 72, 0.07);
  border: 1px solid rgba(199, 169, 0, 0.38);
  padding: 7px 16px;
  border-radius: var(--agx-radius-pill);
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.agx-dir-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--agx-deep) 0%, var(--agx-mid) 60%, var(--agx-deep-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.agx-dir-subtitle {
  font-size: 15px;
  font-weight: 300;
  color: var(--agx-text-soft);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ====== BARRA DE BÚSQUEDA ====== */
.agx-dir-searchbar {
  max-width: 640px;
  margin: 28px auto 0;
  position: relative;
}
.agx-dir-search-input {
  width: 100%;
  height: 56px;
  padding: 0 56px 0 54px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--agx-text);
  background: var(--agx-glass-bg);
  border: 1px solid var(--agx-glass-border);
  border-radius: 20px !important;
  outline: none;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: all 0.3s var(--agx-ease);
  letter-spacing: 0.01em;
}
.agx-dir-search-input::placeholder { color: var(--agx-text-mute); font-weight: 300; }
.agx-dir-search-input:focus {
  background: var(--agx-glass-bg-hover);
  border-color: var(--agx-mid);
  box-shadow: 0 0 0 4px rgba(1, 62, 72, 0.14), 0 12px 32px rgba(1, 62, 72, 0.10);
}
.agx-dir-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--agx-mid);
  pointer-events: none;
  opacity: 0.85;
}
.agx-dir-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(1, 62, 72, 0.10);
  color: var(--agx-deep);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s var(--agx-ease);
}
.agx-dir-search-clear:hover { background: rgba(1, 62, 72, 0.20); transform: translateY(-50%) scale(1.08); }
.agx-dir-search-clear.is-visible { display: inline-flex; }

/* ====== TOOLBAR (filtros + vista) ====== */
.agx-dir-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px auto 22px;
  max-width: 1200px;
}
.agx-dir-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.agx-dir-chip {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--agx-text-soft);
  background: var(--agx-glass-bg);
  border: 1px solid var(--agx-glass-border);
  padding: 9px 18px;
  border-radius: var(--agx-radius-pill);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s var(--agx-ease);
  white-space: nowrap;
}
.agx-dir-chip:hover {
  background: var(--agx-glass-bg-hover);
  color: #013E48;
  transform: translateY(-1px);

}
.agx-dir-chip.is-active {
  background: linear-gradient(135deg, var(--agx-deep) 0%, var(--agx-mid) 100%);
  color: var(--agx-white);
  border-color: rgba(199, 169, 0, 0.55);
  box-shadow: 0 6px 18px rgba(1, 62, 72, 0.24);
  font-weight: 600;
}
.agx-dir-chip-count {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  background: rgba(1, 62, 72, 0.14);
  border-radius: var(--agx-radius-pill);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
.agx-dir-chip.is-active .agx-dir-chip-count { background: rgba(199,169,0,0.35); color: var(--agx-white); opacity: 1; }

.agx-dir-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}
.agx-dir-view {
  display: inline-flex;
  background: var(--agx-glass-bg);
  border: 1px solid var(--agx-glass-border);
  border-radius: var(--agx-radius-pill);
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.agx-dir-view-btn {
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--agx-text-soft);
  width: 38px;
  height: 34px;
  border-radius: var(--agx-radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--agx-ease);
}
.agx-dir-view-btn:hover { color: #013E48; background-color: #ffffff; }
.agx-dir-view-btn.is-active {
  background: linear-gradient(135deg, var(--agx-deep) 0%, var(--agx-mid) 100%);
  color: var(--agx-white);
  box-shadow: 0 4px 14px rgba(1, 62, 72, 0.36);
}
.agx-dir-view-btn svg { width: 16px; height: 16px; }

.agx-dir-reset {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--agx-text-soft);
  background: transparent;
  border: 1px solid var(--agx-glass-border);
  padding: 9px 16px;
  border-radius: var(--agx-radius-pill);
  cursor: pointer;
  transition: all 0.25s var(--agx-ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.agx-dir-reset:hover {
  color: #ffffff;
  transform: translateY(-1px);
  background-color: #013E48;
}
.agx-dir-reset svg { width: 13px; height: 13px; }

/* ====== CONTADOR ====== */
.agx-dir-meta {
  max-width: 1200px;
  margin: 0 auto 18px;
  font-size: 12px;
  color: var(--agx-text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.agx-dir-meta strong { color: var(--agx-deep); font-weight: 600; }

/* ====== GRID DE TARJETAS ====== */
.agx-dir-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.agx-dir-grid.is-list { grid-template-columns: 1fr; gap: 14px; }

/* ====== TARJETA ====== */
.agx-dir-card {
  position: relative;
  background: var(--agx-glass-bg);
  border: 1px solid var(--agx-glass-border);
  border-radius: 28px;
  padding: 22px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--agx-shadow-card);
  transition: transform 0.4s var(--agx-ease), box-shadow 0.4s var(--agx-ease), border-color 0.4s var(--agx-ease), background 0.4s var(--agx-ease);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: agxCardIn 0.6s var(--agx-ease) forwards;
}
@keyframes agxCardIn {
  to { opacity: 1; transform: translateY(0); }
}
.agx-dir-card:hover {
  transform: translateY(-6px);
  border-color: var(--agx-glass-border-strong);
  background: var(--agx-glass-bg-hover);
  box-shadow: var(--agx-shadow-card-hover);
}

/* Highlight de borde tipo "spotlight" sutil */
.agx-dir-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(1, 62, 72, 0.0) 0%, rgba(1, 62, 72, 0.40) 52%, rgba(199, 169, 0, 0.24) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--agx-ease);
  pointer-events: none;
}
.agx-dir-card:hover::before { opacity: 1; }

/* ====== ENCABEZADO DE TARJETA: LOGO + NOMBRE ====== */
.agx-dir-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.agx-dir-logo {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--agx-white);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 14px rgba(1, 62, 72, 0.24);
  overflow: hidden;
  position: relative;
}
.agx-dir-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.agx-dir-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.agx-dir-card-name {
  flex: 1;
  min-width: 0;
}
.agx-dir-card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--agx-text);
  line-height: 1.25;
  margin-bottom: 4px;
  word-break: break-word;
}
.agx-dir-card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--agx-deep);
  background: rgba(199, 169, 0, 0.09);
  border: 1px solid rgba(199, 169, 0, 0.28);
  padding: 2px 9px;
  border-radius: var(--agx-radius-pill);
}
.agx-dir-card-cat + .agx-dir-card-cat { margin-left: 5px; margin-top: 4px; }

/* ====== INFO ROWS ====== */
.agx-dir-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.agx-dir-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--agx-text-soft);
  line-height: 1.4;
}
.agx-dir-info-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--agx-mid);
  opacity: 0.9;
  margin-top: 2px;
}
.agx-dir-info-row span { word-break: break-word; }

/* ====== ACCIONES (links sociales) ====== */
.agx-dir-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(1, 62, 72, 0.10);
}
.agx-dir-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--agx-deep);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(1, 62, 72, 0.12);
  transition: all 0.25s var(--agx-ease);
}
.agx-dir-action:hover {
  color: var(--agx-white);
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--agx-deep) 0%, var(--agx-mid) 100%);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(1, 62, 72, 0.32);
}
.agx-dir-action[data-type="whatsapp"]:hover { background: linear-gradient(135deg, #128c7e, #25d366); box-shadow: 0 6px 16px rgba(37,211,102,0.40); }
.agx-dir-action[data-type="facebook"]:hover { background: linear-gradient(135deg, #1877f2, #3b5998); }
.agx-dir-action[data-type="instagram"]:hover { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.agx-dir-action svg { width: 16px; height: 16px; }

/* ====== VISTA LISTA ====== */
.agx-dir-grid.is-list .agx-dir-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 16px 22px;
}
.agx-dir-grid.is-list .agx-dir-card-head { margin-bottom: 0; }
.agx-dir-grid.is-list .agx-dir-info {
  margin-bottom: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.agx-dir-grid.is-list .agx-dir-actions {
  padding-top: 0;
  border-top: none;
  flex-wrap: nowrap;
}
.agx-dir-grid.is-list .agx-dir-logo { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }

/* ====== ESTADO VACÍO ====== */
.agx-dir-empty {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
  background: var(--agx-glass-bg);
  border: 1px dashed var(--agx-glass-border);
  border-radius: var(--agx-radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
}
.agx-dir-empty.is-visible { display: block; }
.agx-dir-empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.6; }
.agx-dir-empty-title { font-size: 17px; font-weight: 500; margin-bottom: 6px; color: var(--agx-text); }
.agx-dir-empty-text { font-size: 13px; color: var(--agx-text-mute); }

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .agx-dir-wrapper { padding: 40px 16px;}
  .agx-dir-toolbar { flex-direction: column; align-items: stretch; }
  .agx-dir-filters { justify-content: center; }
  .agx-dir-tools { justify-content: space-between; }
  .agx-dir-grid { grid-template-columns: 1fr; gap: 14px; }
  .agx-dir-grid.is-list .agx-dir-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .agx-dir-grid.is-list .agx-dir-card-head { margin-bottom: 0; }
  .agx-dir-grid.is-list .agx-dir-info { flex-direction: column; }
  .agx-dir-grid.is-list .agx-dir-actions { padding-top: 12px; border-top: 1px solid rgba(1, 62, 72, 0.10); }
  .agx-dir-search-input { height: 50px; font-size: 14px; }
}
@media (max-width: 480px) {
  .agx-dir-eyebrow { font-size: 10px; padding: 6px 12px; }
  .agx-dir-chip { font-size: 12px; padding: 8px 14px; }
  .agx-dir-card { padding: 18px; }
  .agx-dir-logo { width: 52px; height: 52px; font-size: 18px; }
  .agx-dir-card-title { font-size: 15px; }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
  .agx-dir-wrapper::before,
  .agx-dir-wrapper::after { animation: none; }
  .agx-dir-card { animation: none; opacity: 1; transform: none; }
  .agx-dir-card, .agx-dir-action, .agx-dir-chip { transition: none; }
}
