/*
 * Cremitas de Leche Cubanas
 * Reglas exclusivas para escritorio.
 * El diseño móvil queda fuera de este archivo.
 */

@media (min-width: 768px) {

    :root {
        --desktop-frame-width: min(
            92vw,
            calc(
                (
                    100dvh
                    - var(--header-height)
                    - var(--footer-height)
                ) * 1.7768331562
            )
        );
    }

    /*
     * MARCO GENERAL DE LA PORTADA
     * Header, portada y footer comparten el mismo ancho.
     */
    .site-header,
    body:has(.hero__picture) main,
    .site-footer {
        width: var(--desktop-frame-width) !important;
        max-width: var(--desktop-frame-width) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body:has(.hero__picture) main {
        position: relative !important;
        height: 100% !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        overflow: hidden !important;
    }

    body:has(.hero__picture) .hero__picture {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body:has(.hero__picture) .hero__background {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    .site-header > .container,
    .site-footer > .container {
        width: 100% !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .site-header .header,
    .site-footer .footer {
        width: 100% !important;
    }

    .site-header .logo,
    .site-footer {
        text-align: center;
    }

    /*
     * PÁGINA DE PEDIDO
     * Puede crecer verticalmente y usar scroll cuando sea necesario.
     */
    body:has(.order-page) {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        grid-template-rows:
            var(--header-height)
            auto
            var(--footer-height) !important;
    }

    body:has(.order-page) main {
        min-height: calc(
            100dvh
            - var(--header-height)
            - var(--footer-height)
        ) !important;
        overflow: visible !important;
    }

    body:has(.order-page) .order-page {
        min-height: calc(
            100dvh
            - var(--header-height)
            - var(--footer-height)
        ) !important;
        height: auto !important;
        align-items: start !important;
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    body:has(.order-page) .order-card {
        width: min(100%, 32rem) !important;
        height: auto !important;
        margin-inline: auto !important;
        padding-bottom: 2.25rem !important;
    }

    body:has(.order-page) .site-footer {
        position: relative !important;
        margin-top: 0 !important;
    }

    /*
     * Botón final.
     * IMPORTANTE:
     * aquí NO se define display.
     * El atributo HTML hidden controla si existe visualmente.
     */
    body:has(.order-page) .order-whatsapp {
        width: max-content !important;
        min-width: 15rem !important;
        max-width: calc(100% - 2rem) !important;
        min-height: 3rem !important;
        margin: 1.6rem auto 0 !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}
