.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    max-width: 1700px;
    margin-inline: auto;
    padding: 2rem clamp(1rem, 3vw, 2rem);
    align-items: flex-start;
}

/* ================= SIDEBAR DESKTOP ================= */

.sidebar {
    position: sticky;
    top: 90px;
    z-index: 50;
}

.sidebar__scroll {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .35) transparent;
}

.sidebar__scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .25);
    border-radius: 6px;
}

.sidebar__scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, .4);
}

.sidebar__list {
    display: flex;
    flex-direction: column;
}

.sidebar__item {
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar__item:hover {
    background-color: var(--color-bg);
}

.sidebar__name {
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-text);
}

.sidebar__icon {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

/* ================= DROPDOWN DESKTOP ================= */

#sidebar-dropdown-root {
    position: fixed;
    z-index: 9999;
    display: none;
}

.sidebar__dropdown {
    width: 320px;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: 1rem;
}

/* ================= PRODUCTOS ================= */

.products-wrapper,
.products {
    position: relative;
    z-index: 1;
}

.products {
    margin-left: 1rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: clamp(.75rem, 2vw, 1.5rem);
}

.product {
    position: relative;
    min-width: 0;
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: box-shadow var(--transition-base);
}

.product:hover {
    box-shadow: var(--shadow-md);
}

.product__favorite {
    position: absolute;
    top: .6rem;
    left: .6rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

.product img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.product h3 {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product__description {
    font-size: .85rem;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.price {
    font-weight: 600;
    color: var(--color-text);
}

.product__actions {
    margin-top: auto;
    display: flex;
}

.product__actions button {
    width: 100%;
    padding: .65rem .75rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 500;
}

.sidebar__all {
    display: block;
    margin-top: .5rem;
    width: 100%;
    border-top: 1px solid var(--color-border);
}

/* ================= TABLET + MOBILE ================= */

@media (max-width: 1024px) {

    .layout {
        padding-top: 0;
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: auto;
        width: 100%;
        height: 72px;
        margin-bottom: 1rem;
        overflow: hidden;
    }

    .sidebar__scroll {
        height: 72px;
        max-height: 72px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;

        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar__scroll::-webkit-scrollbar {
        display: none;
    }

    .sidebar__list {
        flex-direction: row;
        align-items: center;
        height: 72px;
        gap: .5rem;
        padding-inline: .75rem;
        border-bottom: 1px solid var(--color-border);
    }

    .sidebar__item {
        flex: 0 0 auto;
        height: 42px;
        padding: 0 1rem;
        border-radius: 999px;
        background-color: var(--color-surface);
        box-shadow: var(--shadow-sm);
        display: flex;
        align-items: center;
    }

    .sidebar__name {
        white-space: nowrap;
        font-size: .85rem;
    }

    .sidebar__icon {
        display: none;
    }

    #sidebar-dropdown-root {
        display: none !important;
    }

    .products {
        margin-left: 0;

    }
}

/* ================= MOBILE ================= */

@media (max-width: 600px) {

    .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
    }

    .product {
        padding: .75rem;
    }

    .product h3 {
        font-size: .9rem;
    }

    .product__description {
        font-size: .8rem;
    }
}

/* ================= EMPTY ================= */

.empty-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.empty-results img {
    max-width: 180px;
    opacity: .7;
}

.empty-results p {
    margin-top: 1rem;
    font-size: 1.5rem;
    color: #666;
}

.category-block {
    margin-bottom: 3rem;
}

.category-block__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    margin-left: .5rem;
    color: var(--color-secondary);
}

.category-block__more {
    margin-top: 1.2rem;
    display: flex;
    justify-content: center;
}

.btn-see-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-surface);
    border-radius: 6px;
    background: var(--color-primary);
    text-decoration: none;
}

.back-icon {
    display: block;
    width: fit-content;
    padding: 5px 15px;
    color: #fff;
    background-color: var(--color-primary);
    border-radius: 5px;
    margin: auto;
    margin-bottom: 2rem;
}

.back-icon:hover {
    opacity: .8;
}


.sidebar__link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}