/* ============================================================
   info-imagenes.css
   Estilos exclusivos de /info-imagenes/
   Complementa base.css — no modifica variables globales
   ============================================================ */

/* ── HERO de sección ───────────────────────────────────── */
.ii-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 40px 40px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.ii-hero-inner { flex: 1; min-width: 240px; }

/* ── Búsqueda desktop (en el hero) ─────────────────────── */
.ii-search-desktop {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  height: 42px;
  min-width: 260px;
  max-width: 340px;
  flex: 0 0 auto;
  align-self: flex-end;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.ii-search-desktop:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.ii-search-icon {
  font-size: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}
.ii-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
}
.ii-search-input::placeholder { color: var(--text-3); }

@media (max-width: 768px) {
  .ii-hero { padding: 24px 20px 0; flex-direction: column; gap: 16px; }
  .ii-search-desktop { display: none; } /* En mobile se usa el modal */
}

/* ── Filtros de categoría (pills en topbar desktop) ─────── */
.ii-filter-wrap { display: flex; align-items: center; }

.ii-cat-pills {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ii-cat-pills::-webkit-scrollbar { display: none; }

.ii-cat-pill {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-2);
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ii-cat-pill:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}
.ii-cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 768px) {
  .ii-filter-wrap { display: none; }
}

/* ── Estado de carga / error ────────────────────────────── */
.ii-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  font-size: 14px;
  color: var(--text-3);
  max-width: 1200px;
  margin: 0 auto;
}
.ii-spin {
  animation: ii-spin 1s linear infinite;
  font-size: 20px;
}
@keyframes ii-spin { to { transform: rotate(360deg); } }

/* ── Galería wrap ───────────────────────────────────────── */
.ii-gallery-wrap {
  padding-bottom: 80px;
}

/* ── Grid de imágenes ───────────────────────────────────── */
.ii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  padding: 24px 40px 0;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .ii-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 20px 24px 0; }
}
@media (max-width: 768px) {
  .ii-grid { grid-template-columns: repeat(2, 1fr); padding: 16px 16px 0; gap: 12px; }
}
@media (max-width: 420px) {
  .ii-grid { grid-template-columns: 1fr; }
}

/* ── Card de imagen ─────────────────────────────────────── */
.ii-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}
.ii-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.ii-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-sidebar);
  overflow: hidden;
}
.ii-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s;
}
.ii-card:hover .ii-card-thumb img { transform: scale(1.03); }

/* Placeholder cuando la imagen falla */
.ii-thumb-error { background: var(--bg-hover); }
.ii-thumb-error::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c9c96' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / 32px no-repeat;
}

.ii-card-cat {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

.ii-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ii-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ii-card-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Sin resultados ─────────────────────────────────────── */
.ii-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}
.ii-empty .ph { font-size: 40px; }
.ii-empty p { color: var(--text-2); }

.ii-empty-reset {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.ii-empty-reset:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Search thumb (modal de búsqueda) ───────────────────── */
.ii-search-thumb {
  width: 44px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-sidebar);
  flex-shrink: 0;
}

/* ── DETALLE ────────────────────────────────────────────── */
.ii-detail-img-wrap {
  margin: 32px 0;
  position: relative;
}

.ii-detail-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.ii-detail-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.ii-detail-download:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}

.ii-detail-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 32px;
}

/* ── Related grid (en detalle) ──────────────────────────── */
.ii-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ii-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.15s;
}
.ii-related-card:hover { opacity: 0.8; }

.ii-related-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-sidebar);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ii-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ii-related-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 404 ────────────────────────────────────────────────── */
.ii-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-3);
}
.ii-not-found .ph { font-size: 48px; }
.ii-not-found h2 { font-size: 20px; font-weight: 600; color: var(--text); }
.ii-not-found p  { font-size: 14px; color: var(--text-2); }

.ii-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ii-btn-primary:hover { opacity: 0.88; }

/* ── Nav loading placeholder ────────────────────────────── */
.nav-loading {
  opacity: 0.5;
  pointer-events: none;
  font-style: italic;
}
