.dsm-container {
    width: min(
        calc(100% - (var(--dsm-space-4) * 2)),
        var(--dsm-container-width)
    );
    margin-inline: auto;
}

.dsm-site-header {
    padding-block: var(--dsm-space-4);
    background: var(--dsm-color-surface);
    border-bottom: 1px solid var(--dsm-color-border);
}

.dsm-site-brand {
    color: var(--dsm-color-primary);
    font-size: var(--dsm-font-size-xl);
    font-weight: 800;
    text-decoration: none;
}

.dsm-site-main {
    min-height: calc(100vh - 150px);
}

.dsm-page {
    width: 100%;
}

.dsm-page__content {
    width: 100%;
}

.dsm-site-footer {
    padding-block: var(--dsm-space-5);
    color: var(--dsm-color-text-muted);
    background: var(--dsm-color-surface);
    border-top: 1px solid var(--dsm-color-border);
}

.dsm-site-footer p {
    margin: 0;
}


/* ==========================================================
   CABECERA PRINCIPAL
   ========================================================== */

.dsm-header-main {
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: var(--dsm-space-5);
}

.dsm-header-brand {
    flex: 0 0 auto;
}

.dsm-site-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--dsm-space-3);

    color: var(--dsm-color-primary);
    font-size: var(--dsm-font-size-xl);
    font-weight: 800;
    text-decoration: none;
}

.dsm-site-logo {
    width: auto;
    max-width: 180px;
    max-height: 54px;
}

.dsm-site-title {
    white-space: nowrap;
}

.dsm-primary-navigation {
    flex: 1 1 auto;
}

.dsm-primary-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--dsm-space-4);

    margin: 0;
    padding: 0;

    list-style: none;
}

.dsm-primary-menu a {
    font-size: var(--dsm-font-size-sm);
    font-weight: 700;
    text-decoration: none;
}

.dsm-header-actions {
    display: flex;
    align-items: center;
    gap: var(--dsm-space-4);
}

.dsm-header-action {
    font-size: var(--dsm-font-size-sm);
    font-weight: 700;
    text-decoration: none;
}

.dsm-navigation-toggle {
    display: none;

    padding: var(--dsm-space-2);
    color: var(--dsm-color-primary);
    background: transparent;

    border: 0;

    font-size: var(--dsm-font-size-xl);
    cursor: pointer;
}


/* ==========================================================
   CABECERA RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {
    .dsm-header-main {
        position: relative;
        flex-wrap: wrap;
    }

    .dsm-header-brand {
        flex: 1 1 auto;
    }

    .dsm-navigation-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dsm-primary-navigation {
        display: none;
        flex: 0 0 100%;
        order: 4;
    }

    .dsm-primary-navigation--open {
        display: block;
    }

    .dsm-primary-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 0;

        padding-block: var(--dsm-space-3);
    }

    .dsm-primary-menu a {
        display: block;
        padding: var(--dsm-space-3) 0;
    }
}

@media (max-width: 600px) {
    .dsm-site-title {
        font-size: var(--dsm-font-size-lg);
    }

    .dsm-header-actions {
        flex: 0 0 100%;
        justify-content: space-between;
        order: 3;
    }
}


/* ==========================================================
   CABECERA MÓVIL - AJUSTE FINAL
   ========================================================== */

@media (max-width: 600px) {

    .dsm-site-header {
        padding-block: 10px;
    }

    .dsm-header-main {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            auto;
        align-items: center;
        gap: 10px;

        min-height: 0;
    }

    .dsm-header-brand {
        min-width: 0;
    }

    .dsm-site-brand {
        max-width: 100%;
        min-width: 0;
    }

    .dsm-site-title {
        overflow: hidden;
        font-size: 1.05rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dsm-site-logo {
        max-width: 140px;
        max-height: 42px;
    }

    .dsm-navigation-toggle {
        grid-column: 2;
        grid-row: 1;

        width: 42px;
        height: 42px;
        padding: 0;

        border: 1px solid var(--dsm-color-border);
        border-radius: 10px;

        font-size: 1.25rem;
    }

    .dsm-primary-navigation {
        grid-column: 1 / -1;
        grid-row: 3;

        width: 100%;
    }

    .dsm-header-actions {
        grid-column: 1 / -1;
        grid-row: 2;

        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        gap: 10px;
    }

    .dsm-header-action {
        font-size: 0.85rem;
    }

    .dsm-header-actions .dsm-button {
        min-height: 38px;
        padding: 7px 14px;
        font-size: 0.85rem;
    }

    .dsm-primary-menu {
        margin-top: 8px;
        padding-top: 8px;

        border-top: 1px solid var(--dsm-color-border);
    }
}


/* ==========================================================
   PIE DE PÁGINA
   ========================================================== */

.dsm-site-footer {
    margin-top: var(--dsm-space-7);
    padding-block: var(--dsm-space-7);

    background: var(--dsm-color-primary);
    color: var(--dsm-color-text-inverse);
}

.dsm-site-footer__grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(180px, 1fr)
        minmax(180px, 1fr);

    gap: var(--dsm-space-6);
}

.dsm-site-footer__name,
.dsm-site-footer__heading {
    display: block;
    margin-bottom: var(--dsm-space-3);
}

.dsm-site-footer__text,
.dsm-site-footer__copyright {
    margin:
        0
        0
        var(--dsm-space-2);
}

.dsm-site-footer a {
    color: inherit;
}

.dsm-site-footer__legal ul {
    display: grid;
    gap: var(--dsm-space-2);

    margin: 0;
    padding: 0;

    list-style: none;
}

.dsm-site-footer__legal a {
    text-decoration: none;
}

.dsm-site-footer__legal a:hover,
.dsm-site-footer__legal a:focus-visible {
    text-decoration: underline;
}

.dsm-site-footer__social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dsm-space-2);
}

.dsm-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding:
        var(--dsm-space-2)
        var(--dsm-space-3);

    border: 1px solid currentColor;
    border-radius: 999px;

    text-decoration: none;
}

.dsm-social-link:hover,
.dsm-social-link:focus-visible {
    background: var(--dsm-color-surface);
    color: var(--dsm-color-primary);
}


/* ==========================================================
   PIE DE PÁGINA - RESPONSIVE
   ========================================================== */

@media (max-width: 800px) {

    .dsm-site-footer__grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .dsm-site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {

    .dsm-site-footer {
        padding-block: var(--dsm-space-6);
    }

    .dsm-site-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--dsm-space-5);
    }

    .dsm-site-footer__brand {
        grid-column: auto;
    }
}


/* ==========================================================
   CABECERA - FAVORITOS
   ========================================================== */

.dsm-header-action--favorites {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    color: var(--dsm-color-primary);

    border-radius: 50%;

    text-decoration: none;

    transition:
        color var(--dsm-transition-fast),
        background-color var(--dsm-transition-fast),
        transform var(--dsm-transition-fast);
}

.dsm-header-favorites-icon {
    display: block;

    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dsm-header-action--favorites:hover,
.dsm-header-action--favorites:focus-visible {
    color: var(--dsm-color-primary);
    background: var(--dsm-color-secondary);

    transform: translateY(-1px);
}


/* ==========================================================
   CABECERA - ESTADO DE FAVORITOS
   ========================================================== */

.dsm-header-action--favorites {
    position: relative;
}

.dsm-header-action--favorites.is-active
.dsm-header-favorites-icon {
    fill: currentColor;
}

.dsm-header-favorites-count {
    position: absolute;
    top: 1px;
    right: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    color: var(--dsm-color-text-inverse);
    background: var(--dsm-color-accent);

    border: 2px solid var(--dsm-color-surface);
    border-radius: 999px;

    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}


/* ==========================================================
   HEADER - BOTÓN MI CUENTA
   ========================================================== */

.dsm-header-actions
.dsm-button--primary {
    color:
        var(--dsm-color-text-inverse);

    background:
        var(--dsm-color-primary);

    border-color:
        var(--dsm-color-primary);
}

.dsm-header-actions
.dsm-button--primary:hover,
.dsm-header-actions
.dsm-button--primary:focus-visible {
    color:
        var(--dsm-color-text-inverse);

    background:
        var(--dsm-color-primary-hover);

    border-color:
        var(--dsm-color-primary-hover);
}


/* ==========================================================
   DSM DIRECTOS - HEADER
   ========================================================== */

.dsm-header-action--directs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dsm-header-directs-icon {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
