/**
 * ps_productlanding — Front-office Landing Page styles.
 *
 * All selectors are scoped with the .ps-landing- prefix to avoid
 * collisions with theme styles. No CSS hacks or !important overrides.
 *
 * @author  Hicham Hamami - StationA
 */

/* ================================================================
   SHARED SECTION STYLES
   ================================================================ */

.ps-landing-reviews,
.ps-landing-features,
.ps-landing-related,
.ps-landing-category-products {
    padding: 40px 0;
    margin: 0 auto;
}

.ps-landing-section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #232323;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 12px;
}

.ps-landing-section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #2fb5d2;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ================================================================
   REVIEWS SECTION — Horizontal Slider
   Uses CSS scroll-snap for native swipe + JS arrows for desktop.
   Shows 3 cards on desktop, 2 on tablet, 1 on mobile.
   ================================================================ */

.ps-landing-reviews {
    background-color: #f9f9f9;
}

section.ps-landing-reviews .ps-landing-reviews-slider-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section.ps-landing-reviews .ps-landing-reviews-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 4px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

section.ps-landing-reviews .ps-landing-reviews-track::-webkit-scrollbar {
    display: none;
}

section.ps-landing-reviews .ps-landing-review-card {
    flex: 0 0 calc((100% - 48px) / 3) !important;
    min-width: 280px;
    max-width: 380px;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

section.ps-landing-reviews .ps-landing-review-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
}

/* Slider Arrows */
section.ps-landing-reviews .ps-landing-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

section.ps-landing-reviews .ps-landing-slider-arrow:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

section.ps-landing-reviews .ps-landing-slider-arrow--left {
    left: -16px;
}

section.ps-landing-reviews .ps-landing-slider-arrow--right {
    right: -16px;
}

/* Avatar */
.ps-landing-review-avatar {
    margin-bottom: 12px;
}

.ps-landing-review-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.ps-landing-review-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2fb5d2;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}

/* Stars */
.ps-landing-review-stars {
    margin-bottom: 10px;
}

.ps-landing-star {
    font-size: 1.2rem;
    color: #ddd;
    margin: 0 1px;
}

.ps-landing-star--active {
    color: #f5a623;
}

/* Text */
.ps-landing-review-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
    font-style: italic;
}

/* Author */
.ps-landing-review-author {
    font-size: 0.85rem;
    color: #888;
}

.ps-landing-review-name {
    font-weight: 600;
    color: #333;
}

.ps-landing-review-city {
    color: #999;
}

/* ================================================================
   FEATURES SECTION
   Large image cards with rounded corners, title below.
   Warm cream background matching COD landing page style.
   ================================================================ */

.ps-landing-features {
    background-color: #fef7f0;
    padding: 50px 0;
}

.ps-landing-section-subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: #777;
    margin: -20px 0 30px;
    font-weight: 400;
}

.ps-landing-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.ps-landing-feature-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ps-landing-feature-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-4px);
}

.ps-landing-feature-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f5f5f5;
}

.ps-landing-feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ps-landing-feature-info {
    padding: 16px 12px 20px;
    text-align: center;
}

.ps-landing-feature-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #232323;
    margin: 0;
    line-height: 1.5;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 991px) {
    .ps-landing-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    section.ps-landing-reviews .ps-landing-review-card {
        flex: 0 0 calc((100% - 24px) / 2) !important;
        min-width: 240px;
    }

    section.ps-landing-reviews .ps-landing-slider-arrow--left { left: 4px; }
    section.ps-landing-reviews .ps-landing-slider-arrow--right { right: 4px; }
}

@media (max-width: 767px) {
    .ps-landing-reviews,
    .ps-landing-features,
    .ps-landing-related,
    .ps-landing-category-products {
        padding: 30px 15px;
    }

    .ps-landing-section-title {
        font-size: 1.3rem;
    }

    section.ps-landing-reviews .ps-landing-review-card {
        flex: 0 0 85% !important;
        min-width: 250px;
    }

    .ps-landing-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ps-landing-related-grid,
    .ps-landing-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    section.ps-landing-reviews .ps-landing-slider-arrow {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    section.ps-landing-reviews .ps-landing-slider-arrow--left { left: 2px; }
    section.ps-landing-reviews .ps-landing-slider-arrow--right { right: 2px; }
}

@media (max-width: 479px) {
    .ps-landing-features-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }

    .ps-landing-related-grid,
    .ps-landing-category-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   RELATED PRODUCTS SECTION
   Re-injected Related Products rendered AFTER Features and Reviews.
   Styled to match the Classic theme's product grid appearance.
   ================================================================ */

.ps-landing-related {
    background-color: #f9f9f9;
}

.ps-landing-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.ps-landing-related-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.ps-landing-related-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.ps-landing-related-image-link {
    display: block;
    text-decoration: none;
    background: #fff;
    text-align: center;
    padding: 12px;
}

.ps-landing-related-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 180px;
}

.ps-landing-related-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    color: #bbb;
    font-size: 0.85rem;
}

.ps-landing-related-info {
    padding: 10px 14px 16px;
}

.ps-landing-related-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
}

.ps-landing-related-name a {
    color: #232323;
    text-decoration: none;
}

.ps-landing-related-name a:hover {
    color: #2fb5d2;
}

.ps-landing-related-price {
    font-size: 0.95rem;
}

.ps-landing-related-price-current {
    font-weight: 700;
    color: #232323;
}

.ps-landing-related-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-right: 6px;
}

/* ================================================================
   CATEGORY PRODUCTS SECTION
   Re-injected "Products from the same category" rendered as the 4th
   section AFTER Features → Reviews → Related Products.
   Uses the same card grid pattern as Related Products for consistency.
   ================================================================ */

.ps-landing-category-products {
    background-color: #fff;
}

.ps-landing-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.ps-landing-category-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.ps-landing-category-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.ps-landing-category-image-link {
    display: block;
    text-decoration: none;
    background: #fff;
    text-align: center;
    padding: 12px;
}

.ps-landing-category-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 180px;
}

.ps-landing-category-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    color: #bbb;
    font-size: 0.85rem;
}

.ps-landing-category-info {
    padding: 10px 14px 16px;
}

.ps-landing-category-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
}

.ps-landing-category-name a {
    color: #232323;
    text-decoration: none;
}

.ps-landing-category-name a:hover {
    color: #2fb5d2;
}

.ps-landing-category-price {
    font-size: 0.95rem;
}

.ps-landing-category-price-current {
    font-weight: 700;
    color: #232323;
}

.ps-landing-category-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-right: 6px;
}
