/* ...existing code... */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--espaciado-medio);
}

.main-nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    z-index: 100;

    background: var(--color-fondo-contenedor);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.logo {
    padding: 0.5rem 2rem;
    border-radius: var(--borde-redondeado);
    background: var(--color-oscuro-fuerte);
    color: var(--color-texto-sobre-oscuro);
    font-family: var(--fuente-titulo);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1;
}
.logo a {
    color: var(--color-texto-sobre-oscuro);
    text-decoration: none;
}

.nav-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 1.2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-texto-principal);
    font-family: var(--fuente-parrafo);
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--borde-redondeado);
    transition: background-color .2s ease, color .2s ease;
}

.nav-links a:hover {
    background: var(--color-fondo-principal);
    color: var(--color-azul-hover);
}

.nav-links .nav-cta {
    background: var(--color-naranja-principal);
    color: var(--color-texto-sobre-oscuro);
}

.nav-links .nav-cta:hover {
    background: var(--color-naranja-hover);
    color: var(--color-texto-sobre-oscuro);
}

.nav-toggle {
    border: none;
    background: transparent;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--color-oscuro-fuerte);
    border-radius: 999px;
}

/*sección generador*/

#generador {
    max-width: 1280px;
    margin: 24px auto 0;
    padding: 0 var(--espaciado-medio);
    text-align: center;
}

#generador h1 {
    max-width: 70%;
    margin: 0 auto;
    font-family: var(--fuente-titulo);
    color: var(--color-texto-principal);
    font-size: clamp(2.8rem, 5vw, 6rem);
    line-height: 1.1;
    margin-bottom: 12px;
}

.text-multi {
    background: linear-gradient(90deg, #e9d500 0%, #50c878 25%, #0ea5e9 55%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.generador-desc {
    max-width: 760px;
    margin: 0 auto 26px;
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    line-height: 1.5;
}

.palette-panel {
    background: var(--color-borde-suave);
    border-radius: 18px;
    padding: 26px;

}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    min-height: 320px;
    overflow: visible;
    gap: 1rem;
    padding: 1rem;
}

.palette-empty {
    grid-column: 1 / -1;
    background: var(--color-fondo-contenedor);
    border-radius: 12px;
    border: 1px dashed var(--color-borde-suave);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-secundario);
    font-size: 1.1rem;
}

.color-card {
    min-height: 300px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-fondo-contenedor);
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.4);
}

.color-card:hover {
    box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.1);
    /*añade el fade in */
    transform: scale(1.07);
    border: 3px solid var(--color-naranja-principal);

}

.color-preview {
    position: relative;
    flex: 1;
    min-height: 150px;
    max-height: 150px;
    /* height: 150px; */
}

.color-meta {
    background: var(--color-fondo-contenedor);
    min-height: 120px;
    padding: 0.75rem 0.2rem 0;
    text-align: center;
    border-top: 1px solid var(--color-borde-suave);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    outline: none;
}

.color-format-label {
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-secundario);
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0;
}

.color-format-label-active {
    color: #EF4444;
}

.color-format-value {
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.15;
    margin: 0.25rem 0 0.5rem;

}

.color-format-value-hsl {
    font-size: 1.1rem;
}

.lock-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.7);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-texto-sobre-oscuro);
}

.lock-btn img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
}

.controls {
    margin-bottom: 1.1rem;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-control {
    border: none;
    border-radius: var(--borde-redondeado);
    padding: 10px 18px;
    font-family: var(--fuente-parrafo);
    font-size: 1.1rem;
    color: var(--color-texto-sobre-oscuro);
    background: var(--color-oscuro-fuerte);
    cursor: pointer;
}

.btn-control:hover {
    background: var(--color-azul-hover);
}
.btn-control-generar {
    border: none;
    border-radius: var(--borde-redondeado);
    padding: 10px 18px;
    font-family: var(--fuente-parrafo);
    font-size: 1.1rem;
    color: var(--color-texto-sobre-oscuro);
    background: var(--color-azul-interaccion);
    cursor: pointer;
}

.btn-control-generar:hover {
    background: var(--color-azul-hover);
}

.btn-control-guardar {
    border: none;
    border-radius: var(--borde-redondeado);
    padding: 10px 18px;
    font-family: var(--fuente-parrafo);
    font-size: 1.1rem;
    color: var(--color-texto-sobre-oscuro);
    background: rgb(35, 161, 35);
    cursor: pointer;
}

.btn-control-guardar:hover {
    background: rgb(22, 122, 22);
}

.control-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: var(--color-oscuro-fuerte);
}

.control-option {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--fuente-parrafo);
    font-size: 0.95rem;
    color: var(--color-texto-sobre-oscuro);
    background: transparent;
    cursor: pointer;
}

.control-option:hover {
    background: rgba(255, 255, 255, 0.12);
}

.control-option.is-active {
    background: var(--color-naranja-principal);
    color: var(--color-texto-sobre-oscuro);
}


.palette-toast {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: var(--espaciado-medio);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--fuente-parrafo);
    font-size: 1.2rem;
    background: var(--color-naranja-principal);
    color: var(--color-texto-sobre-oscuro);
    border: 3px solid white;
    opacity: 0;
    transform:  translate(-50%, -50%);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 1000;
}

.palette-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

#ejemplo-visual {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: center;
}

.preview-content h2 {
    font-family: var(--fuente-titulo);
    color: var(--color-texto-principal);
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1;
    margin: 0 0 1rem;
}

.preview-content p {
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0 0 1.2rem;
    max-width: 380px;
}

.preview-mockup {
    display: flex;
    justify-content: center;
}

.mockup-shell {
    width: 100%;
    max-width: 640px;
    min-height: 420px;
    background: var(--color-oscuro-fuerte);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mockup-header,
.mockup-banner,
.mockup-block,
.mockup-column-right,
.mockup-footer,
.mockup-extra-block {
    border-radius: var(--borde-redondeado);
    transition: background-color 0.25s ease;
}

.mockup-header {
    height: 56px;
}

.mockup-banner {
    height: 40px;
    width: 58%;
    margin: 0 auto;
}

.mockup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
}

.mockup-column-left {
    display: grid;
    grid-template-rows: 1fr 0.7fr;
    gap: 0.75rem;
}

.mockup-column-right {
    min-height: 210px;
}

.mockup-footer {
    height: 52px;
}

.mockup-extra-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.mockup-extra-block {
    height: 40px;
}

.is-hidden-preview {
    display: none;
}

#paletas-guardadas {
    max-width: 1200px;
    margin: 32px auto 0;
    padding: 0 1rem;
}

.saved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.saved-header h2 {
    font-family: var(--fuente-titulo);
    font-size: 2rem;
    margin: 0;
}

.saved-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-empty {
    background: var(--color-fondo-contenedor);
    border-radius: 12px;
    border: 1px dashed var(--color-borde-suave);
    padding: 1.5rem;
    text-align: center;
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-secundario);
}

.saved-card {
    background: var(--color-oscuro-fuerte);
    color: var(--color-texto-sobre-oscuro);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 1rem;
}

.saved-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
    gap: 0.5rem;
    grid-column: 1;
}

.saved-swatch {
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.saved-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: var(--fuente-parrafo);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    grid-column: 1;
    grid-row: 2;
}

.saved-meta strong {
    color: var(--color-texto-sobre-oscuro);
}

.saved-delete-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--fuente-parrafo);
    font-size: 0.9rem;
    color: var(--color-texto-sobre-oscuro);
    background: #EF4444;
    cursor: pointer;
    white-space: nowrap;
}

.saved-delete-btn:hover {
    background: #DC2626;
}

.saved-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    grid-column: 2;
    grid-row: 1 / 3;
    align-items: stretch;
}

.saved-download-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--fuente-parrafo);
    font-size: 0.9rem;
    color: var(--color-texto-sobre-oscuro);
    background: var(--color-azul-interaccion);
    cursor: pointer;
    white-space: nowrap;
}

.saved-download-btn:hover {
    background: var(--color-azul-hover);
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-oscuro-fuerte);
    opacity: 0.55;
}

.confirm-modal__content {
    position: relative;
    width: min(100%, 460px);
    background: var(--color-fondo-contenedor);
    border-radius: 14px;
    border: 1px solid var(--color-borde-suave);
    padding: 1.2rem;
}

.confirm-modal__content h3 {
    margin: 0;
    color: var(--color-texto-principal);
    font-family: var(--fuente-titulo);
    font-size: 1.4rem;
}

.confirm-modal__content p {
    margin: 0.75rem 0 0;
    color: var(--color-texto-secundario);
    font-family: var(--fuente-parrafo);
    line-height: 1.45;
}

.confirm-modal__actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.fundamentos-section {
    background-color: var(--color-fondo-contenedor);
    border-radius: 1rem;
    max-width: 1200px;
    min-width: auto;
    margin: 40px auto 0;
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap-reverse;
    justify-content: space-evenly;
    align-items: center;
    gap: 0.5rem;

}

.fundamentos-content {
    max-width: 600px;
    padding: 1rem;
    background-color: var(--color-fondo-contenedor);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;

}

.color-decoration {
    font-weight: 700;
    background: linear-gradient(90deg, #e9d500 0%, #50c878 25%, #0ea5e9 55%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-color: var(--color-fondo-contenedor);
}

.fundamentos-img {
    max-width: 22rem;
    width: 100%;
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.fundamentos-img:hover {
    animation: 8s girar linear infinite;
}


.fundamentos-content h2 {
    font-family: var(--fuente-titulo);
    color: var(--color-texto-principal);
    font-size: 2.5rem;
}

.fundamentos-content p {
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    line-height: 1.5;
}

.btn-more {
    display: flex;
    justify-content: center;
    width: 40%;
    background-color: var(--color-azul-interaccion);
    padding: 0.625rem 0.9375rem;
    border-radius: var(--borde-redondeado);
    text-decoration: none;
    color: var(--color-texto-sobre-oscuro);
    font-family: var(--fuente-parrafo);
    font-size: 1.1rem;
    margin-top: 1rem;
}
.btn-more:hover {
    background-color: var(--color-azul-hover);
    color: var(--color-texto-sobre-oscuro);
}

.cta-professional {
    background-color: var(--color-oscuro-fuerte);
    color: var(--color-texto-sobre-oscuro);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 2rem;
    margin: 40px auto 0;
    padding: 3rem;
}
.cta-professional h2 {
    font-family: var(--fuente-titulo);
    color: var(--color-texto-sobre-oscuro);
    font-size: 2.5rem;
    line-height: 3rem
}

.extra-info-professional {
    display: flex;
    flex-direction: column;
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-sobre-oscuro);
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 600px;
    gap: 1rem;
}

.extra-info-professional a {
    background-color: var(--color-fondo-principal);
    border-radius: var(--borde-redondeado);
    padding: 0.625rem 0.9375rem;
    color: var(--color-texto-principal);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    width: 30%;
    text-align: start;
}

.extra-info-professional a:hover {
    background-color: var(--color-azul-hover);
    color: var(--color-texto-sobre-oscuro);
}

.faq-section {
    background-color: var(--color-fondo-contenedor);
    border-radius: 1rem;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 1rem 2rem 2rem;
}
.faq-section h2 {
    font-family: var(--fuente-titulo);
    color: var(--color-texto-principal);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.contenedor-faq {
    interpolate-size: allow-keywords;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    gap: 1rem;
    text-align: left;
    width: 70%;
}

.contenedor-faq details {
    background-color: var(--color-oscuro-fuerte);
    color: var(--color-texto-sobre-oscuro);
    border-radius: var(--borde-redondeado);
    overflow: clip;
    transition: background-color 475ms ease, color 475ms ease;
}

.contenedor-faq details[open] {
    background-color: var(--color-fondo-principal);
    color: var(--color-texto-principal);
}

.contenedor-faq summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    font-family: var(--fuente-parrafo);
    font-weight: 600;
    line-height: 1.35;
    list-style: none;
}

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

.contenedor-faq .icon {
    width: 0;
    height: 0;
    border-left: 0.7rem solid transparent;
    border-right: 0.7rem solid transparent;
    border-top: 1.2rem solid currentColor;
    flex-shrink: 0;
    transition: transform 475ms ease;
}

.contenedor-faq details[open] summary .icon {
    transform: rotate(180deg);
}

.contenedor-faq details::details-content {
    height: 0;
    overflow: hidden;
    padding: 0 1.25rem;
    transition: background-color 475ms, content-visibility 475ms allow-discrete, height 475ms, padding 475ms;
}

.contenedor-faq details[open]::details-content {
    height: auto;
    padding: 0 1.25rem 1rem;
}

.contenedor-faq details p {
    margin: 0;
    font-family: var(--fuente-parrafo);
    line-height: 1.6;
}


footer {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background-color: var(--color-oscuro-fuerte);
    margin-top: 40px;
    padding: var(--espaciado-medio);
    text-align: center;
    font-family: var(--fuente-parrafo);
    color: var(--color-texto-sobre-oscuro);
    font-size: 0.9rem;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--color-texto-sobre-oscuro);
}

.footer-menu a {
    text-decoration: none;
    color: var(--color-texto-sobre-oscuro);
    font-family: var(--fuente-parrafo);
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--borde-redondeado);
    transition: background-color .2s ease, color .2s ease;
}

.footer-menu a:hover {
    color: var(--color-azul-hover);
}

.footer-logo {
    font-family: var(--fuente-titulo);
    font-weight: 700;
    font-size: 2rem;
    color: var(--color-texto-sobre-oscuro);
}

footer .footer-logo a {
    color: var(--color-texto-sobre-oscuro);
    text-decoration: none;
}




/* Responsive */
@media (max-width: 900px) {
    .main-nav {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
        padding: 0.75rem 0;
        border-top: 1px solid var(--color-borde-suave);
        display: none;
    }

    .main-nav.is-open .nav-links {
        display: flex;
    }

    .palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        padding: 0.5rem;
    }

    #ejemplo-visual {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .preview-content {
        text-align: center;
    }

    .preview-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .preview-content .btn-control {
        margin: 0 auto;
        display: inline-block;
    }

    .fundamentos-section {
        max-width: 90%;
        gap: 0px;
    }

    .fundamentos-content {
        max-width: 100%;
        gap: 0.2rem;
        text-align: center;
    }

    .btn-more {
        width: 60%;
        margin: 0.5rem auto;
        min-width: 200px;
    }
    .fundamentos-img {
        width: 50%;
        margin-bottom: 0.5rem;
    }
    .cta-professional {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
        padding: 1rem 0.5rem;
        margin: 0 0;
    }
    .extra-info-professional a{
        max-width: 100%;
        min-width: 170px;
        text-align: center;
        align-items: center;
        text-align: center;
        margin: 0 auto;
    }
    .contenedor-faq {
        width: 100%;
}

}

@media (max-width: 768px) {
    .palette-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        padding: 0.5rem;
    }

    .color-card {
        min-height: 260px;
    }

    .color-preview {
        min-height: 110px;
    }

    .color-meta {
        min-height: 150px;
    }

    .palette-panel {
        padding: 0.5rem;
    }

    #generador h1 {
        max-width: 80%;
        margin: 0 auto;
        line-height: 1.1;
        margin-bottom: 12px;
    }

    .mockup-shell {
        min-height: 340px;
    }

    .saved-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .saved-swatches {
        grid-column: 1;
        grid-row: auto;
    }

    .saved-meta {
        grid-column: 1;
        grid-row: auto;
    }

    .saved-actions {
        grid-column: 1;
        grid-row: auto;
        flex-direction: row;
    }

    .saved-delete-btn,
    .saved-download-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .controls {
        display: grid;
        gap: 10px;
        justify-items: center;
    }

    .control-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-option {
        flex: 1 1 auto;
        font-size: 0.9rem;
    }

    .btn-control-generar,
    .btn-control-guardar {
        width: 100%;
        max-width: 260px;
        font-size: 1rem;
    }

    .palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .palette-toast {
        width: min(92vw, 360px);
        max-width: 92vw;
        text-align: center;
    }

    footer {
        flex-direction: column;
        gap: 12px;
    }

    footer .footer-logo {
        order: 1;
    }

    footer .footer-menu {
        order: 2;
    }

    footer p {
        order: 3;
    }
    


    footer .footer-menu {
        justify-content: center;
        flex-direction: column;
    }
}

@keyframes girar {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}