* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

#header {
    position: sticky;
    top: 0;
    width: 100%;

    background: #1a1a1a;
    color: #fff;

    z-index: 999;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#header .container {
    width: 100%;
    max-width: 1200px;

    min-height: 76px;

    margin: 0 auto;
    padding: 0.65rem 0.75rem;

    display: flex;
    align-items: center;

    gap: 0.6rem;
}


.header-brand {
    flex: 0 0 auto;
}

.header-brand a {
    display: flex;
    align-items: center;

    min-width: 48px;
    min-height: 48px;
}

.header-brand img {
    width: 50px;
    height: 50px;

    display: block;
    object-fit: contain;

    border-radius: 4px;
}


/* =========================================================
   INFORMACIÓN DE LA EMPRESA
   ========================================================= */

.logo {
    min-width: 0;
    flex: 1 1 auto;

    display: flex;
    flex-direction: column;
    justify-content: center;

    line-height: 1.15;
}

/* Nombre principal */
.logo a {
    color: #e8f903;
    text-decoration: none;
    font-size: clamp(1.35rem, 4vw, 1.8rem);

    font-weight: 700;
    line-height: 1.15;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Segunda línea */
.logo a:nth-child(2) {
    color: #e8f903;

    font-size: clamp(1.25rem, 3.5vw, 1.4rem);

    font-weight: 600;
    line-height: 1.2;
}

/* Teléfono */
.logo a:nth-child(3) {
    color: #ffffff;

    font-size: clamp(1.1rem, 3.3vw, 1.2rem);

    font-weight: 700;
    line-height: 1.2;
}


/* =========================================================
   NAVEGACIÓN MOBILE
   ========================================================= */

#nav {
    position: absolute;

    top: 100%;
    left: 0;

    width: 100%;

    background: #1a1a1a;

    max-height: 0;
    overflow: hidden;

    transition: max-height 0.3s ease-in-out;

    z-index: 998;
}

#nav.open {
    max-height: 320px;
}

#nav ul {
    list-style: none;

    display: flex;
    flex-direction: column;

    gap: 0;

    padding: 0.75rem;
}

#nav ul li {
    width: 100%;
}

#nav ul li a {
    display: flex;
    align-items: center;

    width: 100%;

    min-height: 48px;

    padding: 0.8rem 0.75rem;

    color: #fff;
    text-decoration: none;

    font-size: 1.12rem;
    font-weight: 600;

    border-radius: 5px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

#nav ul li a:hover {
    background: #2b2b2b;
    color: #e8f903;
}

#nav ul li a:focus-visible {
    outline: 3px solid #e8f903;
    outline-offset: 2px;
}


/* =========================================================
   ACCIONES DEL HEADER
   ========================================================= */

.header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 0.4rem;
}


/* =========================================================
   BOTÓN CERRAJERO
   ========================================================= */

.call-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    background: #f30000;
    color: #ffffff;

    min-height: 44px;

    padding: 0.55rem 0.7rem;

    border-radius: 5px;

    text-decoration: none;

    font-size: clamp(0.92rem, 3vw, 1.2rem);

    font-weight: 700;

    white-space: nowrap;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.call-btn:hover {
    background: #c90000;
}

.call-btn:focus-visible {
    outline: 3px solid #e8f903;
    outline-offset: 3px;
}

.call-btn:active {
    transform: scale(0.97);
}


/* =========================================================
   BOTÓN MENÚ HAMBURGUESA
   ========================================================= */

#menu-toggle {
    width: 42px;
    height: 42px;

    padding: 5px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 4px;

    background: transparent;
    border: 0;

    cursor: pointer;

    border-radius: 5px;
}

#menu-toggle span {
    display: block;

    width: 25px;
    height: 3px;

    background: #ffffff;

    border-radius: 2px;

    transition: all 0.3s ease;
}

#menu-toggle:hover {
    background: #2b2b2b;
}

#menu-toggle:focus-visible {
    outline: 3px solid #e8f903;
    outline-offset: 2px;
}


/* =========================================================
   TELÉFONOS MUY PEQUEÑOS
   ========================================================= */

@media (max-width: 380px) {

    #header .container {
        min-height: 72px;

        padding-left: 0.5rem;
        padding-right: 0.5rem;

        gap: 0.35rem;
    }

    .header-brand img {
        width: 54px;
        height: 54px;
    }

    .header-brand a {
        min-width: 44px;
        min-height: 44px;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .logo a:nth-child(2) {
        font-size: 1rem;
    }

    .logo a:nth-child(3) {
        font-size: 1.1rem;
    }

    .call-btn {
        min-height: 42px;

        padding: 0.45rem 0.5rem;

        font-size: 0.86rem;
    }

    #menu-toggle {
        width: 38px;
        height: 38px;
    }

    #menu-toggle span {
        width: 22px;
        height: 2.5px;
    }
}


/* =========================================================
   MÓVILES GRANDES / PHABLETS
   ========================================================= */

@media (min-width: 480px) {

    #header .container {
        min-height: 80px;

        padding: 0.7rem 0.9rem;

        gap: 0.7rem;
    }

    .header-brand img {
        width: 53px;
        height: 53px;
    }

    .header-brand a {
        min-width: 53px;
        min-height: 53px;
    }

    .call-btn {
        min-height: 45px;

        padding: 0.6rem 0.8rem;
    }

    #menu-toggle {
        width: 42px;
        height: 42px;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 600px) {

    #header .container {
        min-height: 84px;

        padding: 0.7rem 1rem;

        gap: 0.85rem;
    }

    .header-brand img {
        width: 58px;
        height: 58px;
    }

    .header-brand a {
        min-width: 58px;
        min-height: 58px;
    }

    .logo a {
        font-size: clamp(1.3rem, 3vw, 1.6rem);
    }

    .logo a:nth-child(2) {
        font-size: clamp(0.98rem, 2.2vw, 1.18rem);
    }

    .logo a:nth-child(3) {
        font-size: clamp(1.02rem, 2.3vw, 1.22rem);
    }

    .call-btn {
        min-height: 46px;

        padding: 0.6rem 0.9rem;

        font-size: 1.08rem;
    }

    #menu-toggle {
        width: 42px;
        height: 42px;
    }

    #menu-toggle span {
        width: 26px;
    }
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 900px) {

    #header .container {
        min-height: 92px;

        padding: 0.75rem 1.3rem;

        gap: 1rem;
    }


    /* LOGO */

    .header-brand img {
        width: 64px;
        height: 64px;
    }

    .header-brand a {
        min-width: 64px;
        min-height: 64px;
    }


    /* INFORMACIÓN */

    .logo {
        flex: 0 1 300px;
    }

    .logo a {
        font-size: clamp(1.4rem, 1.8vw, 1.65rem);
    }

    .logo a:nth-child(2) {
        font-size: clamp(1.02rem, 1.3vw, 1.18rem);
    }

    .logo a:nth-child(3) {
        font-size: clamp(1.04rem, 1.3vw, 1.22rem);
    }


    /* NAVEGACIÓN */

    #nav {
        position: static;

        width: auto;

        max-height: none;

        overflow: visible;

        margin-left: auto;
    }

    #nav ul {
        flex-direction: row;

        align-items: center;

        gap: 1rem;

        padding: 0;
    }

    #nav ul li {
        width: auto;
    }

    #nav ul li a {
        width: auto;

        min-height: 44px;

        padding: 0.5rem 0.55rem;

        font-size: clamp(1.05rem, 1.5vw, 1.22rem);

        white-space: nowrap;
    }


    /* ACCIONES */

    .header-actions {
        gap: 0.6rem;
    }

    .call-btn {
        min-height: 46px;

        padding: 0.65rem 1rem;

        font-size: clamp(1.05rem, 1.5vw, 1.22rem);
    }


    /* OCULTAR HAMBURGUESA */

    #menu-toggle {
        display: none;
    }
}


/* =========================================================
   DESKTOP GRANDE
   ========================================================= */

@media (min-width: 1100px) {

    #header .container {
        gap: 1.25rem;
    }

    .header-brand img {
        width: 68px;
        height: 68px;
    }

    .header-brand a {
        min-width: 68px;
        min-height: 68px;
    }

    .logo {
        flex-basis: 310px;
    }

    .logo a {
        font-size: 1.65rem;
    }

    .logo a:nth-child(2),
    .logo a:nth-child(3) {
        font-size: 1.2rem;
    }

    #nav ul {
        gap: 1.5rem;
    }

    #nav ul li a {
        font-size: 1.22rem;
    }

    .call-btn {
        min-height: 48px;

        padding: 0.7rem 1.05rem;

        font-size: 1.22rem;
    }
}


/* =========================================================
   PANTALLAS GRANDES
   ========================================================= */

@media (min-width: 1300px) {

    #header .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .logo {
        flex-basis: 320px;
    }
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    #nav,
    #menu-toggle span,
    .call-btn {
        transition: none;
    }
}
