/* ═══════════════════════════════════════
   LUMO — Homepage Sections
   ═══════════════════════════════════════ */

/* ── Popular Categories Carousel ── */
.home-cat-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px var(--content-padding-x, 32px);
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.home-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.home-cat-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--baseblack-500);
    margin: 0;
}
.home-cat-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--baseblack-500);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    transition: color .15s;
}
.home-cat-view-all:hover { color: #FD7200; }

/* Carousel wrapper — viewport is full width, arrows float on top */
.home-cat-carousel {
    position: relative;
    width: 100%;
}

.home-cat-viewport {
    overflow: hidden;
    width: 100%;
}

.home-cat-track {
    display: flex;
    gap: 16px;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Category card — no background, just icon + name */
.home-cat-card {
    flex: 0 0 calc((100% - 48px) / 4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--baseblack-500);
    cursor: pointer;
    user-select: none;
}

/* Square icon — full image, no background */
.home-cat-icon-wrap {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.home-cat-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.home-cat-icon-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-200);
}

.home-cat-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: var(--baseblack-500);
    line-height: 1.35;
    word-break: break-word;
}

/* Nav arrows — float on top of the cards */
.home-cat-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--grey-200);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--baseblack-500);
    transition: border-color .15s, background .15s, box-shadow .15s, opacity .2s, transform .2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
#homeCatPrev { left: 8px; }
#homeCatNext { right: 8px; }

.home-cat-nav:hover:not(:disabled) {
    border-color: #FD7200;
    color: #FD7200;
    background: #fff;
    box-shadow: 0 4px 16px rgba(253, 114, 0, .22);
}
.home-cat-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

/* Loading / empty state */
.home-cat-skeleton {
    display: flex;
    gap: 16px;
    flex: 1;
}
.home-cat-skeleton-item {
    flex: 0 0 calc((100% - 48px) / 4);
    height: 160px;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-50) 50%, var(--grey-100) 75%);
    background-size: 200% 100%;
    animation: catShimmer 1.4s infinite;
}
@keyframes catShimmer { to { background-position: -200% 0; } }

/* ═══════════════════════════════════════
   NEW PRODUCTS SECTION
   ═══════════════════════════════════════ */
.home-new-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px var(--content-padding-x, 32px);
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.home-new-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.home-new-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--baseblack-500);
    margin: 0;
}

/* Products carousel wrapper */
.home-products-carousel {
    position: relative;
    width: 100%;
}
.home-products-viewport {
    overflow: hidden;
    width: 100%;
}
.home-products-track {
    display: flex;
    gap: 16px;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
/* Each product card in track */
.home-products-track .home-product-card {
    flex: 0 0 calc((100% - 48px) / 4);
}
/* Nav buttons positioned same as categories */
#homeNewPrev { left: 8px; }
#homeNewNext { right: 8px; }
/* Also keep old grid for the skeleton */
.home-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

/* ── Product card (same as catalog) ── */
.home-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--grey-100);
}
.home-product-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}
.home-product-card .product-card-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--grey-50);
    overflow: hidden;
}
.home-product-card .product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.home-product-card:hover .product-card-image img { transform: scale(1.04); }
.home-product-card .product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-200);
}
.home-product-card .product-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}
.home-product-card .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1.4;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.home-product-card .badge-new  { background: #16a34a; color: #fff; }
.home-product-card .badge-sale { background: var(--red-500, #f2461d); color: #fff; }
.home-product-card .product-card-wishlist {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
    transition: transform .18s;
    backdrop-filter: blur(4px);
    z-index: 2;
    padding: 0;
}
.home-product-card .product-card-wishlist:hover { transform: scale(1.12); }
.home-product-card .product-card-wishlist.liked svg { fill: #FD7200; stroke: #FD7200; }

.home-product-card .product-card-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.home-product-card .product-card-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--grey-400, #aaa);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.home-product-card .product-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--baseblack-500);
    line-height: 1.35;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-product-card .product-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.home-product-card .price-current {
    font-size: 17px;
    font-weight: 800;
    color: var(--baseblack-500);
    white-space: nowrap;
}
.home-product-card .price-old {
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-400, #aaa);
    text-decoration: line-through;
    white-space: nowrap;
}
.home-product-card .product-card-basket {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #FD7200;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}
.home-product-card .product-card-basket:hover { opacity: .88; }
.home-product-card .product-card-basket img {
    width: 36px; height: 36px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

/* Skeleton */
.home-products-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}
.home-products-skeleton-item {
    border-radius: 12px;
    aspect-ratio: 1;
    background: linear-gradient(90deg, var(--grey-100, #ececec) 25%, var(--grey-50, #f3f3f3) 50%, var(--grey-100, #ececec) 75%);
    background-size: 200% 100%;
    animation: catShimmer 1.4s infinite;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .home-cat-card { flex: 0 0 calc((100% - 16px) / 2); }
    .home-cat-skeleton-item { flex: 0 0 calc((100% - 16px) / 2); }
    .home-cat-title { font-size: 22px; }
    .home-new-title { font-size: 22px; }
    .home-products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .home-products-skeleton { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .home-products-track { gap: 12px; }
    .home-products-track .home-product-card { flex: 0 0 calc((100% - 12px) / 2); }
}
@media (max-width: 700px) {
    .home-cat-section { padding: 28px 14px; }
    .home-cat-title { font-size: 20px; }
    .home-cat-card { flex: 0 0 calc((100% - 10px) / 2); gap: 8px; }
    .home-cat-name { font-size: 13px; }
    .home-cat-track { gap: 10px; }
    .home-cat-nav { width: 32px; height: 32px; }
    #homeCatPrev { left: 4px; }
    #homeCatNext { right: 4px; }
    .home-cat-skeleton-item { flex: 0 0 calc((100% - 10px) / 2); height: 140px; }

    .home-new-section { padding: 28px 14px; }
    .home-new-title { font-size: 20px; }
    .home-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .home-products-skeleton { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .home-products-track { gap: 10px; }
    .home-products-track .home-product-card { flex: 0 0 calc((100% - 10px) / 2); }
    .home-product-card .product-card-name { font-size: 12px; }
    .home-product-card .price-current { font-size: 14px; }
    .home-product-card .product-card-info { padding: 10px 10px 12px; }
    .home-product-card .product-card-basket { font-size: 11px; height: 36px; }
    .home-product-card .product-card-basket img { width: 26px; height: 26px; }
    #homeNewPrev { left: 4px; }
    #homeNewNext { right: 4px; }
}

/* ═══════════════════════════════════════
   MOBILE (≤ 768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    /* Categories: show 3 per view */
    .home-cat-card { flex: 0 0 calc((100% - 20px) / 3); gap: 6px; }
    .home-cat-skeleton-item { flex: 0 0 calc((100% - 20px) / 3); height: 110px; }
    .home-cat-name { font-size: 12px; }
    .home-cat-view-all { font-size: 14px; }

    /* Mobile 2×2 product grid */
    .home-mobile-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
    }

    /* Mobile pagination */
    .home-mobile-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin-top: 16px;
    }
    .hm-pag-prev,
    .hm-pag-next {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1.5px solid var(--grey-200);
        background: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--baseblack-500);
        box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
        transition: border-color .15s, color .15s;
        padding: 0;
        flex-shrink: 0;
    }
    .hm-pag-prev:hover:not(:disabled),
    .hm-pag-next:hover:not(:disabled) { border-color: #FD7200; color: #FD7200; }
    .hm-pag-prev:disabled,
    .hm-pag-next:disabled { opacity: 0.3; pointer-events: none; }
    .hm-pag-info {
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--baseblack-500);
        min-width: 44px;
        text-align: center;
    }

    /* Product card tweaks inside mobile grid */
    .home-mobile-grid .home-product-card .product-card-name { font-size: 12px; }
    .home-mobile-grid .home-product-card .price-current { font-size: 14px; }
    .home-mobile-grid .home-product-card .product-card-info { padding: 10px 10px 12px; }
    .home-mobile-grid .home-product-card .product-card-basket { font-size: 11px; height: 36px; }
    .home-mobile-grid .home-product-card .product-card-basket img { width: 26px; height: 26px; }
}
