/* Estilos públicos del directorio */
.dcp-directorio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   BARRA DE BÚSQUEDA Y FILTROS
   ======================================== */

.dcp-search-filters {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dcp-filter-form {
    display: grid;
    gap: 20px;
}

.dcp-search-box {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.dcp-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.dcp-search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.dcp-search-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.dcp-search-button {
    padding: 12px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.dcp-search-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.dcp-search-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.dcp-filters {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
}

.dcp-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.dcp-filter-select option {
    background: #333;
    color: white;
}

.dcp-filter-button {
    padding: 10px 20px;
    background: rgba(40,167,69,0.9);
    color: white;
    border: 2px solid rgba(40,167,69,0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.dcp-filter-button:hover {
    background: rgba(40,167,69,1);
    transform: translateY(-1px);
}

.dcp-clear-filters {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.dcp-clear-filters:hover {
    color: white;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* ========================================
   HEADER DE RESULTADOS
   ======================================== */

.dcp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 0;
    border-bottom: 2px solid #e9ecef;
}

.dcp-results-count {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.dcp-active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.dcp-filter-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dcp-view-controls {
    display: flex;
    gap: 5px;
}

.dcp-view-btn {
    padding: 10px 14px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcp-view-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.dcp-view-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
}

.dcp-view-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ========================================
   GRID DE EMPRESAS
   ======================================== */

.dcp-empresas-grid {
    margin-bottom: 40px;
}

.dcp-empresas-grid.dcp-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.dcp-empresas-grid.dcp-view-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   TARJETAS DE EMPRESA
   ======================================== */

.dcp-empresa-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
}

.dcp-empresa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.dcp-empresa-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.dcp-empresa-card:hover::before {
    transform: scaleX(1);
}

.dcp-empresa-card.dcp-card-list {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-radius: 12px;
}

.dcp-empresa-imagen {
    position: relative;
    overflow: hidden;
}

.dcp-view-grid .dcp-empresa-imagen {
    height: 200px;
}

.dcp-view-list .dcp-empresa-imagen {
    width: 250px;
    flex-shrink: 0;
}

.dcp-empresa-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dcp-empresa-card:hover .dcp-empresa-thumbnail {
    transform: scale(1.1);
}

/* ========================================
   CONTENIDO DE LA TARJETA
   ======================================== */

.dcp-empresa-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dcp-empresa-header {
    margin-bottom: 15px;
}

.dcp-empresa-titulo {
    margin: 0 0 8px 0;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
}

.dcp-empresa-titulo a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dcp-empresa-titulo a:hover {
    color: #667eea;
}

.dcp-empresa-provincia {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.dcp-empresa-provincia .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #667eea;
}

/* ========================================
   INFORMACIÓN DE CONTACTO
   ======================================== */

.dcp-empresa-info {
    margin-bottom: 15px;
    flex: 1;
}

.dcp-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
    padding: 8px 0;
}

.dcp-info-item .dashicons {
    color: #667eea;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dcp-info-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dcp-info-item a:hover {
    color: #667eea;
}

/* Rating */
.dcp-rating {
    align-items: center;
    gap: 10px;
}

.dcp-stars {
    display: flex;
    gap: 3px;
}

.dcp-star {
    color: #ffc107;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dcp-star.empty {
    color: #dee2e6;
}

.dcp-star.half {
    background: linear-gradient(90deg, #ffc107 50%, #dee2e6 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dcp-rating-value {
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* ========================================
   SERVICIOS
   ======================================== */

.dcp-empresa-servicios {
    margin-bottom: 20px;
}

.dcp-servicios-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
}

.dcp-servicios-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dcp-servicio-tag {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #c8e6c9;
}

.dcp-servicios-more {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid #e9ecef;
}

/* ========================================
   ACCIONES
   ======================================== */

.dcp-empresa-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f8f9fa;
}

.dcp-btn {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.dcp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.dcp-btn:hover::before {
    left: 100%;
}

.dcp-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex: 1;
}

.dcp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.dcp-btn-secondary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.dcp-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    color: white;
    text-decoration: none;
}

.dcp-btn-tertiary {
    background: white;
    color: #6c757d;
    border-color: #dee2e6;
}

.dcp-btn-tertiary:hover {
    color: #495057;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.dcp-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ========================================
   PAGINACIÓN
   ======================================== */

.dcp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 20px 0;
}

.dcp-pagination .page-numbers {
    padding: 12px 16px;
    background: white;
    border: 2px solid #dee2e6;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.dcp-pagination .page-numbers:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.dcp-pagination .page-numbers.current {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
}

.dcp-pagination .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ========================================
   SIN RESULTADOS
   ======================================== */

.dcp-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.dcp-no-results-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.dcp-no-results-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
}

.dcp-no-results h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 24px;
}

.dcp-no-results p {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 16px;
}

/* ========================================
   MAPA
   ======================================== */

.dcp-map-container {
    margin-top: 30px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
}

.dcp-map-legend {
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

.dcp-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #495057;
}

.dcp-marker-icon {
    width: 20px;
    height: 20px;
    background: #dc3545;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Mapa independiente */
.dcp-mapa-widget {
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
}

.dcp-mapa-controles {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e9ecef;
}

.dcp-mapa-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dcp-mapa-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.dcp-mapa-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .dcp-directorio-container {
        padding: 15px;
    }
    
    .dcp-filters {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .dcp-filter-button,
    .dcp-clear-filters {
        grid-column: span 2;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .dcp-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dcp-filter-button,
    .dcp-clear-filters {
        grid-column: span 1;
    }
    
    .dcp-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
    
    .dcp-empresas-grid.dcp-view-grid {
        grid-template-columns: 1fr;
    }
    
    .dcp-empresa-card.dcp-card-list {
        flex-direction: column;
    }
    
    .dcp-view-list .dcp-empresa-imagen {
        width: 100%;
        height: 200px;
    }
    
    .dcp-empresa-actions {
        flex-wrap: wrap;
    }
    
    .dcp-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .dcp-search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .dcp-view-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dcp-directorio-container {
        padding: 10px;
    }
    
    .dcp-search-filters {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .dcp-empresa-card {
        margin-bottom: 15px;
    }
    
    .dcp-empresa-content {
        padding: 20px;
    }
    
    .dcp-empresa-actions {
        flex-direction: column;
    }
    
    .dcp-btn {
        width: 100%;
        justify-content: center;
    }
    
    .dcp-active-filters {
        justify-content: center;
    }
    
    .dcp-pagination .page-numbers {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ========================================
   ANIMACIONES Y EFECTOS
   ======================================== */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.dcp-empresa-card {
    animation: fadeIn 0.6s ease-out;
}

.dcp-empresa-card:nth-child(even) {
    animation-delay: 0.1s;
}

.dcp-empresa-card:nth-child(3n) {
    animation-delay: 0.2s;
}

.dcp-search-filters {
    animation: slideIn 0.8s ease-out;
}

.dcp-btn-primary:hover {
    animation: pulse 1.5s infinite;
}

/* ========================================
   LOADING STATES
   ======================================== */

.dcp-loading {
    position: relative;
    overflow: hidden;
}

.dcp-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

.dcp-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   ESTADOS HOVER MEJORADOS
   ======================================== */

.dcp-empresa-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dcp-empresa-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dcp-empresa-card:hover::after {
    opacity: 1;
}

/* ========================================
   UTILIDADES
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none !important; }
.visible { display: block !important; }

.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;
}

/* ========================================
   DARK MODE (OPCIONAL)
   ======================================== */

/* @media (prefers-color-scheme: dark) {
    .dcp-directorio-container {
        color: #e9ecef;
    }
    
    .dcp-empresa-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e9ecef;
    } */
    
    .dcp-empresa-titulo a {
        color: #1b252e;
    }
    
    .dcp-empresa-titulo a:hover {
        color: #667eea;
    }
    
    .dcp-no-results {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .dcp-results-header {
        border-color: #4a5568;
    }
    
    .dcp-empresa-actions {
        border-color: #4a5568;
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

.dcp-btn:focus,
.dcp-search-input:focus,
.dcp-filter-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.dcp-view-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .dcp-search-filters,
    .dcp-view-controls,
    .dcp-empresa-actions,
    .dcp-pagination {
        display: none;
    }
    
    .dcp-empresa-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .dcp-empresas-grid.dcp-view-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
