/* ==========================================================================
   Tendances & Popularité — mobile-first page treatment
   Loaded after the global theme from the template's page_final_css block.
   ========================================================================== */

.popular-products-page {
    --trend-ink: #17201e;
    --trend-muted: #687673;
    --trend-line: rgba(52, 79, 75, 0.16);
    --trend-surface: rgba(255, 255, 255, 0.92);
    --trend-teal: #234b49;
    --trend-teal-light: #4f8278;
    --trend-clay: #b65034;
    --trend-clay-dark: #8e3825;
    padding-bottom: clamp(2rem, 5vw, 4rem);
    color: var(--trend-ink);
}

body.trends-empty-page .page-wrapper,
body.trends-empty-page .gridded {
    min-height: 0;
}

.trends-breadcrumb {
    margin: 0;
    padding: 0.85rem 0;
}

.trends-breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.8rem;
}

.trends-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

.trends-intro {
    position: relative;
    display: grid;
    padding: clamp(1.25rem, 4vw, 2rem);
    overflow: hidden;
    gap: 1.25rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 16%, rgba(226, 133, 102, 0.32), transparent 15rem),
        linear-gradient(135deg, #173532 0%, #234b49 52%, #315d61 100%);
    box-shadow: 0 24px 60px rgba(24, 64, 68, 0.2);
    isolation: isolate;
}

.trends-intro::after {
    content: "";
    position: absolute;
    right: -5rem;
    bottom: -8rem;
    z-index: -1;
    width: 18rem;
    height: 18rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    box-shadow: 0 0 0 2.4rem rgba(255, 255, 255, 0.025), 0 0 0 5rem rgba(255, 255, 255, 0.018);
}

.trends-intro-copy {
    position: relative;
    z-index: 1;
}

.trends-kicker {
    display: inline-flex;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.65rem;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.trends-kicker i {
    color: #f2aa91;
}

.trends-intro h1 {
    max-width: 48rem;
    margin: 0 0 0.55rem;
    color: #fff !important;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(2.1rem, 8vw, 3.7rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.trends-intro p {
    max-width: 42rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.74) !important;
    font-size: clamp(0.88rem, 2vw, 1rem);
    line-height: 1.55;
}

.trends-intro-meta {
    display: flex;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trends-intro-meta span {
    display: inline-flex;
    padding: 0.38rem 0.55rem;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.67rem;
    font-weight: 700;
}

.trends-intro-meta i {
    color: #b9ded6;
}

.trends-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.trends-metrics span {
    display: flex;
    min-width: 0;
    min-height: 88px;
    padding: 0.85rem;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.trends-metrics strong {
    color: #fff;
    font-size: clamp(1.55rem, 6vw, 2.15rem);
    line-height: 1;
}

.trends-metrics small {
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
}

.trends-toolbar {
    margin: clamp(1rem, 3vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 1.4rem);
    border: 1px solid var(--trend-line);
    border-radius: 19px;
    background: var(--trend-surface);
    box-shadow: 0 16px 42px rgba(35, 72, 78, 0.09);
}

.trends-toolbar-heading {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
    gap: 0.7rem;
}

.trends-toolbar-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    color: #fff;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--trend-teal-light), var(--trend-teal));
    box-shadow: 0 10px 20px rgba(35, 75, 73, 0.18);
}

.trends-toolbar-heading h2 {
    margin: 0;
    color: var(--trend-ink) !important;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.05;
}

.trends-toolbar-heading p {
    margin: 0.18rem 0 0;
    color: var(--trend-muted) !important;
    font-size: 0.75rem;
}

.trends-toolbar-controls {
    display: grid;
    gap: 1rem;
}

.period-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.popular-products-page .period-filters .btn {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 0.7rem;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    color: #445653 !important;
    border: 1px solid rgba(52, 79, 75, 0.2) !important;
    border-radius: 11px !important;
    background: rgba(247, 250, 249, 0.9) !important;
    box-shadow: none !important;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
    transform: none !important;
}

.popular-products-page .period-filters .btn:hover {
    color: var(--trend-teal) !important;
    border-color: rgba(35, 75, 73, 0.42) !important;
    background: #edf5f3 !important;
}

.popular-products-page .period-filters .btn-primary,
.popular-products-page .period-filters .btn[aria-current="page"] {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--trend-clay), var(--trend-clay-dark)) !important;
    box-shadow: 0 10px 22px rgba(142, 56, 37, 0.2) !important;
}

.category-filter {
    display: grid;
    gap: 0.4rem;
    color: #344541 !important;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.category-select-wrap {
    position: relative;
    display: block;
}

.category-select-wrap > i {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    z-index: 1;
    color: var(--trend-teal-light);
    pointer-events: none;
    transform: translateY(-50%);
}

.popular-products-page .category-filter .form-select {
    min-height: 46px;
    padding: 0.7rem 2.4rem 0.7rem 2.45rem;
    color: var(--trend-ink) !important;
    border: 1px solid rgba(52, 79, 75, 0.22) !important;
    border-radius: 12px !important;
    background-color: rgba(248, 251, 250, 0.94) !important;
    box-shadow: none !important;
    font-size: 0.82rem;
    font-weight: 700;
}

.popular-products-page .category-filter .form-select:focus {
    border-color: var(--trend-teal-light) !important;
    box-shadow: 0 0 0 4px rgba(79, 130, 120, 0.13) !important;
}

.popular-products-page .products-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin: 0 0 2rem !important;
}

.popular-products-page .trend-product-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    color: var(--trend-ink);
    border: 1px solid var(--trend-line) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 14px 38px rgba(35, 72, 78, 0.1) !important;
    transform: none !important;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

.popular-products-page .trend-product-card:hover {
    border-color: rgba(35, 75, 73, 0.34) !important;
    box-shadow: 0 20px 46px rgba(35, 72, 78, 0.15) !important;
    transform: translateY(-3px) !important;
}

.trend-card-badges {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 7;
    display: flex;
    max-width: calc(100% - 4.8rem);
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.trend-rank,
.popular-products-page .popularity-badge {
    position: static !important;
    display: inline-flex;
    min-height: 30px;
    padding: 0.38rem 0.55rem !important;
    align-items: center;
    gap: 0.3rem;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 9px !important;
    font-size: 0.7rem !important;
    font-weight: 800;
    line-height: 1;
}

.trend-rank {
    background: rgba(23, 53, 50, 0.9);
    box-shadow: 0 8px 18px rgba(23, 53, 50, 0.2);
    backdrop-filter: blur(10px);
}

.popular-products-page .popularity-badge {
    background: linear-gradient(135deg, var(--trend-clay), var(--trend-clay-dark)) !important;
    box-shadow: 0 8px 18px rgba(142, 56, 37, 0.2) !important;
}

.popular-products-page .product-image-container {
    height: auto !important;
    aspect-ratio: 16 / 10 !important;
    overflow: hidden;
    border-radius: 0 !important;
    background: #e9f0ee !important;
}

.popular-products-page .product-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transform: scale(1.002) !important;
    transition: transform 360ms ease, filter 360ms ease !important;
}

.popular-products-page .trend-product-card:hover .product-image {
    filter: saturate(1.04) contrast(1.02);
    transform: scale(1.035) !important;
}

.popular-products-page .wishlist-corner {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    z-index: 8;
}

.popular-products-page .wishlist-btn {
    position: static !important;
    display: grid;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px;
    padding: 0 !important;
    place-items: center;
    color: var(--trend-teal) !important;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 10px 22px rgba(28, 63, 65, 0.16) !important;
}

.popular-products-page .wishlist-btn:hover,
.popular-products-page .wishlist-btn.active {
    color: #fff !important;
    border-color: var(--trend-clay) !important;
    background: var(--trend-clay) !important;
    transform: translateY(-1px) !important;
}

.popular-products-page .card-body-custom {
    display: flex;
    min-width: 0;
    padding: 1.15rem !important;
    flex: 1;
    flex-direction: column;
    gap: 0.62rem;
}

.popular-products-page .product-title {
    min-height: auto;
    margin: 0 !important;
    color: var(--trend-ink) !important;
    font-family: "Instrument Serif", Georgia, serif !important;
    font-size: clamp(1.3rem, 5vw, 1.55rem) !important;
    font-weight: 600 !important;
    line-height: 1.14 !important;
}

.popular-products-page .stock-indicator,
.popular-products-page .view-stats {
    display: inline-flex !important;
    width: fit-content !important;
    min-height: 29px;
    padding: 0.34rem 0.55rem !important;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9px !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    line-height: 1.1;
}

.popular-products-page .stock-available {
    color: #37685f !important;
    border-color: #c9ddd7 !important;
    background: #eef7f4 !important;
}

.popular-products-page .stock-low {
    color: #805925 !important;
    border-color: #ead09d !important;
    background: #fff5df !important;
}

.popular-products-page .stock-out {
    color: #8e3825 !important;
    border-color: #e7b8a8 !important;
    background: #fff0eb !important;
}

.popular-products-page .price-section {
    display: flex;
    margin: 0.25rem 0 0 !important;
    padding: 0 !important;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.popular-products-page .price-current {
    color: var(--trend-clay-dark) !important;
    font-family: "Plus Jakarta Sans", sans-serif !important;
    font-size: clamp(1.38rem, 6vw, 1.7rem) !important;
    font-weight: 800 !important;
    line-height: 1;
}

.popular-products-page .price-original {
    color: #87928f !important;
    font-size: 0.82rem !important;
}

.popular-products-page .view-stats {
    color: #5f706c !important;
    border: 1px solid rgba(52, 79, 75, 0.13) !important;
    background: rgba(235, 243, 241, 0.72) !important;
}

.popular-products-page .rating-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.popular-products-page .star-rating {
    display: inline-flex;
    gap: 0.1rem;
    color: #c88935;
}

.popular-products-page .rating-count {
    width: auto !important;
    padding: 0 !important;
    color: var(--trend-muted) !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 0.75rem !important;
    font-weight: 700;
}

.trend-card-action {
    display: flex;
    margin-top: 0.2rem;
    padding-top: 0.8rem;
    align-items: center;
    justify-content: space-between;
    color: var(--trend-teal);
    border-top: 1px solid var(--trend-line);
    font-size: 0.78rem;
    font-weight: 800;
}

.trend-card-action i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: var(--trend-teal);
}

.popular-products-page .product-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    border-radius: inherit;
}

.popular-products-page .product-card-overlay:focus-visible {
    outline: 3px solid rgba(79, 130, 120, 0.48);
    outline-offset: -7px;
}

.trends-empty-state {
    display: flex;
    margin: 0;
    padding: clamp(1.5rem, 6vw, 3rem);
    align-items: center;
    flex-direction: column;
    text-align: center;
    border: 1px solid var(--trend-line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 0%, rgba(79, 130, 120, 0.1), transparent 16rem),
        rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 46px rgba(35, 72, 78, 0.1);
}

.trends-empty-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 0.9rem;
    place-items: center;
    color: #fff;
    border: 5px solid rgba(255, 255, 255, 0.72);
    border-radius: 19px;
    background: linear-gradient(145deg, var(--trend-teal-light), var(--trend-teal));
    box-shadow: 0 15px 30px rgba(35, 75, 73, 0.22);
    font-size: 1.45rem;
    transform: rotate(-4deg);
}

.trends-empty-kicker {
    margin-bottom: 0.45rem;
    color: var(--trend-clay-dark);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.trends-empty-state h2 {
    margin: 0;
    color: var(--trend-ink) !important;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    font-weight: 600;
    line-height: 1.05;
}

.trends-empty-state > p {
    max-width: 39rem;
    margin: 0.7rem auto 0;
    color: var(--trend-muted) !important;
    font-size: 0.86rem;
    line-height: 1.55;
}

.trends-empty-signals {
    display: flex;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trends-empty-signals span {
    display: inline-flex;
    padding: 0.45rem 0.62rem;
    align-items: center;
    gap: 0.35rem;
    color: #4d625d;
    border: 1px solid rgba(52, 79, 75, 0.13);
    border-radius: 999px;
    background: rgba(237, 245, 243, 0.74);
    font-size: 0.7rem;
    font-weight: 800;
}

.trends-empty-signals i {
    color: var(--trend-teal-light);
}

.trends-empty-actions {
    display: flex;
    width: 100%;
    margin-top: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.popular-products-page .trends-empty-actions .btn {
    display: inline-flex;
    min-height: 46px;
    padding: 0.7rem 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 12px !important;
    font-size: 0.78rem;
    font-weight: 800;
}

.popular-products-page .trends-empty-actions .btn-primary {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--trend-clay), var(--trend-clay-dark)) !important;
    box-shadow: 0 12px 26px rgba(142, 56, 37, 0.2) !important;
}

.popular-products-page .pagination-wrapper {
    padding-bottom: 1rem;
}

.popular-products-page .pagination {
    gap: 0.4rem;
}

.popular-products-page .pagination .page-link {
    min-width: 42px;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    color: var(--trend-teal) !important;
    border: 1px solid var(--trend-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.popular-products-page .pagination .active .page-link {
    color: #fff !important;
    border-color: var(--trend-teal) !important;
    background: var(--trend-teal) !important;
}

@media (min-width: 576px) {
    .popular-products-page .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1.15rem !important;
    }

    .trends-empty-actions {
        width: auto;
    }
}

@media (min-width: 768px) {
    .trends-intro {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr);
        align-items: center;
    }

    .trends-toolbar {
        display: grid;
        grid-template-columns: minmax(210px, 0.36fr) minmax(0, 1fr);
        align-items: end;
        gap: 1.25rem;
    }

    .trends-toolbar-heading {
        margin-bottom: 0;
    }

    .trends-toolbar-controls {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr);
        align-items: end;
    }

    .period-filters {
        display: flex;
        flex-wrap: wrap;
    }

    .popular-products-page .period-filters .btn {
        flex: 1 1 auto;
    }
}

@media (min-width: 1100px) {
    .popular-products-page .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1.35rem !important;
    }
}

@media (max-width: 420px) {
    .trends-intro-meta span:last-child {
        display: none;
    }

    .popular-products-page .period-filters .btn {
        padding-inline: 0.45rem;
        font-size: 0.7rem;
    }

    .trends-empty-signals {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr;
    }

    .trends-empty-signals span {
        justify-content: center;
    }

    .trends-empty-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .popular-products-page *,
    .popular-products-page *::before,
    .popular-products-page *::after {
        transition-duration: 0.01ms !important;
    }
}
