/* ==========================================================================
   Homepage showcase blocks — slider, categories, discounts, articles,
   why-us and the floating recently-viewed panel.
   Uses the sage / cream design tokens defined in theme.css.
   ========================================================================== */

.home-slider-section,
.home-categories,
.home-discounts,
.home-articles,
.home-why-us {
    padding-block: clamp(1.5rem, 3vw, 2.6rem);
}

/* --- Special products slider --------------------------------------------- */
.home-hero-slider {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: var(--surface-soft);
}

.home-hero-slider .carousel-inner,
.home-hero-slider .carousel-item {
    height: clamp(280px, 42vw, 480px);
}

.home-slide {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
}

.home-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .9s ease;
}

.home-slide:hover .home-slide-img {
    transform: scale(1.03);
}

.home-slide-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(270deg, rgba(18, 26, 21, .78) 0%, rgba(18, 26, 21, .42) 45%, rgba(18, 26, 21, .06) 100%),
        linear-gradient(0deg, rgba(18, 26, 21, .35) 0%, transparent 55%);
}

.home-slide-content {
    position: absolute;
    inset-inline-start: clamp(1.2rem, 5vw, 4rem);
    inset-inline-end: clamp(1.2rem, 5vw, 4rem);
    bottom: clamp(1.2rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 620px;
}

.home-slide-badge {
    align-self: flex-start;
    padding: .32rem .85rem;
    border-radius: 999px;
    background: rgba(185, 139, 78, .92);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}

.home-slide-title {
    font-size: clamp(1.35rem, 3.2vw, 2.35rem);
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.home-slide-desc {
    font-size: clamp(.82rem, 1.4vw, .98rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, .9);
    max-width: 54ch;
}

.home-slide-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: .25rem;
}

.home-slide-prices {
    display: inline-flex;
    align-items: baseline;
    gap: .55rem;
}

.home-slide-old {
    font-size: .9rem;
    color: rgba(255, 255, 255, .6);
    text-decoration: line-through;
}

.home-slide-price {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 800;
    color: #fff;
}

.home-slide-cta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .38);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    transition: background .2s ease, transform .2s ease;
}

.home-slide:hover .home-slide-cta {
    background: rgba(255, 255, 255, .28);
    transform: translateX(-2px);
}

.home-hero-slider .carousel-indicators [data-bs-target] {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .55);
    border: 0;
}

.home-hero-slider .carousel-indicators .active {
    background-color: #fff;
}

.home-hero-slider .carousel-control-prev,
.home-hero-slider .carousel-control-next {
    width: 3.4rem;
}

.home-hero-slider .carousel-control-prev-icon,
.home-hero-slider .carousel-control-next-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .32);
    background-size: 42%;
    backdrop-filter: blur(4px);
}

/* --- Popular categories --------------------------------------------------- */
.home-category-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}

.home-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    color: #fff;
}

.home-category-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.home-category-card:hover .home-category-img {
    transform: scale(1.05);
}

.home-category-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(18, 26, 21, .72) 0%, rgba(18, 26, 21, .18) 55%, transparent 100%);
}

.home-category-body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 1rem 1.1rem;
}

.home-category-name {
    font-size: clamp(.95rem, 1.4vw, 1.1rem);
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}

.home-category-cta {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
}

.home-category-card:hover .home-category-cta {
    color: #fff;
}

/* --- Latest articles ------------------------------------------------------ */
.home-article-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}

.home-article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.home-article-img-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-soft);
}

.home-article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.home-articles .home-article-card:hover .home-article-img {
    transform: scale(1.04);
}

.home-article-title {
    color: var(--bs-heading-color);
    text-decoration: none;
}

.home-article-title:hover {
    color: var(--bs-primary);
}

.home-article-more {
    color: var(--bs-primary);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.home-article-more:hover {
    text-decoration: underline;
}

.home-articles-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

/* --- Why buy from us ------------------------------------------------------ */
.home-why-us-card {
    position: relative;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(1200px 400px at 100% 0%, rgba(232, 243, 239, .9), transparent 60%),
        linear-gradient(120deg, rgba(248, 241, 231, .9), rgba(247, 246, 241, .65));
    box-shadow: var(--shadow-soft);
}

[data-bs-theme=dark] .home-why-us-card {
    background:
        radial-gradient(1200px 400px at 100% 0%, rgba(37, 56, 45, .85), transparent 60%),
        linear-gradient(120deg, rgba(46, 38, 28, .8), rgba(28, 34, 30, .75));
}

.home-why-us-body {
    color: var(--bs-body-color);
    line-height: 1.95;
    font-size: .98rem;
}

.home-why-us-body > :last-child {
    margin-bottom: 0;
}

.home-why-us-body ul,
.home-why-us-body ol {
    padding-inline-start: 1.2rem;
}

.home-why-us-body li {
    margin-bottom: .35rem;
}

/* --- Floating recently viewed box ---------------------------------------- */
.recently-viewed-float {
    position: fixed;
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    max-width: calc(100vw - 32px);
}

.rvf-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 700;
    box-shadow: var(--shadow-nav);
    transition: transform .2s ease, box-shadow .2s ease;
}

.rvf-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.rvf-count {
    min-width: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-size: .72rem;
    line-height: 1.35rem;
    text-align: center;
}

.rvf-panel {
    width: 320px;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-nav);
    overflow: hidden;
}

.rvf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--line);
    font-size: .85rem;
}

.rvf-all {
    color: var(--bs-primary);
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
}

.rvf-list {
    list-style: none;
    margin: 0;
    padding: .4rem;
    max-height: 320px;
    overflow-y: auto;
}

.rvf-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background .2s ease;
}

.rvf-item:hover {
    background: var(--bs-tertiary-bg);
    color: inherit;
}

.rvf-item img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--surface-soft);
}

.rvf-info {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.rvf-name {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 600;
}

.rvf-price {
    font-size: .75rem;
    font-weight: 700;
    color: var(--bs-primary);
}

/* --- Small screens -------------------------------------------------------- */
@media (max-width: 575.98px) {
    .home-hero-slider .carousel-inner,
    .home-hero-slider .carousel-item {
        height: 300px;
    }

    .home-slide-content {
        inset-inline: 1rem;
        bottom: 1rem;
    }

    .home-slide-desc {
        display: none;
    }

    .home-hero-slider .carousel-control-prev,
    .home-hero-slider .carousel-control-next {
        display: none;
    }

    .recently-viewed-float {
        left: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .rvf-panel {
        width: calc(100vw - 24px);
    }
}
