/* ============================================================
   LightSite Engine — Main Stylesheet
   Variables injected via <style> in layout.php:
   --ls-primary, --ls-secondary, --ls-font-heading, --ls-font-body
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--ls-font-body);
    color: #1a1a1a;
    background: #fff;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ls-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ls-secondary); }

h1, h2, h3, h4 { font-family: var(--ls-font-heading); color: #111; line-height: 1.3; }
h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; }

/* === LAYOUT === */
.ls-container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.ls-main { min-height: 60vh; padding-bottom: 3rem; }

/* === HEADER === */
.ls-header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100; }

.ls-header-inner {
    display: flex; align-items: center; gap: 1rem;
    padding-top: .75rem; padding-bottom: .75rem;
}

.ls-logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; color: #111; white-space: nowrap; }
.ls-logo:hover { color: var(--ls-primary); }
.ls-logo-icon { display: flex; width: 28px; height: 28px; }
.ls-logo-icon svg { width: 100%; height: 100%; fill: var(--ls-primary); }

.ls-search { flex: 1; max-width: 400px; display: flex; position: relative; }
.ls-search input {
    width: 100%; padding: .5rem 2.5rem .5rem 1rem;
    border: 1px solid #ddd; border-radius: 24px;
    font-size: .9rem; font-family: var(--ls-font-body);
    background: #f8f8f8; transition: border-color .2s;
}
.ls-search input:focus { outline: none; border-color: var(--ls-primary); background: #fff; }
.ls-search button {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #666; padding: .25rem;
}

.ls-hamburger { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.ls-hamburger span { display: block; width: 22px; height: 2px; background: #333; margin: 5px 0; transition: .3s; }

/* Nav */
.ls-nav { background: var(--ls-primary); }
.ls-nav-list { display: flex; list-style: none; gap: 0; flex-wrap: wrap; }
.ls-nav-list li a {
    display: block; padding: .6rem 1rem;
    color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 500;
    transition: background .2s, color .2s;
}
.ls-nav-list li a:hover, .ls-nav-list li a.ls-active { background: rgba(0,0,0,.15); color: #fff; }

/* === HERO SECTIONS === */
.ls-hero { background: linear-gradient(135deg, var(--ls-primary), var(--ls-secondary)); color: #fff; text-align: center; }
.ls-hero--large { padding: 4rem 1rem; }
.ls-hero--slim { padding: 1.5rem 1rem; }
.ls-hero--quote { padding: 3rem 1rem; }
.ls-hero-title { font-size: 2.2rem; color: #fff; margin-bottom: .75rem; }
.ls-hero-subtitle { font-size: 1.1rem; opacity: .9; max-width: 600px; margin: 0 auto; }
.ls-hero-text { font-size: 1rem; opacity: .9; }
.ls-hero-quote { font-style: italic; font-size: 1.15rem; opacity: .85; margin-top: 1rem; border: none; }

/* === SECTIONS === */
.ls-section { padding: 2.5rem 0; }
.ls-section--alt { background: #f9f9f9; }
.ls-section-title { text-align: center; margin-bottom: 2rem; font-size: 1.6rem; }
.ls-section-desc { text-align: center; color: #666; margin: -1rem auto 2rem; max-width: 600px; }

/* === PRODUCT GRID === */
.ls-product-grid { display: grid; gap: 1.5rem; }
.ls-product-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ls-product-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ls-product-grid--2-desc { grid-template-columns: repeat(2, 1fr); }
.ls-product-grid--compact { grid-template-columns: repeat(4, 1fr); }

/* === PRODUCT CARD === */
.ls-product-card { background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.ls-product-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.ls-product-card-link { display: block; color: inherit; }
.ls-product-card-img { aspect-ratio: 1; overflow: hidden; background: #f5f5f5; }
.ls-product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ls-product-card-body { padding: 1rem; }
.ls-product-card-title { font-size: 1.05rem; margin-bottom: .4rem; }
.ls-product-card-rating { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: #666; margin-bottom: .4rem; }
.ls-product-card-price { margin-bottom: .75rem; }
.ls-product-card-desc { font-size: .9rem; color: #555; margin-bottom: .75rem; line-height: 1.5; }
.ls-product-card-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.ls-product-card-btn {
    display: inline-block; padding: .5rem 1rem;
    background: var(--ls-primary); color: #fff; border-radius: 6px;
    font-size: .85rem; font-weight: 600; transition: background .2s;
}
.ls-product-card:hover .ls-product-card-btn { background: var(--ls-secondary); }

/* Horizontal card (variant 3) */
.ls-product-card--horizontal .ls-product-card-link { display: flex; }
.ls-product-card--horizontal .ls-product-card-img { width: 180px; min-height: 180px; aspect-ratio: auto; flex-shrink: 0; }
.ls-product-card--horizontal .ls-product-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* === PRICING === */
.ls-price-old { text-decoration: line-through; color: #999; font-size: .9rem; margin-right: .4rem; }
.ls-price-current { color: var(--ls-primary); font-weight: 700; font-size: 1.1rem; }
.ls-price-big { font-size: 1.5rem; }

/* === STARS === */
.ls-stars--svg { display: inline-flex; gap: 2px; }
.ls-star { fill: #ddd; }
.ls-star--full { fill: #f5a623; }
.ls-star--half { fill: #f5a623; opacity: .6; }
.ls-stars--bar { display: inline-block; width: 80px; height: 14px; background: #eee; border-radius: 7px; overflow: hidden; vertical-align: middle; }
.ls-stars-fill { display: block; height: 100%; background: #f5a623; border-radius: 7px; }

/* === CATEGORY BADGES === */
.ls-category-badges { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.ls-category-badges--inline { margin-bottom: 1rem; }
.ls-badge {
    display: inline-block; padding: .5rem 1.25rem;
    background: var(--ls-primary-light); color: var(--ls-primary);
    border-radius: 24px; font-size: .9rem; font-weight: 600;
    transition: background .2s, color .2s;
}
.ls-badge:hover { background: var(--ls-primary); color: #fff; }
.ls-badge--large { padding: .65rem 1.5rem; font-size: 1rem; }

/* === PRODUCT PAGE LAYOUT === */
.ls-product-layout { display: grid; grid-template-columns: 1fr 350px; gap: 2.5rem; margin-top: 1.5rem; }
.ls-product-title { font-size: 1.8rem; margin-bottom: 1.5rem; }

/* Product summary (sidebar) */
.ls-product-summary {
    position: sticky; top: 80px; align-self: start;
    background: #fff; border: 1px solid #eee; border-radius: 12px;
    padding: 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.ls-product-summary-img { margin: -1.5rem -1.5rem 1rem; border-radius: 12px 12px 0 0; overflow: hidden; }
.ls-product-summary-img img { width: 100%; }
.ls-product-summary-name { font-size: 1.3rem; margin-bottom: .5rem; }
.ls-product-summary-rating { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: #666; margin-bottom: .75rem; }
.ls-product-summary-price { margin-bottom: 1rem; }
.ls-product-summary-points { list-style: none; margin-bottom: 1.25rem; }
.ls-product-summary-points li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .95rem; }
.ls-product-summary-ingredients { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #eee; }
.ls-product-summary-ingredients h4 { font-size: .9rem; color: #666; margin-bottom: .5rem; }
.ls-ingredient-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.ls-tag { display: inline-block; padding: .2rem .6rem; background: #f0f0f0; border-radius: 4px; font-size: .8rem; color: #555; }

/* === ARTICLE CONTENT === */
.ls-article-content { line-height: 1.8; }
.ls-article-content h2 { color: var(--ls-primary); border-bottom: 2px solid var(--ls-primary-light); padding-bottom: .4rem; }
.ls-article-content h3 { color: #333; }
.ls-article-content p { margin-bottom: 1rem; }
.ls-article-content ul, .ls-article-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.ls-article-content li { margin-bottom: .4rem; }
.ls-article-content strong { color: #111; }
.ls-article-content a { color: var(--ls-primary); text-decoration: underline; text-decoration-color: var(--ls-primary-light); text-underline-offset: 2px; }
.ls-article-content a:hover { text-decoration-color: var(--ls-primary); }
.ls-article-content a.ls-btn { color: #fff; text-decoration: none; }
.ls-article-content a.ls-btn:hover { color: #fff; }

/* === CTA BLOCK (in article) === */
.ls-cta-block {
    margin: 2rem 0; padding: 1.25rem;
    background: linear-gradient(135deg, var(--ls-primary-light), var(--ls-secondary-light));
    border: 2px solid var(--ls-primary);
    border-radius: 12px; position: relative;
}
.ls-cta-badge {
    position: absolute; top: -12px; left: 1.5rem;
    background: var(--ls-secondary); color: #fff;
    padding: .2rem .75rem; border-radius: 4px;
    font-size: .75rem; font-weight: 700; letter-spacing: .5px;
}
.ls-cta-inner { display: flex; align-items: center; gap: 1rem; }
.ls-cta-img { width: 80px; height: 80px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.ls-cta-img img { width: 100%; height: 100%; object-fit: cover; }
.ls-cta-info { flex: 1; }
.ls-cta-name { font-size: 1.05rem; display: block; margin-bottom: .3rem; }
.ls-cta-rating { font-size: .85rem; color: #555; margin-bottom: .3rem; }
.ls-cta-price { margin-bottom: 0; }

/* === BUTTONS === */
.ls-btn {
    display: inline-block; padding: .75rem 1.5rem;
    border: none; border-radius: 8px; cursor: pointer;
    font-size: 1rem; font-weight: 700; text-align: center;
    text-decoration: none; transition: all .2s;
    font-family: var(--ls-font-body);
}
.ls-btn--primary { background: var(--ls-primary); color: #fff; }
.ls-btn--primary:hover { background: var(--ls-secondary); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.ls-btn--large { padding: 1rem 2rem; font-size: 1.05rem; width: 100%; }

/* === FAQ === */
.ls-faq { margin-top: 2.5rem; }
.ls-faq-item { border: 1px solid #eee; border-radius: 8px; margin-bottom: .75rem; overflow: hidden; }
.ls-faq-item summary {
    padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    background: #fafafa; transition: background .2s;
}
.ls-faq-item summary:hover { background: #f0f0f0; }
.ls-faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--ls-primary); }
.ls-faq-item[open] summary::after { content: '−'; }
.ls-faq-answer { padding: 1rem 1.25rem; }

/* === SIMILAR PRODUCTS === */
.ls-similar { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #eee; }
.ls-similar-title { font-size: 1.4rem; margin-bottom: 1.5rem; }

/* === BREADCRUMBS === */
.ls-breadcrumbs { padding: 1rem 0; }
.ls-breadcrumbs ol { display: flex; list-style: none; flex-wrap: wrap; gap: .25rem; font-size: .85rem; }
.ls-breadcrumbs li::after { content: '›'; margin-left: .4rem; color: #999; }
.ls-breadcrumbs li:last-child::after { display: none; }
.ls-breadcrumbs a { color: #666; }
.ls-breadcrumbs a:hover { color: var(--ls-primary); }
.ls-breadcrumbs span { color: #333; }

/* === STICKY CTA BAR === */
.ls-sticky-cta {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: #fff; border-top: 2px solid var(--ls-primary);
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    padding: .75rem 1.25rem; display: flex; align-items: center;
    justify-content: center; gap: 1rem;
    transform: translateY(100%); transition: transform .3s;
}
.ls-sticky-cta.ls-visible { transform: translateY(0); }
.ls-sticky-cta-name { font-weight: 600; font-size: .95rem; }
.ls-sticky-cta-price { font-weight: 700; color: var(--ls-primary); font-size: 1.05rem; }
.ls-sticky-cta .ls-btn { padding: .6rem 1.5rem; font-size: .9rem; white-space: nowrap; }
.ls-sticky-cta .ls-btn--sticky { min-height: 44px; display: flex; align-items: center; }

/* === EXIT POPUP === */
.ls-exit-popup { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.ls-exit-popup-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.ls-exit-popup-content {
    position: relative; background: #fff; border-radius: 16px;
    padding: 2rem; max-width: 440px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center;
    animation: lsPopupIn .3s ease;
}
@keyframes lsPopupIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.ls-exit-popup-close {
    position: absolute; top: .75rem; right: .75rem;
    background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #999;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.ls-exit-popup-close:hover { color: #333; }
.ls-exit-popup-img { width: 100px; height: 100px; margin: 0 auto 1rem; border-radius: 12px; overflow: hidden; }
.ls-exit-popup-img img { width: 100%; height: 100%; object-fit: cover; }
.ls-exit-popup-title { font-size: 1.3rem; margin-bottom: .5rem; color: #111; }
.ls-exit-popup-text { color: #666; margin-bottom: 1.25rem; }

/* === SOCIAL PROOF TOAST === */
.ls-toast {
    position: fixed; bottom: 80px; left: 16px; z-index: 80;
    background: #fff; border: 1px solid #e5e5e5; border-left: 4px solid var(--ls-primary);
    border-radius: 8px; padding: .75rem 1rem; max-width: 320px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    font-size: .85rem; line-height: 1.4;
    transform: translateX(-120%); transition: transform .4s ease;
}
.ls-toast--visible { transform: translateX(0); }
.ls-toast-content strong { color: var(--ls-primary); }
.ls-toast-time { display: block; color: #999; font-size: .75rem; margin-top: .2rem; }
.ls-toast-close {
    position: absolute; top: 4px; right: 4px;
    background: none; border: none; color: #999; font-size: 1.2rem;
    width: 28px; height: 28px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* === HEALTH DISCLAIMER === */
.ls-health-disclaimer {
    margin-top: 2rem; padding: 1rem 1.25rem;
    background: #fef3cd; border: 1px solid #ffc107; border-radius: 8px;
    font-size: .8rem; line-height: 1.6; color: #664d03;
}
.ls-health-disclaimer strong { color: #523c02; }

/* === SITE DISCLAIMER BANNER === */
.ls-site-disclaimer {
    background: #f0f0f0; border-bottom: 1px solid #ddd;
    padding: .5rem 1rem; font-size: .75rem; color: #666;
    text-align: center; line-height: 1.4;
}

/* === FOOTER === */
.ls-footer { background: #1a1a1a; color: #ccc; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.ls-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .75rem; }
.ls-footer a { color: #aaa; }
.ls-footer a:hover { color: var(--ls-secondary); }
.ls-footer ul { list-style: none; }
.ls-footer li { margin-bottom: .4rem; font-size: .9rem; }
.ls-footer p { font-size: .9rem; line-height: 1.6; }

.ls-footer-grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
.ls-footer-grid--2 { grid-template-columns: 1fr 1fr; }
.ls-footer-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.ls-footer-grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.ls-footer-disclaimer, .ls-footer-disclaimer-inline { font-size: .8rem; color: #777; border-top: 1px solid #333; padding-top: 1rem; margin-top: 1rem; }
.ls-footer-copy { text-align: center; font-size: .8rem; color: #666; margin-top: 1rem; }
.ls-footer-bottom { border-top: 1px solid #333; padding-top: 1rem; margin-top: 1.5rem; font-size: .8rem; color: #777; }
.ls-footer-links-inline { margin-top: 1rem; font-size: .85rem; }
.ls-footer-links-inline a { margin-right: .25rem; }
.ls-footer-cats-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.ls-footer .ls-badge { background: #333; color: #ccc; font-size: .8rem; padding: .35rem .9rem; }
.ls-footer .ls-badge:hover { background: var(--ls-secondary); color: #fff; }

/* === LEGAL PAGES === */
.ls-legal { padding-top: 1rem; }
.ls-legal-content { max-width: 800px; line-height: 1.8; }
.ls-legal-content h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; color: var(--ls-primary); }
.ls-legal-content p { margin-bottom: 1rem; }

/* === SEARCH PAGE === */
.ls-search--page { max-width: 100%; margin-bottom: 2rem; }
.ls-search--page input { font-size: 1.1rem; padding: .75rem 1.25rem; border-radius: 8px; }
.ls-empty { text-align: center; color: #999; padding: 3rem 0; font-size: 1.1rem; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .ls-product-layout { grid-template-columns: 1fr; }
    .ls-product-summary { position: static; order: -1; }
    .ls-product-grid--4 { grid-template-columns: repeat(3, 1fr); }
    .ls-product-grid--compact { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .ls-product-grid--3, .ls-product-grid--4, .ls-product-grid--compact { grid-template-columns: repeat(2, 1fr); }
    .ls-product-grid--2-desc { grid-template-columns: 1fr; }
    .ls-product-card--horizontal .ls-product-card-link { flex-direction: column; }
    .ls-product-card--horizontal .ls-product-card-img { width: 100%; min-height: auto; aspect-ratio: 16/9; }
    .ls-footer-grid--3, .ls-footer-grid--4 { grid-template-columns: 1fr 1fr; }
    .ls-footer-grid--2 { grid-template-columns: 1fr; }
    .ls-hero-title { font-size: 1.6rem; }
    .ls-hero--large { padding: 2.5rem 1rem; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    /* Header mobile */
    .ls-search { display: none; }
    .ls-hamburger { display: block; margin-left: auto; }
    .ls-nav { display: none; }
    .ls-nav.ls-nav--open { display: block; }
    .ls-nav-list { flex-direction: column; }
    .ls-nav-list li a { padding: .8rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); }

    /* CTA block mobile */
    .ls-cta-inner { flex-direction: column; text-align: center; }
    .ls-cta-img { margin: 0 auto; width: 60px; height: 60px; }

    /* Sticky CTA mobile: compact — hide name, show price + fat button */
    .ls-sticky-cta { gap: .5rem; padding: .6rem 1rem; justify-content: space-between; }
    .ls-sticky-cta-name { display: none; }
    .ls-sticky-cta .ls-btn--sticky { flex: 1; justify-content: center; font-size: .85rem; padding: .65rem 1rem; min-height: 48px; }

    /* Exit popup mobile: tighter */
    .ls-exit-popup-content { padding: 1.25rem 1rem; border-radius: 12px; }
    .ls-exit-popup-img { width: 70px; height: 70px; }
    .ls-exit-popup-title { font-size: 1.15rem; }
    .ls-exit-popup-text { font-size: .9rem; margin-bottom: 1rem; }

    /* Toast mobile: full width bottom */
    .ls-toast { left: 8px; right: 8px; max-width: none; bottom: 70px; }

    /* Touch targets: min 44px height for all interactive elements */
    .ls-badge { min-height: 44px; display: inline-flex; align-items: center; padding: .5rem 1.25rem; }
    .ls-product-card-btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .ls-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
    .ls-btn--large { min-height: 52px; font-size: 1rem; }

    /* Hamburger: bigger touch target */
    .ls-hamburger { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }

    /* Search input: 16px min to prevent iOS zoom */
    .ls-search--page input { font-size: 16px; }

    /* Product summary on mobile: more compact */
    .ls-product-summary { padding: 1rem; }
    .ls-product-summary-name { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .ls-product-grid--3, .ls-product-grid--4, .ls-product-grid--2-desc, .ls-product-grid--compact { grid-template-columns: 1fr; }
    .ls-footer-grid--3, .ls-footer-grid--4, .ls-footer-grid--2 { grid-template-columns: 1fr; }

    /* Single column: product cards side-by-side layout */
    .ls-product-card-link { display: flex; flex-direction: row; }
    .ls-product-card-img { width: 100px; min-width: 100px; aspect-ratio: 1; }
    .ls-product-card-body { padding: .75rem; }
    .ls-product-card-title { font-size: .95rem; }
}
