/* RMX Directorio de Talleres v3 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

#rmx-directorio {
    --rd-bg: #0b0f19;
    --rd-surface: #121829;
    --rd-surface-2: #1a2236;
    --rd-surface-3: #212b42;
    --rd-border: rgba(255,255,255,0.07);
    --rd-text: #f1f5f9;
    --rd-text-2: #94a3b8;
    --rd-text-3: #64748b;
    --rd-red: #ef4444;
    --rd-red-soft: rgba(239,68,68,0.12);
    --rd-green: #22c55e;
    --rd-amber: #f59e0b;
    --rd-blue: #3b82f6;
    --rd-r: 14px;
    --rd-r-sm: 10px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--rd-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
    -webkit-font-smoothing: antialiased;
}
#rmx-directorio *, #rmx-directorio *::before, #rmx-directorio *::after { box-sizing: border-box; }

/* ════════ SEARCH BAR ════════ */
.rd-search {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.rd-select-wrap { position: relative; }
.rd-select {
    padding: 12px 36px 12px 16px;
    background: var(--rd-surface);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-r);
    color: var(--rd-text);
    font-size: 0.9rem;
    font-family: inherit;
    appearance: none;
    min-width: 180px;
    cursor: pointer;
}
.rd-select:focus { outline: none; border-color: var(--rd-red); }
.rd-select-arrow {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--rd-text-3);
}
.rd-input-wrap { position: relative; flex: 0 1 260px; }
.rd-input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--rd-text-3); pointer-events: none; width: 18px; height: 18px;
}
.rd-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--rd-surface);
    border: 1px solid var(--rd-red);
    border-radius: var(--rd-r);
    color: var(--rd-text);
    font-size: 0.9rem;
    font-family: inherit;
}
.rd-input:focus { outline: none; border-color: var(--rd-red); box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }
.rd-input::placeholder { color: var(--rd-text-3); }
.rd-geo-btn {
    width: 44px; height: 44px;
    background: var(--rd-surface); border: 1px solid var(--rd-border);
    border-radius: var(--rd-r); color: var(--rd-text-2);
    display: grid; place-items: center; cursor: pointer; transition: all 0.2s;
}
.rd-geo-btn:hover { border-color: var(--rd-red); color: var(--rd-red); }
.rd-geo-btn svg { width: 20px; height: 20px; }
.rd-search-btn {
    padding: 12px 32px; background: var(--rd-red); border: none;
    border-radius: var(--rd-r); color: #fff; font-size: 0.9rem;
    font-weight: 700; font-family: inherit; letter-spacing: 0.05em;
    cursor: pointer; transition: all 0.2s;
}
.rd-search-btn:hover { background: #dc2626; transform: translateY(-1px); }

/* ════════ TOTAL BAR ════════ */
.rd-total {
    text-align: center; margin-bottom: 20px;
    font-size: 0.8rem; color: var(--rd-text-3);
    font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.rd-total strong { color: var(--rd-text); font-size: 0.9rem; }

/* ════════ CATEGORY CHIPS ════════ */
.rd-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 28px; padding: 0 8px;
}
.rd-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: var(--rd-surface);
    border: 1px solid var(--rd-border); border-radius: 50px;
    color: var(--rd-text-2); font-size: 0.72rem; font-weight: 600;
    font-family: inherit; letter-spacing: 0.04em; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.rd-chip:hover { border-color: rgba(255,255,255,0.15); color: var(--rd-text); background: var(--rd-surface-2); }
.rd-chip.active { background: var(--rd-red); border-color: var(--rd-red); color: #fff; }
.rd-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.rd-chip-todos {
    background: var(--rd-surface-2); border-color: rgba(255,255,255,0.12);
    flex-direction: column; padding: 8px 14px; gap: 2px; font-size: 0.65rem;
}
.rd-chip-todos svg { width: 18px; height: 18px; }

/* ════════ GRID ════════ */
.rd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    min-height: 200px;
}
@media (max-width: 1024px) { .rd-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .rd-grid { grid-template-columns: 1fr; } }

/* ════════ CARD v3 — Reference style ════════ */
.rd-card {
    background: transparent;
    animation: rdFadeUp 0.3s ease both;
    position: relative;
}

/* Image / Logo area */
.rd-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--rd-border);
    margin-bottom: 16px;
    position: relative;
    background: var(--rd-surface);
}
.rd-card.premium .rd-card-img { border-color: rgba(34,197,94,0.4); }
.rd-card.turbo .rd-card-img { border-color: rgba(245,158,11,0.4); }
.rd-card.standard .rd-card-img { border-color: rgba(239,68,68,0.25); }

.rd-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.rd-card-img-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--rd-surface);
}
.rd-card-img-empty svg {
    width: 48px; height: 48px;
    color: rgba(255,255,255,0.06);
}

/* Badge overlay */
.rd-card-badge-wrap {
    position: absolute;
    top: 10px; right: 10px;
}
.rd-badge {
    padding: 4px 10px; border-radius: 6px;
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.rd-badge-verified { background: rgba(34,197,94,0.85); color: #fff; }
.rd-badge-turbo { background: rgba(245,158,11,0.85); color: #fff; }
.rd-badge-rmx { background: rgba(59,130,246,0.7); color: #fff; }

/* Card text content */
.rd-card-body { padding: 0 4px; }

.rd-card-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--rd-text);
    margin-bottom: 4px;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.rd-card-tipo {
    font-size: 0.78rem;
    color: var(--rd-text-2);
    font-weight: 500;
    margin-bottom: 10px;
}

.rd-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}
.rd-info-line {
    font-size: 0.82rem;
    color: var(--rd-text-2);
    line-height: 1.45;
}
.rd-info-line.red {
    color: var(--rd-red);
}
.rd-info-line a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.rd-info-line a:hover {
    color: var(--rd-text);
    text-decoration: underline;
}

/* Map link */
.rd-card-map {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rd-text-3);
    text-decoration: none;
    transition: color 0.2s;
}
.rd-card-map:hover { color: var(--rd-red); }
.rd-card-map svg { width: 14px; height: 14px; }

/* ════════ LOADING / EMPTY ════════ */
.rd-loading {
    grid-column: 1 / -1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; padding: 80px 0; color: var(--rd-text-3);
}
.rd-spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.06);
    border-top-color: var(--rd-red);
    border-radius: 50%; animation: rdSpin 0.7s linear infinite;
}
.rd-empty {
    grid-column: 1 / -1; text-align: center;
    padding: 80px 20px; color: var(--rd-text-3);
}
.rd-empty-title { font-size: 1rem; font-weight: 700; color: var(--rd-text-2); margin-bottom: 6px; }

/* ════════ PAGINATION ════════ */
.rd-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 32px; flex-wrap: wrap;
}
.rd-pg {
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--rd-border); border-radius: var(--rd-r-sm);
    background: var(--rd-surface); color: var(--rd-text-2);
    font-size: 0.85rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.rd-pg:hover { background: var(--rd-surface-2); color: var(--rd-text); }
.rd-pg.active { background: var(--rd-red); border-color: var(--rd-red); color: #fff; }
.rd-pg:disabled { opacity: 0.25; cursor: not-allowed; }
.rd-pg-dots { color: var(--rd-text-3); padding: 0 4px; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 640px) {
    .rd-search { flex-direction: column; align-items: stretch; }
    .rd-select { width: 100%; min-width: unset; }
    .rd-input-wrap { flex: unset; }
    .rd-chips { gap: 6px; }
    .rd-chip { font-size: 0.65rem; padding: 6px 12px; }
}

@keyframes rdFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rdSpin { to { transform: rotate(360deg); } }
