/* css/estilos.css */
:root {
    --primary: #0284c7;       /* Azul Mediterráneo */
    --primary-dark: #0369a1;
    --secondary: #0d9488;     /* Turquesa Calas */
    --accent: #f59e0b;        /* Sol de Mallorca */
    --accent-hover: #d97706;
    --bg-body: #f8fafc;       /* Fondo claro luminoso */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
/* --- CABECERA PRINCIPAL (cabecera.php) --- */
.site-header {
    background-color: transparent;
    padding: 1.5rem 0 2rem;
}

.site-logo {
    display: block;
    width: 100%;
    margin-bottom: 1.5rem;
}

.site-logo img {
    display: block;
    width: 100%;
    height: 180px; /* Ajusta esta altura (ej. 160px, 200px) según el alto que desees */
    object-fit: cover; /* Llena todo el ancho recortando el exceso sin aplastar el dibujo */
    object-position: center; /* Mantiene centrado el texto "GUIA DE SERVICIOS EN MALLORCA" */
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
/* Buscador en cabecera */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 0.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.search-bar input,
.search-bar select {
    flex: 1 1 220px;
    min-width: 0;           /* Evita que las opciones largas rompan el ancho */
    max-width: 100%;        /* Fuerza a respetar siempre el contenedor blanco */
    width: 100%;
    text-overflow: ellipsis;/* Corta con "..." si una localidad es muy larga */
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    background-color: #ffffff;
    outline: none;
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--primary);
}

.search-bar button {
    flex: 0 0 auto;
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 700;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover {
    background-color: var(--accent-hover);
}


/* --- BARRA DE NAVEGACIÓN (link.php) --- */
.main-nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #e0f2fe;
    color: var(--primary-dark);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-main);
}

/* --- CONTENIDO PRINCIPAL (index.php) --- */
main {
    flex: 1;
    padding: 2rem 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cuadrícula de Empresas Responsive */
.empresas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.empresa-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.empresa-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background-color: #e2e8f0;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.badge-actividad {
    display: inline-block;
    background-color: #ccfbf1;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    align-self: flex-start;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-title a {
    color: var(--text-main);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--primary);
}

.card-location {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card-desc {
    font-size: 0.92rem;
    color: #475569;
    margin-bottom: 1.25rem;
    flex: 1;
}

.card-btn {
    display: inline-block;
    text-align: center;
    background-color: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.card-btn:hover {
    background-color: var(--primary-dark);
}

/* --- PIE DE PÁGINA (inferior.php) --- */
.site-footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 2.5rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.45rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

/* --- ADAPTACIÓN MÓVIL --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 0.75rem;
        gap: 0.5rem;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-container {
        flex-wrap: wrap;
    }
    .search-bar button {
        width: 100%;
    }
}
