/* ==========================================
   RESPONSIVE
   Dinero y Criterio
   ========================================== */


/* ------------------------------------------
   Seguridad contra overflow horizontal
   ------------------------------------------ */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

main,
section,
.dyc-container {
    min-width: 0;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

pre,
table {
    max-width: 100%;
}


/* ------------------------------------------
   Mobile navigation
   ------------------------------------------ */

.dyc-mobile-menu {
    display: none;
}


@media (max-width: 900px) {

    .dyc-menu,
    .dyc-header-cta {
        display: none;
    }

    .dyc-nav {
        position: relative;
    }

    .dyc-mobile-menu {
        display: block;
        position: relative;
        margin-left: auto;
    }

    .dyc-mobile-menu summary {
        width: 44px;
        height: 44px;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;

        padding: 0;

        border: 1px solid var(--border);
        border-radius: 12px;

        background: var(--surface);

        cursor: pointer;
        list-style: none;
    }

    .dyc-mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .dyc-mobile-menu summary::marker {
        display: none;
        content: "";
    }

    .dyc-mobile-menu summary span {
        display: block;

        width: 19px;
        height: 2px;

        border-radius: 999px;

        background: var(--text);
    }

    .dyc-mobile-menu-panel {
        position: absolute;

        top: calc(100% + 12px);
        right: 0;

        width: min(310px, calc(100vw - 32px));

        display: flex;
        flex-direction: column;

        padding: 10px;

        background: var(--surface);

        border: 1px solid var(--border);
        border-radius: 18px;

        box-shadow: var(--shadow);

        z-index: 1000;
    }

    .dyc-mobile-menu-panel a {
        display: block;

        padding: 12px 14px;

        border-radius: 10px;

        color: var(--text);
        font-size: 15px;
        font-weight: 650;
    }

    .dyc-mobile-menu-panel a:hover {
        background: var(--surface-soft);
    }

    .dyc-mobile-menu-panel .dyc-mobile-menu-cta {
        margin-top: 7px;

        background: var(--dark);
        color: #fff;

        text-align: center;
    }


    /* --------------------------------------
       Grids
       -------------------------------------- */

    .dyc-hero-grid,
    .dyc-method,
    .dyc-book {
        grid-template-columns: 1fr;
    }

    .dyc-routes {
        grid-template-columns: 1fr 1fr;
    }

    .dyc-invest-grid {
        grid-template-columns: 1fr;
    }

    .dyc-three-grid {
        grid-template-columns: 1fr;
    }


    /* --------------------------------------
       Grid children must be allowed to shrink
       -------------------------------------- */

    .dyc-hero-grid > *,
    .dyc-method > *,
    .dyc-book > *,
    .dyc-invest-grid > *,
    .dyc-three-grid > * {
        min-width: 0;
    }


    /* --------------------------------------
       Footer
       -------------------------------------- */

    .dyc-footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }

    .dyc-footer-brand {
        grid-column: 1 / -1;
    }

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

}


/* ==========================================
   PHONE
   ========================================== */

@media (max-width: 580px) {

    .dyc-hero {
        padding-top: 58px;
        padding-bottom: 45px;
    }

    .dyc-hero h1 {
        font-size: clamp(42px, 12vw, 50px);
        line-height: .98;
    }

    .dyc-hero-copy {
        font-size: 18px;
    }


    /* Esto elimina uno de los candidatos
       principales al overflow que vemos
       en tu captura. */

    .dyc-actions {
        width: 100%;

        flex-direction: column;
        align-items: stretch;
    }

    .dyc-actions .dyc-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }


    .dyc-routes {
        grid-template-columns: 1fr;
    }


    .dyc-proof {
        padding: 24px;
    }


    .dyc-eyebrow {
        max-width: 100%;
        white-space: normal;
    }


    /*
     * La rotación visual puede crear overflow
     * aunque la caja original esté dentro.
     */

    .dyc-home-book-cover {
        transform: none;
    }

    .dyc-home-book-cover-link:hover
    .dyc-home-book-cover {
        transform: translateY(-3px);
    }


    /* --------------------------------------
       Footer phone
       -------------------------------------- */

    .dyc-footer {
        margin-top: 65px;
        padding-top: 45px;
    }

    .dyc-footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 34px 25px;
    }

    .dyc-footer-brand {
        grid-column: 1 / -1;
    }


    /* --------------------------------------
       Forms
       -------------------------------------- */

    .dyc-tool-form,
    .dyc-compare-form {
        min-width: 0;
    }

    .dyc-tool-form input,
    .dyc-tool-form select,
    .dyc-compare-form input,
    .dyc-compare-form select {
        width: 100%;
        min-width: 0;
    }

}


/* ==========================================
   VERY SMALL PHONE
   ========================================== */

@media (max-width: 390px) {

    .dyc-brand {
        gap: 9px;
    }

    .dyc-brand-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .dyc-brand span {
        font-size: 17px;
    }

    .dyc-footer-main {
        grid-template-columns: 1fr;
    }

    .dyc-footer-brand {
        grid-column: auto;
    }

}
