/* ==========================================================================
   FORMA D · ESCRITORIO
   Módulo independiente. Todas las reglas quedan encerradas en .d-desktop.
   ========================================================================== */

.catalogo-presentacion--d-escritorio {
    display: none;
}

@media (min-width: 681px) {
    body[data-forma-escritorio="d"] .catalogo-presentacion--d-tienda {
        display: none !important;
    }

    body[data-forma-escritorio="d"] .catalogo-presentacion--d-escritorio {
        display: block;
    }

    body[data-forma-escritorio="d"] .hero {
        display: none;
    }

    body[data-forma-escritorio="d"] #catalogo {
        width: 100%;
        max-width: none;
        padding-inline: clamp(24px, 2.8vw, 52px);
    }

    body[data-forma-escritorio="d"] #catalogo > .herramientas {
        margin: 16px 0 0;
    }

    .d-desktop {
        min-width: 0;
        padding: clamp(24px, 2.8vw, 44px) 0 96px;
    }

    .d-desktop *,
    .d-desktop *::before,
    .d-desktop *::after {
        box-sizing: border-box;
    }

    .d-desktop__header {
        min-width: 0;
        display: grid;
        gap: 12px;
        margin-bottom: clamp(26px, 2.4vw, 38px);
    }

    .d-desktop__breadcrumbs {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--color-catalogo-subtitulo-principal);
        font-size: 12px;
        font-weight: 750;
    }

    .d-desktop__breadcrumbs svg {
        width: 13px;
        height: 13px;
        flex: 0 0 auto;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .d-desktop__breadcrumbs strong {
        min-width: 0;
        overflow: hidden;
        color: var(--color-catalogo-texto-principal);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .d-desktop__heading-row {
        min-width: 0;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 28px;
    }

    .d-desktop__heading-row h2 {
        min-width: 0;
        margin: 0;
        color: var(--color-catalogo-texto-principal-grande);
        font-size: clamp(30px, 2.7vw, 44px);
        font-weight: 900;
        line-height: 1.08;
        letter-spacing: -.035em;
    }

    .d-desktop__heading-row h2 span {
        font-size: .72em;
        font-weight: 720;
        letter-spacing: -.02em;
    }

    .d-desktop__toolbar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .d-desktop__pill,
    .d-desktop__sort {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--color-catalogo-categoria-boton-borde);
        border-radius: 999px;
        padding: 0 14px;
        background: var(--color-catalogo-categoria-boton-fondo);
        color: var(--color-catalogo-categoria-boton-texto);
        font-size: 12px;
        font-weight: 850;
    }

    .d-desktop__pill svg,
    .d-desktop__sort svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .d-desktop__sort {
        padding-right: 11px;
    }

    .d-desktop__sort select {
        max-width: 180px;
        border: 0;
        outline: 0;
        appearance: none;
        -webkit-appearance: none;
        padding: 0 24px 0 0;
        background: transparent;
        color: inherit;
        font: inherit;
        cursor: pointer;
    }

    .d-desktop__sort select option {
        background: var(--color-catalogo-tarjeta-fondo);
        color: var(--color-catalogo-tarjeta-nombre-texto);
    }

    .d-desktop__layout {
        --d-desktop-sidebar-width: clamp(208px, 14vw, 252px);
        min-width: 0;
        width: 100%;
        display: grid;
        grid-template-columns: var(--d-desktop-sidebar-width) minmax(0, 1fr);
        align-items: start;
        gap: clamp(26px, 2.7vw, 48px);
    }

    .d-desktop__layout--without-sidebar,
    .d-desktop__layout.is-sidebar-collapsed {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .d-desktop__layout.is-sidebar-collapsed .d-desktop__sidebar {
        display: none;
    }

    .d-desktop__sidebar {
        min-width: 0;
        width: 100%;
        position: sticky;
        top: calc(var(--headerfixed-alto, 82px) + var(--catalogo-top-alto, 0px) + var(--catalogo-cinta-visible-alto, 0px) + 18px);
        max-height: calc(100vh - var(--headerfixed-alto, 82px) - var(--catalogo-top-alto, 0px) - var(--catalogo-cinta-visible-alto, 0px) - 36px);
        overflow-x: hidden;
        overflow-y: auto;
        padding-right: 8px;
        scrollbar-width: thin;
    }

    .d-desktop-filter {
        margin: 0;
        padding: 0 4px 20px 0;
        border: 0;
        border-bottom: 1px solid var(--color-catalogo-tarjeta-borde);
    }

    .d-desktop-filter + .d-desktop-filter {
        padding-top: 17px;
    }

    .d-desktop-filter h3,
    .d-desktop-filter summary {
        margin: 0;
        color: var(--color-catalogo-tarjeta-nombre-texto);
        font-size: 14px;
        font-weight: 900;
        line-height: 1.25;
    }

    .d-desktop-filter summary {
        min-height: 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        list-style: none;
        cursor: pointer;
    }

    .d-desktop-filter summary::-webkit-details-marker {
        display: none;
    }

    .d-desktop-filter summary::after {
        content: '';
        width: 8px;
        height: 8px;
        flex: 0 0 auto;
        border-right: 1.8px solid currentColor;
        border-bottom: 1.8px solid currentColor;
        transform: rotate(45deg) translateY(-2px);
        transition: transform .18s ease;
    }

    .d-desktop-filter[open] summary::after {
        transform: rotate(225deg) translate(-2px, -2px);
    }

    .d-desktop-filter__categories {
        display: grid;
        gap: 3px;
        margin-top: 11px;
    }

    .d-desktop-filter__category {
        width: 100%;
        min-width: 0;
        min-height: 35px;
        border: 0;
        border-radius: 8px;
        padding: 7px 9px;
        background: transparent;
        color: var(--color-catalogo-categoria-boton-texto);
        text-align: left;
        font-size: 12px;
        font-weight: 780;
        line-height: 1.25;
    }

    .d-desktop-filter__category.is-active {
        background: var(--color-catalogo-categoria-seleccionada-fondo);
        color: var(--color-catalogo-categoria-seleccionada-texto);
    }

    .d-desktop-filter__options {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin-top: 11px;
    }

    .d-desktop-filter__option {
        min-width: 52px;
        min-height: 34px;
        border: 1px solid var(--color-catalogo-categoria-boton-borde);
        border-radius: 8px;
        padding: 6px 9px;
        background: var(--color-catalogo-categoria-boton-fondo);
        color: var(--color-catalogo-categoria-boton-texto);
        font-size: 11px;
        font-weight: 820;
        text-align: center;
    }

    .d-desktop-filter__option.is-active {
        border-color: var(--color-catalogo-categoria-seleccionada-borde);
        background: var(--color-catalogo-categoria-seleccionada-fondo);
        color: var(--color-catalogo-categoria-seleccionada-texto);
    }

    .d-desktop-filter__clear {
        width: 100%;
        min-height: 39px;
        margin-top: 17px;
        border: 1px solid var(--color-catalogo-categoria-boton-borde);
        border-radius: 10px;
        background: var(--color-catalogo-categoria-boton-fondo);
        color: var(--color-catalogo-categoria-boton-texto);
        font-size: 11px;
        font-weight: 900;
    }

    .d-desktop-filter__clear[hidden] {
        display: none !important;
    }

    .d-desktop__products,
    .d-desktop__grid {
        min-width: 0;
        width: 100%;
    }

    .d-desktop__grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        gap: clamp(30px, 3vw, 52px) clamp(14px, 1.35vw, 24px);
    }

    .d-desktop__layout--without-sidebar .d-desktop__grid,
    .d-desktop__layout.is-sidebar-collapsed .d-desktop__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .d-desktop-card.producto--d-escritorio {
        min-width: 0;
        width: 100%;
        height: auto;
        display: block;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        transform: none !important;
    }

    .d-desktop-card__media {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        background: var(--color-catalogo-tarjeta-imagen-fondo);
    }

    .d-desktop-card__image {
        width: 100%;
        height: 100%;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 0;
        padding: 0;
        background: transparent;
        cursor: pointer;
    }

    .d-desktop-card__image img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center;
        transition: transform .28s ease;
    }

    .d-desktop-card__empty {
        color: var(--color-catalogo-tarjeta-descripcion-texto);
        font-size: 11px;
        font-weight: 760;
    }

    .d-desktop-card__download {
        position: absolute;
        z-index: 3;
        top: 10px;
        right: 10px;
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        padding: 0;
        opacity: 0;
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0,0,0,.15);
        transition: opacity .18s ease, transform .18s ease;
    }

    .d-desktop-card__download svg {
        width: 17px;
        height: 17px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .d-desktop-card__download span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .d-desktop-card__cart {
        position: absolute;
        z-index: 4;
        right: 10px;
        bottom: 10px;
        width: auto;
        min-width: 44px;
        min-height: 44px;
    }

    .d-desktop-card__cart > .d-desktop-card__add {
        width: auto;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 999px;
        padding: 0 14px;
        box-shadow: 0 9px 24px rgba(0,0,0,.2);
    }

    .d-desktop-card__cart > .d-desktop-card__add svg {
        width: 18px;
        height: 18px;
    }

    .d-desktop-card__cart > .d-desktop-card__quantity {
        width: 116px;
        min-width: 116px;
        min-height: 44px;
        grid-template-columns: 36px 44px 36px;
        border-radius: 999px;
        box-shadow: 0 9px 24px rgba(0,0,0,.2);
    }

    .d-desktop-card__body {
        min-width: 0;
        padding: 12px 1px 0;
    }

    .d-desktop-card__meta {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        color: var(--color-catalogo-tarjeta-categoria-texto);
        font-size: 11px;
        font-weight: 850;
        line-height: 1.25;
    }

    .d-desktop-card__meta span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .d-desktop-card__meta small {
        flex: 0 0 auto;
        color: var(--color-catalogo-tarjeta-descripcion-texto);
        font-size: 9px;
        font-weight: 760;
    }

    .d-desktop-card__name {
        width: 100%;
        margin: 5px 0 0;
        overflow: hidden;
        display: -webkit-box;
        border: 0;
        padding: 0;
        background: transparent;
        color: var(--color-catalogo-tarjeta-nombre-texto);
        text-align: left;
        font-size: 15px;
        font-weight: 900;
        line-height: 1.32;
        cursor: pointer;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .d-desktop-card__description,
    .d-desktop-card__attributes {
        margin: 4px 0 0;
        overflow: hidden;
        color: var(--color-catalogo-tarjeta-descripcion-texto);
        font-size: 11px;
        line-height: 1.42;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .d-desktop-card__attributes {
        font-size: 10px;
        font-weight: 700;
    }

    .d-desktop-card__footer {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
    }

    .d-desktop-card__footer strong {
        color: var(--color-catalogo-tarjeta-precio-texto);
        font-size: 15px;
        font-weight: 900;
        font-variant-numeric: tabular-nums;
    }

    .d-desktop-card__view {
        min-height: 32px;
        border-radius: 999px;
        padding: 6px 11px;
        font-size: 10px;
        font-weight: 850;
    }

    @media (hover:hover) and (pointer:fine) {
        .d-desktop__pill:hover,
        .d-desktop__sort:hover,
        .d-desktop-filter__option:hover,
        .d-desktop-filter__clear:hover,
        .d-desktop-filter__category:hover:not(.is-active) {
            border-color: var(--color-catalogo-categoria-hover-borde);
            background: var(--color-catalogo-categoria-hover-fondo);
            color: var(--color-catalogo-categoria-hover-texto);
        }

        .d-desktop-card:hover .d-desktop-card__image img,
        .d-desktop-card:focus-within .d-desktop-card__image img {
            transform: scale(1.025);
        }

        .d-desktop-card:hover .d-desktop-card__download,
        .d-desktop-card:focus-within .d-desktop-card__download {
            opacity: 1;
            transform: translateY(0);
        }

        .d-desktop-card__name:hover {
            color: var(--color-catalogo-tarjeta-categoria-texto);
        }
    }
}


@media (min-width: 681px) and (max-width: 1120px) {
    .d-desktop__heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .d-desktop__toolbar {
        width: 100%;
        justify-content: space-between;
    }

    .d-desktop__layout {
        --d-desktop-sidebar-width: 194px;
        gap: 24px;
    }

    .d-desktop__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .d-desktop__layout--without-sidebar .d-desktop__grid,
    .d-desktop__layout.is-sidebar-collapsed .d-desktop__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
