﻿/*
 * Diseño Moderno y Espectacular para Hierros Talayuela
 * Este CSS mejora la estética general de la página de inicio
 * sin necesidad de modificar el archivo HTML.
 */

/* =======================================================
 * RESET BÁSICO Y ESTILOS GENERALES
 * ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #e74c3c; /* Rojo de marca */
    --color-secondary: #2c3e50; /* Azul oscuro corporativo */
    --color-accent: #f39c12; /* Naranja de acento */
    --color-text-dark: #333;
    --color-text-light: #f4f7f6;
    --bg-light: #f4f7f6;
    --bg-white: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--color-text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.linea-roja {
    background-color: var(--color-primary);
    height: 5px;
    width: 100%;
}

/* =======================================================
 * ESTILOS DE BOTONES MEJORADOS
 * ======================================================= */
.btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--bg-white);
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--bg-white);
    border: 2px solid var(--color-secondary);
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.2);
}

.btn-secondary:hover {
    background-color: transparent;
    color: var(--color-secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(44, 62, 80, 0.3);
}

.btn-tertiary {
    background-color: var(--color-accent);
    color: var(--bg-white);
    border: 2px solid var(--color-accent);
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.2);
}

.btn-tertiary:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(243, 156, 18, 0.3);
}

.btn-category-small {
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    background-color: var(--color-secondary);
    color: var(--bg-white);
    margin-bottom: 15px;
    align-self: center;
    width: fit-content;
}

.btn-category-small:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

/* =======================================================
 * ESTILOS DE NAVEGACIÓN (HEADER)
 * Se agregaron estilos para mejorar la visibilidad del menú
 * sobre el fondo de la sección hero.
 * ======================================================= */
.header-nav ul li a {
    color: #fff; /* Enlaces blancos para mejor contraste */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Sombra para que destaquen */
    transition: color 0.3s ease;
}

.header-nav ul li a:hover {
    color: var(--color-accent); /* Cambia al color de acento al pasar el ratón */
}


/* =======================================================
 * SECCIONES PRINCIPALES
 * ======================================================= */

.section-title {
    font-size: 3.5em; /* Título más grande y espectacular */
    color: var(--color-secondary);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); /* Degradado moderno */
    margin: 10px auto 0;
    border-radius: 3px;
}

.section-intro {
    font-size: 1.2em;
    color: #555;
    max-width: 800px;
    margin: 0 auto 50px;
    text-align: center;
    line-height: 1.8;
}

.content-block {
    background-color: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    padding: 60px;
    margin-bottom: 60px;
    text-align: center;
}

/* =======================================================
 * HERO SECTION
 * Se eliminó el margen superior negativo para evitar solapamiento.
 * ======================================================= */
.hero-section {
    position: relative;
    width: 100%;
    height: 80vh; /* Aumenta la altura para mayor impacto */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    text-align: center;
    overflow: hidden;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-images {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.carousel-image.active {
    opacity: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 5em;
    margin-bottom: 20px;
    text-shadow: 2px 4px 10px rgba(0,0,0,0.8);
    color: var(--bg-white);
    animation: text-pop-up 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hero-content p {
    font-size: 2em;
    margin-bottom: 50px;
    text-shadow: 1px 2px 6px rgba(0,0,0,0.7);
    color: #e0e0e0;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* =======================================================
 * SECCIONES DE CONTENIDO
 * ======================================================= */
.services-section {
    padding-top: 60px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.service-card {
    background-color: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 40px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border-bottom: 5px solid var(--color-primary);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.service-card .service-icon {
    font-size: 4em;
    color: var(--color-primary);
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: rotateY(360deg);
}

.service-card h3 {
    font-size: 1.8em;
    color: var(--color-secondary);
    margin-bottom: 15px;
}

.logistics-service-card {
    display: flex;
    flex-direction: column;
}

.route-map {
    position: relative;
    min-height: 210px;
    margin-top: 10px;
    border: 1px solid rgba(44, 62, 80, 0.12);
    border-radius: 8px;
    background: linear-gradient(180deg, #f7fafb 0%, #eef4f1 100%);
    overflow: hidden;
}

.route-map svg {
    width: 100%;
    height: 100%;
    min-height: 210px;
    display: block;
}

.map-base {
    fill: #dce7df;
    stroke: #ffffff;
    stroke-width: 8;
    filter: url(#route-shadow);
}

.zone path {
    fill: rgba(231, 76, 60, 0.18);
    stroke: #e74c3c;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.25s ease, transform 0.25s ease;
}

.zone text {
    fill: #2c3e50;
    font: 700 15px 'Poppins', sans-serif;
    text-anchor: middle;
    pointer-events: none;
}

.zone:hover path,
.zone:focus path {
    fill: rgba(231, 76, 60, 0.38);
    transform: translateY(-3px);
}

.route-line {
    fill: none;
    stroke: #2c3e50;
    stroke-width: 4;
    stroke-dasharray: 9 8;
    stroke-linecap: round;
}

.destination-pins circle {
    fill: #e74c3c;
    stroke: #ffffff;
    stroke-width: 3;
}

.moving-truck {
    fill: #e74c3c;
    offset-path: path("M80 167 C126 125, 168 148, 202 122 S279 93, 337 142");
    animation: truck-route 6s linear infinite;
}

.moving-truck circle {
    fill: #2c3e50;
}

.route-speed-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #14883f;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 8px 22px rgba(20, 136, 63, 0.24);
}

.zone-popover {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: min(245px, calc(100% - 28px));
    padding: 12px 14px;
    border-radius: 8px;
    background: #ffffff;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-align: left;
}

.zone-popover strong,
.zone-popover span {
    display: block;
}

.zone-popover strong {
    color: #2c3e50;
    margin-bottom: 5px;
}

.zone-popover span {
    color: #4b5963;
    font-size: 0.86rem;
    line-height: 1.45;
}

.route-map:has(.zone-vera:hover) .popover-vera,
.route-map:has(.zone-vera:focus) .popover-vera,
.route-map:has(.zone-ibores:hover) .popover-ibores,
.route-map:has(.zone-ibores:focus) .popover-ibores,
.route-map:has(.zone-avila:hover) .popover-avila,
.route-map:has(.zone-avila:focus) .popover-avila {
    opacity: 1;
    transform: translateY(0);
}

@keyframes truck-route {
    from {
        offset-distance: 0%;
    }
    to {
        offset-distance: 100%;
    }
}

/* =======================================================
 * SECCIÓN CONTADOR
 * ======================================================= */
.counter-section .counters-grid {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    flex-wrap: wrap;
}

.counter-box {
    background-color: var(--bg-white);
    border-radius: 15px;
    padding: 40px 20px;
    flex-basis: 30%;
    min-width: 250px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.counter-box .counter-icon {
    font-size: 3.5em;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.counter-box h3.counter {
    font-size: 3.5em;
    color: var(--color-secondary);
    font-weight: 700;
}

.counter-box p {
    font-size: 1.2em;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

/* =======================================================
 * SECCIÓN GALERÍA DE INSTALACIONES
 * ======================================================= */
.installations-section {
    background-color: #eef1f0;
}

.installations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.installation-image-card {
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.4s ease;
    background-color: var(--bg-white);
    overflow: hidden;
}

.installation-image-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.installation-image-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
    transition: transform 0.4s ease;
}

.installation-image-card:hover img {
    transform: scale(1.1);
}

.installation-image-card h3 {
    font-size: 1.5em;
    color: var(--color-secondary);
    margin: 20px 20px 10px;
}

.installation-image-card p {
    font-size: 1em;
    color: #666;
    padding: 0 20px 20px;
}

/* =======================================================
 * SECCIÓN PRODUCTOS
 * ======================================================= */
.products-overview-section {
    padding: 60px 0;
}

.products-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-category-card {
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    background-color: var(--bg-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-category-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.product-category-card h3 {
    font-size: 1.8em;
    color: var(--color-secondary);
    margin: 20px 20px 10px;
}

.product-category-card p {
    font-size: 1em;
    color: #666;
    padding: 0 20px;
}

.btn-category-small {
    margin: 20px;
}

.view-all-products-btn {
    text-align: center;
    margin-top: 50px;
}

/* =======================================================
 * SECCIÓN ENCUÉNTRANOS (MAPA)
 * ======================================================= */
.location-section {
    padding: 60px 0;
    background-color: var(--bg-light);
}

.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    aspect-ratio: 16 / 9;
    min-height: 320px;
    background: #e9eef1;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    transition: transform 0.5s ease;
}

.map-container:hover iframe {
    transform: scale(1.02);
}

/* =======================================================
 * SECCIÓN PREGUNTAS FRECUENTES (FAQ)
 * ======================================================= */
.faq-section {
    padding: 60px 0;
}

.faq-accordion {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background-color: var(--bg-white);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.faq-question {
    display: block;
    padding: 20px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-secondary);
    position: relative;
    transition: background-color 0.3s ease;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: normal;
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
    content: '-';
    transform: translateY(-50%) rotate(0deg);
}

.faq-question:hover {
    background-color: #f9f9f9;
}

.faq-answer {
    padding: 0 20px 20px;
    color: #666;
    font-size: 1em;
}

/* =======================================================
 * SECCIÓN DE CONTACTO RÁPIDA
 * ======================================================= */
.quick-contact-section .content-block {
    padding: 80px;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #34495e 100%);
    color: var(--bg-white);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.quick-contact-section h2 {
    color: var(--bg-white);
    font-size: clamp(1.65rem, 6vw, 3em);
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.quick-contact-section p {
    font-size: clamp(1rem, 3.5vw, 1.2em);
    line-height: 1.6;
    color: #e0e0e0;
    max-width: 700px;
    margin: 0 0 30px;
    overflow-wrap: anywhere;
}

.quick-contact-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) minmax(560px, 1.3fr);
    gap: 32px;
    align-items: center;
}

.quick-contact-copy {
    text-align: left;
}

.quick-contact-section .legacy-logistics-layout {
    display: none;
}

.quick-contact-section .contact-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.logistics-week-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.logistics-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.logistics-help-card,
.weekly-routes-card {
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--color-text-dark);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.logistics-help-card {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: clamp(32px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 5px solid var(--color-primary);
    text-align: center;
}

.logistics-help-card h2 {
    margin: 0 0 14px;
    color: var(--color-secondary);
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.15;
}

.logistics-help-card p {
    margin: 0 0 24px;
    color: #666;
    max-width: 720px;
}

.weekly-routes-card {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    min-width: 0;
    padding: clamp(24px, 3vw, 36px);
    overflow: hidden;
    border-top: 5px solid var(--color-primary);
    text-align: left;
}

.weekly-routes-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
    min-width: 0;
}

.weekly-routes-header h3 {
    margin: 0;
    color: var(--color-secondary);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.weekly-routes-header h3 i {
    color: var(--color-primary);
    margin-right: 8px;
}

.route-legend {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--color-primary);
    font-weight: 800;
    font-size: 0.88rem;
}

.weekly-routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.weekday-card {
    min-width: 0;
    min-height: 0;
    padding: 16px;
    border-radius: 8px;
    background: #f8fafb;
    color: #2c3e50;
    border: 1px solid #e1e6ea;
    border-left: 4px solid var(--color-primary);
    box-shadow: none;
    overflow-wrap: anywhere;
    word-break: normal;
}

.weekday-card.double-route {
    border-left-color: #14883f;
    background: #ffffff;
}

.weekday-head {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
}

.weekday-head span {
    color: var(--color-primary);
    font-size: 0.86rem;
    font-weight: 900;
    text-transform: uppercase;
}

.weekday-head strong {
    font-size: 1.08rem;
    color: #2c3e50;
}

.weekday-card p {
    margin: 0;
    color: #4f5f69;
    font-size: 0.92rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.route-zone-group {
    padding: 11px 0;
    border-top: 1px solid #dde6ea;
    min-width: 0;
}

.route-zone-group h4 {
    margin: 0 0 5px;
    color: #14883f;
    font-size: 0.98rem;
    line-height: 1.2;
}

.logistics-highlight {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.logistics-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--color-primary);
    font-size: 1.55rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.logistics-highlight h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1.35rem;
}

.logistics-highlight p {
    margin: 0 0 10px;
    color: #fff;
    font-size: 1rem;
    line-height: 1.45;
}

.logistics-highlight span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f7d9d3;
    font-weight: 700;
    line-height: 1.4;
}

.logistics-routes-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    text-align: left;
}

.routes-map-mini {
    position: relative;
    min-height: 260px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #f7fafb 0%, #e9f1ee 100%);
}

.routes-map-mini svg {
    width: 100%;
    height: 100%;
    min-height: 260px;
    display: block;
}

.mini-map-bg {
    fill: #dce7df;
    stroke: #ffffff;
    stroke-width: 8;
}

.mini-route {
    fill: none;
    stroke-width: 4;
    stroke-dasharray: 9 8;
    stroke-linecap: round;
    animation: route-dash 7s linear infinite;
}

.route-avila-line {
    stroke: #e74c3c;
}

.route-vera-line {
    stroke: #14883f;
}

.route-ibores-line {
    stroke: #2c3e50;
}

.route-zone path {
    fill: rgba(231, 76, 60, 0.16);
    stroke: #e74c3c;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.2s ease, transform 0.2s ease;
}

.route-zone text {
    fill: #24323c;
    font: 800 15px 'Poppins', sans-serif;
    text-anchor: middle;
    pointer-events: none;
}

.route-zone:hover path,
.route-zone:focus path {
    fill: rgba(231, 76, 60, 0.34);
    transform: translateY(-3px);
}

.mini-pins circle {
    fill: #e74c3c;
    stroke: #ffffff;
    stroke-width: 3;
    transform-origin: center;
    animation: pin-pulse 1.8s ease-in-out infinite;
}

.mini-truck {
    fill: #e74c3c;
    offset-path: path("M68 158 C107 112, 159 121, 205 106 S298 88, 360 133");
    animation: mini-truck-route 6.5s linear infinite;
}

.mini-truck circle {
    fill: #2c3e50;
}

.routes-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #14883f;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 8px 22px rgba(20, 136, 63, 0.24);
}

.mini-map-popover {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: min(245px, calc(100% - 28px));
    padding: 12px 14px;
    border-left: 4px solid #e74c3c;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mini-map-popover strong,
.mini-map-popover span {
    display: block;
}

.mini-map-popover strong {
    margin-bottom: 5px;
    font-weight: 800;
}

.mini-map-popover span {
    font-size: 0.86rem;
    line-height: 1.45;
}

.routes-map-mini:has(.route-zone-avila:hover) .mini-popover-avila,
.routes-map-mini:has(.route-zone-avila:focus) .mini-popover-avila,
.routes-map-mini:has(.route-zone-vera:hover) .mini-popover-vera,
.routes-map-mini:has(.route-zone-vera:focus) .mini-popover-vera,
.routes-map-mini:has(.route-zone-ibores:hover) .mini-popover-ibores,
.routes-map-mini:has(.route-zone-ibores:focus) .mini-popover-ibores {
    opacity: 1;
    transform: translateY(0);
}

.routes-list {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.routes-list h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.35rem;
}

.route-day {
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}

.route-day summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

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

.route-day summary span {
    color: #f7d9d3;
    font-size: 0.88rem;
    font-weight: 800;
}

.route-day summary strong {
    color: #ffffff;
    font-size: 1rem;
}

.route-day p {
    margin: 0;
    padding: 0 14px 14px;
    max-width: 100%;
    color: #f3f7f8;
    font-size: 0.9rem;
    line-height: 1.5;
}

.route-day:hover,
.route-day[open] {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.38);
}

@keyframes route-dash {
    to {
        stroke-dashoffset: -68;
    }
}

@keyframes pin-pulse {
    0%, 100% {
        r: 5;
    }
    50% {
        r: 7;
    }
}

@keyframes mini-truck-route {
    from {
        offset-distance: 0%;
    }
    to {
        offset-distance: 100%;
    }
}


/* =======================================================
 * BOTONES FLOTANTES Y ANIMACIONES
 * ======================================================= */
.floating-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 65px;
    height: 65px;
    font-size: 2.2em;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.whatsapp-btn {
    background-color: #25D366;
    color: #fff;
}

.chatbot-btn {
    position: fixed;
    bottom: 40px;
    right: 120px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    color: #fff;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 12px 28px rgba(231,76,60,0.35), 0 4px 12px rgba(0,0,0,0.22);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    isolation: isolate;
    overflow: visible;
}

.chatbot-btn::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(231,76,60,0.22);
    animation: chatbot-pulse 2.4s ease-out infinite;
    z-index: -1;
}

.chatbot-btn i {
    font-size: 0.9em;
}

.chatbot-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e67e22 100%);
    transform: translateY(-3px) scale(1.08);
}

.chatbot-window {
    position: fixed;
    right: 40px;
    bottom: 120px;
    width: min(360px, calc(100vw - 32px));
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chatbot-header {
    background: var(--color-secondary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.close-chatbot-btn {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.chatbot-body {
    padding: 16px;
    background: #f6f7f9;
    min-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.message p {
    margin: 0;
}

.bot-message {
    align-self: flex-start;
    background: #fff;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-footer {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e6e8eb;
    background: #fff;
}

.chatbot-footer input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d7dce0;
    border-radius: 999px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.chatbot-footer input:focus {
    border-color: var(--color-primary);
}

.chatbot-footer button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
}

.chatbot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(231,76,60,0.09);
    color: var(--color-primary);
    border: 1px solid rgba(231,76,60,0.25);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
}

.chatbot-links a:hover {
    background: var(--color-primary);
    color: #fff;
}

.chatbot-links .chatbot-whatsapp-link {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    background: #25D366;
    border-color: #25D366;
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.25;
}

.chatbot-links .chatbot-whatsapp-link:hover {
    background: #128c7e;
    border-color: #128c7e;
}

@keyframes chatbot-pulse {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }
    70%, 100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* ANIMACIONES */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-on-scroll.fade-in-up {
    opacity: 1;
    transform: translateY(0);
}

@keyframes text-pop-up {
    0% {
        transform: scale(0.5);
        opacity: 0;
        filter: blur(8px);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* =======================================================
 * MEDIA QUERIES (RESPONSIVO)
 * ======================================================= */
@media (max-width: 1180px) {
    .logistics-week-layout {
        grid-template-columns: 1fr;
    }

    .weekly-routes-card {
        grid-row: auto;
    }

}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 4em;
    }
    .hero-content p {
        font-size: 1.6em;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.5em;
    }
    .hero-content h1 {
        font-size: 3em;
    }
    .hero-content p {
        font-size: 1.2em;
        margin-bottom: 30px;
    }
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    .content-block {
        padding: 40px 20px;
    }
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    .quick-contact-section .content-block {
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }
    .quick-contact-section .btn,
    .quick-contact-section .btn-large {
        width: 100%;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }
    .quick-contact-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .logistics-week-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .weekly-routes-card {
        grid-row: auto;
    }
    .weekly-routes-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .route-legend {
        width: 100%;
        text-align: center;
    }
    .weekly-routes-grid {
        grid-template-columns: 1fr;
    }
    .weekday-card {
        min-height: auto;
    }
    .quick-contact-copy {
        text-align: center;
    }
    .quick-contact-section p {
        margin-left: auto;
        margin-right: auto;
    }
    .logistics-highlight {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
        padding: 22px 18px;
    }
    .logistics-highlight span {
        justify-content: center;
    }
    .logistics-routes-panel {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .routes-map-mini,
    .routes-map-mini svg {
        min-height: 220px;
    }
    .route-day summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.8em;
        bottom: 20px;
        right: 20px;
    }
    .chatbot-btn {
        right: 90px;
    }
    .chatbot-window {
        right: 16px;
        bottom: 86px;
        max-height: calc(100vh - 110px);
    }
    .hero-buttons {
        flex-direction: column;
    }
    .hero-buttons .btn {
        width: 100%;
    }
}

/* =======================================================
 * REPARACIÓN RESPONSIVE MÓVIL: HOME, NOSOTROS Y EQUIPO
 * ======================================================= */
.hero-section,
.hero-content,
.services-section,
.installations-section,
.products-overview-section,
.location-section,
.faq-section,
.quick-contact-section,
.quick-contact-section .container,
.quick-contact-section .contact-card,
.content-block {
    box-sizing: border-box;
    max-width: 100%;
}

.hero-content,
.section-title,
.section-intro,
.quick-contact-section .contact-card,
.quick-contact-section h2,
.quick-contact-section p,
.quick-contact-section .btn {
    hyphens: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.quick-contact-section .contact-card {
    width: min(100%, 980px);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    img,
    picture,
    video,
    iframe,
    table {
        max-width: 100%;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }

    .content-block {
        width: 100%;
        max-width: 100%;
        padding: 28px 14px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 10px;
    }

    .hero-content {
        width: 100%;
        max-width: calc(100vw - 28px);
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-content h1,
    .section-title,
    .quick-contact-section h2 {
        font-size: clamp(1.75rem, 8vw, 2.4rem);
        line-height: 1.15;
        letter-spacing: 0;
        max-width: 100%;
        hyphens: auto;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .hero-content p,
    .section-intro,
    .quick-contact-section p {
        font-size: clamp(0.98rem, 4.2vw, 1.12rem);
        line-height: 1.55;
        max-width: 100%;
        hyphens: auto;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .services-grid,
    .installations-grid,
    .products-categories-grid,
    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    .service-card,
    .installation-image-card,
    .product-category-card,
    .faq-item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        hyphens: auto;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .quick-contact-section {
        padding-left: 0;
        padding-right: 0;
    }

    .quick-contact-section .contact-card {
        width: 100%;
        max-width: 100%;
        padding: 0;
        text-align: center;
    }

    .quick-contact-section .btn,
    .quick-contact-section .btn-large,
    .hero-buttons .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
        padding: 12px 14px;
        hyphens: auto;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}


