/* =========================================
   1. VARIABLES GLOBALES Y RESET
   ========================================= */
:root {
    --primary: #d32f2f; /* Rojo cerrajero urgencias */
    --dark: #1a1a1a;   /* Negro elegante para textos/fondos */
    --light: #f5f5f5;  /* Gris muy claro para secciones alternas */
    --border: #eaeaea;
    --text-main: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-main);
    background: #fff;
    scroll-behavior: smooth;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.bg-light { background-color: var(--light); }
.bg-dark { background-color: var(--dark); }

/* =========================================
   2. BARRA SUPERIOR (TOPBAR)
   ========================================= */
.topbar {
    background: var(--dark);
    color: #fff;
    padding: 10px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #333;
}

.topbar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================================
   3. CABECERA Y MENÚ (HEADER)
   ========================================= */
header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark);
}

.logo span {
    color: var(--primary);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary);
}

/* =========================================
   4. BLOQUE PRINCIPAL (HERO)
   ========================================= */
.hero {
    /* Gradiente superpuesto NEGRO al 50%-60% */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.6)), 
        url('/figueras1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--dark); 
    
    color: #fff;
    padding: 120px 20px;
    text-align: center;
}

.eyebrow {
    background: rgba(255,255,255,0.2); 
    padding: 5px 15px; 
    border-radius: 20px; 
    font-size:0.9em; 
    text-transform:uppercase; 
    letter-spacing:1px; 
    display:inline-block; 
    margin-bottom:15px;
    border: 1px solid rgba(255,255,255,0.3);
}

.hero h1 {
    font-size: 3.5rem;
    margin: 10px 0 20px 0;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    color: #f1f1f1;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Estadísticas Hero */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 30px;
}

.stat strong {
    display: block;
    font-size: 1.4rem;
    color: #fff;
}
.stat span {
    font-size: 0.95rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones Grandes */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 18px 35px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.15rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

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

.btn-primary:hover {
    background: #b71c1c;
}

/* =========================================
   5. TICKER BAND (Textos rodantes)
   ========================================= */
.ticker-band {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-track {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

.ticker-track span {
    margin-right: 35px;
    font-weight: 500;
}

.ticker-track span a {
    color: #666;
    text-decoration: none;
}

.ticker-track span a:hover {
    color: var(--primary);
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   6. SECCIONES Y ENLACES LOCALES (Grids)
   ========================================= */
.section {
    padding: 70px 0;
}

.section-head {
    margin-bottom: 40px;
}

.section-head h2 {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.link-card {
    display: block;
    padding: 25px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.link-card strong {
    display: block;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.link-card span, .link-card p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

/* =========================================
   7. BLOQUE SERVICIOS (SHOWCASE DIVIDIDO)
   ========================================= */
.servicios.showcase {
    /* Gradiente superpuesto BLANCO al 60%-70% */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.8)), 
        url('/figueras2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f9f9f9; 
    padding: 80px 0;
}

.showcase .section-head h2 {
    text-shadow: 1px 1px 0px rgba(255,255,255,1);
}

.showcase-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: rgba(255, 255, 255, 0.85); /* Fondo semitransparente para leer texto */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.showcase-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.img-showcase {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 3px solid #fff;
    transition: transform 0.3s ease;
}

.img-showcase:hover {
    transform: scale(1.05);
}

/* =========================================
   8. RICHTEXT PANEL (Textos SEO)
   ========================================= */
.richtext-panel {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    max-width: 850px;
    margin: 0 auto;
}

.richtext-panel p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: #444;
}

.richtext-panel a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
}

.richtext-panel a:hover {
    text-decoration: underline;
}

.chip-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    background: #f0f0f0;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
    border: 1px solid #ddd;
}

/* =========================================
   9. FAQS ACORDEÓN
   ========================================= */
.faq-details {
    background: #fff;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.faq-details:hover {
    border-color: #ccc;
}

.faq-details summary {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark);
    outline: none;
    list-style: none;
    position: relative;
    padding-right: 30px;
}

.faq-details summary::-webkit-details-marker {
  display: none;
}

.faq-details summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: normal;
}

.faq-details[open] summary::after {
    content: '−';
}

.faq-details p {
    margin-top: 15px;
    color: #555;
    line-height: 1.6;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* =========================================
   10. CONTACTO Y MAPA (GRID)
   ========================================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

/* =========================================
   11. MODALES (Legal, Privacidad, Cookies)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    max-width: 650px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #555;
}

.close:hover {
    color: var(--primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* =========================================
   12. RESPONSIVE (Móviles)
   ========================================= */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .showcase-split, .showcase-images {
        grid-template-columns: 1fr;
    }

    .img-showcase {
        height: 200px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .header-flex {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    nav ul {
        justify-content: center;
        gap: 10px;
    }
    
    .btn {
        width: 100%; 
    }
    
    .hero-stats {
        gap: 20px;
    }
}