/**
 * LV Peptides — front-page.css
 *
 * Homepage styles extracted from front-page.php inline <style> block.
 * Covers: section spacing, hero section, featured products grid,
 * trust badges, and responsive breakpoints.
 *
 * Enqueued conditionally on the front page via is_front_page().
 *
 * @see Requirements: 15.1, 15.2, 18.1, 18.2, 18.3, 18.5
 */

/* ==========================================================================
   Astra Parent Theme Overrides — Nuclear specificity
   Astra's inline CSS applies:
     - body.ast-plain-container { background-color: var(--ast-global-color-4) } (#FFF)
     - .ast-plain-container.ast-no-sidebar #primary { margin-top: 60px }
     - h1,h2… { color: var(--ast-global-color-3) } (#334155)
   These override our hero's navy gradient + white text.
   We must use body-level selectors + !important to win.
   ========================================================================== */

/* Kill Astra's white page background on homepage */
body.home,
body.home.ast-plain-container,
body.home.ast-separate-container,
body.home.ast-page-builder-template {
    background-color: var(--lv-gray) !important;
    background: var(--lv-gray) !important;
}

/* Kill Astra's 60px top margin on #primary */
body.home.ast-plain-container.ast-no-sidebar #primary,
body.home.ast-plain-container #primary,
body.home #primary,
body.home #main-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-width: 100% !important;
}

/* Kill Astra's content wrapper backgrounds and padding */
body.home #content,
body.home .site-content,
body.home .ast-container,
body.home .entry-content,
body.home article,
body.home .entry-header,
body.home .ast-article-single,
body.home .ast-article-post,
body.home .ast-article-page,
body.home .ast-separate-container .ast-article-single,
body.home .ast-separate-container .ast-article-post,
body.home .ast-separate-container .ast-article-page,
body.home .ast-separate-container .site-content > .ast-container,
body.home .ast-plain-container .site-content,
body.home .ast-page-builder-template .site-content > .ast-container {
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
}

/* Force hero gradient — beat any Astra background inheritance */
body.home .lv-hero,
.home .lv-homepage-section.lv-hero {
    background: var(--gradient-hero) !important;
    background-color: var(--lv-navy) !important;
}

/* Force white text in hero — beat Astra's heading color rules */
body.home .lv-hero h1,
body.home .lv-hero .lv-hero-inner h1,
.home .lv-homepage-section.lv-hero h1 {
    color: var(--lv-white) !important;
}

body.home .lv-hero .lv-hero-subheadline,
body.home .lv-hero p.lv-hero-subheadline,
.home .lv-homepage-section.lv-hero .lv-hero-subheadline {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.home .lv-hero .lv-hero-trust-metrics,
body.home .lv-hero p.lv-hero-trust-metrics,
.home .lv-homepage-section.lv-hero .lv-hero-trust-metrics {
    color: var(--lv-teal) !important;
}

/* Remove Astra's default top/bottom padding on the front page */
.home .site-content > .ast-container {
    display: contents;
}

/* Ensure main-content fills the viewport width */
.home #main-content {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   Homepage — Section Spacing
   ========================================================================== */
.lv-homepage-section + .lv-homepage-section {
    margin-top: 0;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.lv-hero {
    background: var(--gradient-hero);
    color: var(--lv-white);
    padding: clamp(4.5rem, 8vw, 6.5rem) var(--space-8) clamp(3.75rem, 6vw, 5rem);
    text-align: center;
}

.lv-hero-inner {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lv-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--space-3);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.lv-hero h1 {
    color: var(--lv-white);
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin: 0 0 var(--space-4);
    line-height: 1.2;
}

.lv-hero-subheadline {
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--font-size-lg);
    line-height: 1.6;
    margin: 0 0 var(--space-6);
    max-width: 70ch;
}

.lv-hero-cta-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--space-6);
}

.lv-hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 clamp(1.5rem, 3vw, 2rem);
    line-height: 1.25;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition-base), box-shadow var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.lv-hero-cta {
    background-color: var(--lv-teal);
    color: var(--lv-white);
    box-shadow: 0 10px 24px rgba(0, 212, 170, 0.22);
}

.lv-hero-cta:hover,
.lv-hero-cta:focus {
    background-color: var(--lv-teal-dark);
    color: var(--lv-white);
    box-shadow: 0 14px 30px rgba(0, 212, 170, 0.3);
}


.lv-hero-trust-metrics {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    margin: 0;
    padding: var(--space-2) var(--space-4);
    border-radius: 999px;
    list-style: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.lv-hero + .lv-featured-products {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lv-hero-trust-metrics li {
    position: relative;
    white-space: nowrap;
}

.lv-hero-trust-metrics li + li::before {
    content: "";
    position: absolute;
    left: calc(-1 * clamp(0.55rem, 1.2vw, 0.95rem));
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

/* ==========================================================================
   Featured Products Section
   ========================================================================== */
.lv-featured-products {
    background-color: var(--lv-gray);
    padding: var(--space-10) var(--space-8) var(--space-12);
}

.lv-featured-products-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.lv-featured-products h2 {
    text-align: center;
    margin: 0 0 var(--space-8);
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

/* Let WooCommerce shortcode handle the grid; light overrides for consistency */
.lv-featured-products .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
    padding: 0;
    margin: 0;
}

.lv-featured-products .woocommerce ul.products li.product {
    background: var(--lv-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    margin: 0;
    width: auto;
    min-width: 0;
    float: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100%;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.lv-featured-products .woocommerce ul.products li.product:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.lv-featured-products .woocommerce ul.products li.product a {
    display: block;
    min-width: 0;
}

.lv-featured-products .woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lv-featured-products .woocommerce ul.products li.product a img {
    border-radius: var(--radius-sm);
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
}

.lv-featured-products .woocommerce ul.products li.product .woocommerce-loop-product__title,
.lv-featured-products .woocommerce ul.products li.product .woocommerce-loop-category__title,
.lv-featured-products .woocommerce ul.products li.product h2,
.lv-featured-products .woocommerce ul.products li.product h3 {
    margin: var(--space-3) 0 var(--space-2);
    line-height: 1.35;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    overflow-wrap: anywhere;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.35em * 2);
}

.lv-featured-products .woocommerce ul.products li.product .price {
    color: var(--lv-teal);
    font-weight: 600;
    margin: 0 0 var(--space-3);
    min-height: 1.6em;
}

.lv-featured-products .woocommerce ul.products li.product .button {
    background-color: var(--lv-teal);
    color: var(--lv-white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    margin-top: auto;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color var(--transition-base);
}

.lv-featured-products .woocommerce ul.products li.product .button:hover {
    background-color: var(--lv-teal-dark);
}

/* ==========================================================================
   Trust Badges Section
   ========================================================================== */
.lv-trust-badges {
    background-color: var(--lv-white);
    border-top: 1px solid rgba(10, 37, 64, 0.08);
    border-bottom: 1px solid rgba(10, 37, 64, 0.08);
    padding: var(--space-12) var(--space-8);
}

.lv-trust-badges-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
    text-align: center;
}

.lv-trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.lv-trust-badge-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lv-trust-badge-icon img {
    width: 56px;
    height: 56px;
}

.lv-trust-badge-label {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--lv-navy);
}

.lv-trust-badge-desc {
    font-size: var(--font-size-sm);
    color: rgba(10, 37, 64, 0.6);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Responsive — Tablet
   ========================================================================== */
@media (max-width: 1024px) {
    .lv-hero {
        padding: var(--space-14) var(--space-6) var(--space-10);
    }

    .lv-hero-inner {
        max-width: 760px;
    }

    .lv-hero-subheadline {
        max-width: 62ch;
    }

    .lv-hero-cta-wrap {
        flex-wrap: wrap;
    }

    .lv-hero-trust-metrics {
        flex-wrap: wrap;
    }

    .lv-featured-products .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */
@media (max-width: 767px) {
    .lv-hero {
        padding: calc(var(--space-12) + env(safe-area-inset-top, 0px)) var(--space-4) var(--space-10);
    }

    .lv-hero-inner {
        overflow: visible;
    }

    .lv-hero h1 {
        font-size: var(--font-size-2xl);
        line-height: 1.25;
        margin-top: 0;
        overflow-wrap: anywhere;
    }

    .lv-hero-subheadline {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-4);
    }

    .lv-hero-cta-wrap {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        margin-bottom: var(--space-5);
    }

    .lv-hero-cta {
        display: block;
        width: 100%;
        min-height: 56px;
        line-height: 1.25;
        text-align: center;
        padding: 15px var(--space-5);
        white-space: normal;
    }

    .lv-hero-trust-metrics {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: var(--space-2);
        margin: 0;
        padding: 0;
        list-style: none;
        text-align: center;
    }

    .lv-featured-products {
        padding: var(--space-7) var(--space-4) var(--space-8);
    }

    .lv-featured-products .woocommerce ul.products,
    .lv-featured-products .woocommerce.columns-3 ul.products,
    .lv-featured-products .woocommerce-page.columns-3 ul.products,
    .lv-featured-products ul.products.columns-3 {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: var(--space-4);
    }

    .lv-featured-products .woocommerce ul.products li.product,
    .lv-featured-products .woocommerce.columns-3 ul.products li.product,
    .lv-featured-products ul.products.columns-3 li.product {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
        clear: none !important;
        padding: var(--space-3);
    }

    .lv-featured-products .woocommerce ul.products li.product a img {
        aspect-ratio: 16 / 11;
    }

    .lv-featured-products .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .lv-featured-products .woocommerce ul.products li.product .woocommerce-loop-category__title,
    .lv-featured-products .woocommerce ul.products li.product h2,
    .lv-featured-products .woocommerce ul.products li.product h3 {
        font-size: 0.95rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .lv-featured-products .woocommerce ul.products li.product .price {
        margin-bottom: var(--space-2);
    }

    .lv-featured-products .woocommerce ul.products li.product .button {
        margin-top: var(--space-2);
        padding: var(--space-2) var(--space-3);
    }

    .lv-trust-badges {
        padding: var(--space-8) var(--space-4);
    }

    .lv-trust-badges-inner {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}
