/* ============================================
   DIRECTORIO NACIONAL DE CERRAJEROS - ESTILOS
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #1a4d8f;
    --secondary-color: #f39c12;
    --accent-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dce1e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --featured-bg: #fff8e1;
    --max-width: 1200px;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Header fijo */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563a8 100%);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Contenedor principal */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
}

/* Sección de introducción */
.intro-section {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.intro-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 15px;
}

/* Buscador */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #2563a8;
}

/* Selector de provincias */
.province-selector {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.province-selector h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.province-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.province-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
    background: white;
}

.province-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.province-card .company-count {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Fichas de empresas */
.companies-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
}

.section-intro {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Empresas destacadas */
.featured-companies {
    margin-bottom: 40px;
}

.featured-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Filtros */
.filters {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filters h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Grid de empresas */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Tarjeta de empresa */
.company-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.company-card.featured {
    border: 3px solid var(--secondary-color);
    background: var(--featured-bg);
}

.company-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg-light);
}

.company-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.company-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.company-category {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-style: italic;
}

.company-description {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Valoraciones */
.rating-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    color: var(--secondary-color);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.rating-value {
    font-weight: 600;
    color: var(--text-dark);
}

.rating-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Información de la empresa */
.company-info {
    margin-top: auto;
}

.info-item {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-icon {
    flex-shrink: 0;
    width: 18px;
}

.info-text {
    color: var(--text-dark);
}

/* Botones de acción */
.company-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563a8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #e08e0b;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Sección de contenido adicional */
.additional-content {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.additional-content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    margin-top: 30px;
}

.additional-content h2:first-child {
    margin-top: 0;
}

.additional-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.additional-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.additional-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Servicios */
.services-section {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.service-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-dark);
    line-height: 1.7;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 30px 20px;
    margin-top: 50px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
    color: #bdc3c7;
}

/* Breadcrumbs */
.breadcrumbs {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--text-light);
    margin: 0 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .intro-section,
    .search-section,
    .province-selector {
        padding: 20px 15px;
    }
    
    .province-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .province-card {
        padding: 15px 10px;
    }
    
    .province-card h3 {
        font-size: 1.1rem;
    }
    
    .company-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .company-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .province-grid {
        grid-template-columns: 1fr;
    }
    
    .company-image {
        height: 180px;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

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

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

.hidden {
    display: none !important;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}
