/**
 * Estilos personalizados para Mixcoco Locator Pro
 * 
 * @author Sergio Martinez - Unlockers Cloud
 * @url https://1lockers.net
 * 
 * Nota: Tailwind CSS se carga desde CDN vía PHP enqueue
 */

/* Contenedor principal */
.mixcoco-locator-wrapper {
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Grid layout principal */
.mixcoco-locator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 600px;
    height: 600px;
}

@media (min-width: 1024px) {
    .mixcoco-locator-grid {
        grid-template-columns: 400px 1fr;
        height: 100vh;
        min-height: 600px;
        max-height: 100vh;
    }
}

/* Sidebar izquierdo */
.mixcoco-sidebar {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 1024px) {
    .mixcoco-sidebar {
        height: auto;
        max-height: 100vh;
    }
}

/* Header del sidebar */
.mixcoco-sidebar-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mixcoco-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-align: center;
}

/* Buscador */
.mixcoco-search-container {
    margin-bottom: 1rem;
}

.mixcoco-search-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.mixcoco-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

/* Filtro de departamento */
.mixcoco-filter-container {
    margin-bottom: 1rem;
}

.mixcoco-select {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.mixcoco-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.mixcoco-select option {
    background: white;
    color: #374151;
    padding: 0.5rem;
}

/* Tabs */
.mixcoco-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
}

.mixcoco-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mixcoco-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.mixcoco-tab.active {
    background: white;
    color: #dc2626;
    border-color: white;
}

/* Lista de sedes */
.mixcoco-sedes-list {
    padding: 1rem;
}

.mixcoco-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.mixcoco-sede-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mixcoco-sede-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #dc2626;
}

.mixcoco-sede-card.active {
    border-color: #dc2626;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.mixcoco-sede-card.tienda {
    border-left: 4px solid #dc2626;
}

.mixcoco-sede-card.distribuidor {
    border-left: 4px solid #1f2937;
}

.mixcoco-sede-nombre {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.mixcoco-sede-tipo {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.mixcoco-sede-tipo.tienda {
    background: #fee2e2;
    color: #991b1b;
}

.mixcoco-sede-tipo.distribuidor {
    background: #f3f4f6;
    color: #374151;
}

.mixcoco-sede-info {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
    line-height: 1.5;
}

.mixcoco-sede-info strong {
    color: #374151;
}

.mixcoco-sede-telefonos {
    margin-top: 0.5rem;
}

.mixcoco-sede-telefono {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.mixcoco-sede-telefono a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.mixcoco-sede-telefono a:hover {
    color: #991b1b;
    text-decoration: underline;
}

.mixcoco-sede-instagram {
    margin-top: 0.5rem;
}

.mixcoco-sede-instagram a {
    color: #e1306c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.mixcoco-sede-instagram a:hover {
    color: #c13584;
    text-decoration: underline;
}

.mixcoco-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.mixcoco-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mixcoco-empty-state-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Contenedor del mapa */
.mixcoco-map-container {
    position: relative;
    width: 100%;
    height: 600px;
    min-height: 600px;
    background: #f3f4f6;
}

@media (min-width: 1024px) {
    .mixcoco-map-container {
        height: calc(100vh - 0px);
        min-height: 600px;
        max-height: 100vh;
    }
}

.mixcoco-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 600px;
    z-index: 1;
}

.mixcoco-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Popups personalizados de Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 1rem;
    min-width: 200px;
}

.mixcoco-popup-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.mixcoco-popup-info {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
    line-height: 1.5;
}

.mixcoco-popup-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mixcoco-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.mixcoco-popup-btn-whatsapp {
    background: #25d366;
    color: white;
}

.mixcoco-popup-btn-whatsapp:hover {
    background: #20ba5a;
    color: white;
}

.mixcoco-popup-btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.mixcoco-popup-btn-instagram:hover {
    opacity: 0.9;
    color: white;
}

/* Scrollbar personalizado para sidebar */
.mixcoco-sidebar::-webkit-scrollbar {
    width: 8px;
}

.mixcoco-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mixcoco-sidebar::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

.mixcoco-sidebar::-webkit-scrollbar-thumb:hover {
    background: #991b1b;
}

/* Responsive */
@media (max-width: 1023px) {
    .mixcoco-locator-grid {
        grid-template-columns: 1fr;
    }
    
    .mixcoco-sidebar {
        height: 400px;
        order: 2;
    }
    
    .mixcoco-map-container {
        height: 400px;
        order: 1;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mixcoco-sede-card {
    animation: fadeIn 0.3s ease-out;
}

