/*
Theme Name:   Smart Gear Select
Theme URI:    https://smartgearselect.com
Description:  Professional affiliate review child theme for Astra. Production-ready, performance-optimised.
Author:       Smart Gear Select
Author URI:   https://smartgearselect.com
Template:     astra
Version:      25.5.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  smart-gear-select
*/

/* ============================================================================
   CHANGE LOG v25.5.0
   - FIX: Added position:relative to .sgs-highlight (::after underline now renders correctly)
   - FIX: Scoped mobile animation kill to .sgs-* selectors only (avoids breaking 3rd-party plugins)
   - FIX: Added aspect-ratio to .sgs-review-image and .sgs-deal__image (prevents CLS)
   - PERF: Added content-visibility:auto to below-fold sections
   - PERF: Added contain:layout to card grids (reduces paint/layout thrashing)
   - PERF: Added will-change:transform to interactive cards only on :hover intent
   - PERF: Moved img reset to top-level base reset
   - LAYOUT: Strengthened Astra #primary full-width overrides for homepage
   - LAYOUT: Added overflow containment fix so full-bleed hero works in all Astra layouts
   ============================================================================ */


/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
    --sgs-primary:          #4F46E5;
    --sgs-primary-dark:     #4338CA;
    --sgs-primary-light:    #818CF8;
    --sgs-secondary:        #059669;
    --sgs-secondary-dark:   #047857;
    --sgs-accent:           #F59E0B;
    --sgs-accent-dark:      #D97706;
    --sgs-text:             #1E293B;
    --sgs-text-light:       #64748B;
    --sgs-text-muted:       #94A3B8;
    --sgs-bg:               #FFFFFF;
    --sgs-bg-alt:           #F8FAFC;
    --sgs-bg-dark:          #0F172A;
    --sgs-bg-dark-alt:      #1E293B;
    --sgs-border:           #E2E8F0;
    --sgs-border-light:     #F1F5F9;
    --sgs-shadow-sm:        0 1px 3px rgba(0,0,0,.05);
    --sgs-shadow:           0 4px 6px -1px rgba(0,0,0,.1);
    --sgs-shadow-md:        0 6px 15px rgba(0,0,0,.1);
    --sgs-shadow-lg:        0 10px 25px rgba(0,0,0,.12);
    --sgs-shadow-xl:        0 20px 40px rgba(0,0,0,.15);
    --sgs-transition:       all .3s cubic-bezier(.4,0,.2,1);
    --sgs-transition-fast:  all .2s ease;
    --sgs-spacing-xs:       .5rem;
    --sgs-spacing-sm:       1rem;
    --sgs-spacing-md:       1.5rem;
    --sgs-spacing-lg:       2rem;
    --sgs-spacing-xl:       3rem;
    --sgs-radius-sm:        6px;
    --sgs-radius:           10px;
    --sgs-radius-lg:        16px;
    --sgs-radius-xl:        20px;
    --sgs-radius-full:      9999px;
    --color-amazon:         #FF9900;
    --color-ali:            #E43225;
    --color-ali-dark:       #C62828;
}


/* ============================================================================
   BASE RESET
   ============================================================================ */

/* Box-model only for pseudo-elements — avoid overriding their spacing */
*::before,
*::after { box-sizing: border-box; }

/* Full reset for real elements */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* FIX: overflow-x on html+body together prevents the negative-margin
       full-bleed technique from being clipped in WebKit/Blink */
    overflow-x: hidden;
}

body {
    /* Note: 'Inter' listed first; browser falls back instantly if not loaded.
       No font import = zero render-blocking font request = better FCP/LCP. */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--sgs-text);
    background: var(--sgs-bg);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* PERF + CLS: universal image safety — moved here from end of file */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}


/* ============================================================================
   ASTRA OVERRIDES
   ============================================================================ */

/* Remove Astra's content-area padding that would constrain the homepage */
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container #primary,
.ast-separate-container .site-main > article,
.ast-plain-container .site-content .ast-container {
    padding-top: 0;
    padding-bottom: 0;
}

/*
 * LAYOUT FIX: Force full-width layout for homepage.
 * The .sgs-homepage body class is added via the body_class filter in functions.php.
 * Using !important here is intentional to override inline styles Astra may inject.
 */
.sgs-homepage .site-content,
.sgs-homepage #content,
.sgs-homepage .site-main,
.sgs-homepage #primary,
.sgs-homepage #primary.content-area,
.sgs-homepage .ast-article-post-format {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: none !important;         /* Prevents Astra flex-child from shrinking */
}

/* Remove any Astra content-box background / border from the homepage entry */
.sgs-homepage .ast-separate-container #primary,
.sgs-homepage .ast-separate-container .ast-article-single,
.sgs-homepage .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}


/* ============================================================================
   LAYOUT
   ============================================================================ */

.sgs-container,
.ast-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sgs-spacing-md);
    width: 100%;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--sgs-primary);
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top .3s;
    border-radius: 0 0 var(--sgs-radius) 0;
}
.skip-link:focus { top: 0; }


/* ============================================================================
   HEADER
   ============================================================================ */

.sgs-header {
    background: var(--sgs-bg-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    transition: var(--sgs-transition-fast);
}
.sgs-header.scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.2); }

.sgs-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: var(--sgs-spacing-xs) 0;
}

.sgs-header__logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    transition: var(--sgs-transition-fast);
}
.sgs-header__logo a:hover { opacity: .9; }

.sgs-header__nav {
    display: flex;
    align-items: center;
    gap: var(--sgs-spacing-xs);
}

.sgs-nav-link {
    padding: 10px 18px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    border-radius: var(--sgs-radius);
    transition: var(--sgs-transition-fast);
    position: relative;
}
.sgs-nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--sgs-primary-light);
    transform: translateX(-50%);
    transition: width .3s ease;
}
.sgs-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sgs-nav-link:hover::before { width: 60%; }

.sgs-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--sgs-radius);
    transition: var(--sgs-transition-fast);
}
.sgs-mobile-toggle:hover { background: rgba(255,255,255,.1); }
.sgs-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: .3s;
}

.sgs-header__search {
    position: relative;
    display: flex;
    align-items: center;
}

.sgs-search-toggle {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    color: #fff;
    transition: var(--sgs-transition-fast);
    border-radius: var(--sgs-radius);
}
.sgs-search-toggle:hover { background: rgba(255,255,255,.1); }

.sgs-search-form {
    position: absolute;
    right: 0;
    top: 120%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .3s ease;
    background: #fff;
    border-radius: var(--sgs-radius-lg);
    padding: 12px;
    box-shadow: var(--sgs-shadow-xl);
    z-index: 999;
    min-width: 300px;
}
.sgs-search-form.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.sgs-search-field {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--sgs-radius);
    border: 1px solid var(--sgs-border);
    font-size: 14px;
    transition: var(--sgs-transition-fast);
}
.sgs-search-field:focus {
    outline: none;
    border-color: var(--sgs-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.sgs-search-submit {
    background: var(--sgs-primary);
    color: #fff;
    border: none;
    border-radius: var(--sgs-radius);
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--sgs-transition-fast);
}
.sgs-search-submit:hover { background: var(--sgs-primary-dark); transform: translateY(-1px); }


/* ============================================================================
   HERO
   ============================================================================ */

.sgs-hero {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #4338CA 100%);
    color: #fff;
    text-align: center;
    padding: 120px 0 100px;
    margin: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.sgs-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.05) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-20px) scale(1.05); }
}

/*
 * FULL-BLEED HERO: Works by pulling the element outside its constrained
 * parent container using viewport-unit negative margins.
 * Requires html + body both have overflow-x:hidden (see Base Reset above).
 */
.ast-separate-container .sgs-hero,
.ast-plain-container .sgs-hero,
body .sgs-hero {
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: none;
}

.sgs-hero-container { position: relative; z-index: 1; }

.sgs-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--sgs-radius-full);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    text-transform: uppercase;
    animation: fadeInUp .6s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sgs-hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 var(--sgs-spacing-lg);
    color: #fff;
    animation: fadeInUp .6s ease .1s both;
}

/*
 * FIX: Added position:relative so the ::after underline (position:absolute)
 * is correctly anchored to this element. Previously it could float freely
 * relative to the nearest positioned ancestor.
 */
.sgs-highlight {
    background: linear-gradient(135deg, #F59E0B 0%, #FB923C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative; /* FIX */
}
.sgs-highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #F59E0B, #FB923C);
    border-radius: 2px;
    opacity: .5;
}

.sgs-hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: rgba(255,255,255,.92);
    max-width: 650px;
    margin: 0 auto var(--sgs-spacing-xl);
    line-height: 1.7;
    animation: fadeInUp .6s ease .2s both;
}

.sgs-hero__buttons {
    display: flex;
    gap: var(--sgs-spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--sgs-spacing-xl);
    animation: fadeInUp .6s ease .3s both;
}

.sgs-hero__stats {
    display: flex;
    gap: var(--sgs-spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--sgs-spacing-xl);
    animation: fadeInUp .6s ease .4s both;
}

.sgs-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: .95rem;
    color: #fff;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: var(--sgs-radius-full);
    border: 1px solid rgba(255,255,255,.15);
    transition: var(--sgs-transition);
}
.sgs-stat:hover {
    background: rgba(255,255,255,.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.sgs-stat--badge {
    background: linear-gradient(135deg, #F59E0B 0%, #FB923C 100%);
    border-color: rgba(251,146,60,.3);
    font-weight: 700;
}


/* ============================================================================
   BUTTONS
   ============================================================================ */

.sgs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border-radius: var(--sgs-radius-lg);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: var(--sgs-transition);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.sgs-btn::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    /* Note: ripple is rgba(255,255,255,.2) — works on coloured buttons.
       On .sgs-btn--primary (white bg) it's invisible but harmless. */
    background: rgba(255,255,255,.2);
    transform: translate(-50%, -50%);
    transition: width .6s, height .6s;
}
.sgs-btn:hover::before { width: 300px; height: 300px; }

.sgs-btn--primary {
    background: #fff;
    color: var(--sgs-primary);
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.sgs-btn--primary:hover {
    background: var(--sgs-accent);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245,158,11,.3);
}

.sgs-btn--outline {
    border: 2px solid rgba(255,255,255,.5);
    color: #fff;
    background: transparent;
    backdrop-filter: blur(10px);
}
.sgs-btn--outline:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.8);
    transform: translateY(-3px);
}

.sgs-btn--shop {
    width: 100%;
    background: var(--sgs-accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(245,158,11,.25);
}
.sgs-btn--shop:hover {
    background: var(--sgs-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,.35);
}

.sgs-btn--orange {
    background: var(--sgs-accent);
    color: #000;
    border: none;
    padding: 16px 32px;
    font-weight: 700;
}
.sgs-btn--orange:hover {
    background: var(--sgs-accent-dark);
    transform: translateY(-2px);
}


/* ============================================================================
   SECTIONS
   ============================================================================ */

.sgs-section { padding: 100px 0; }
.sgs-section--alt { background: var(--sgs-bg-alt); }

/*
 * PERF: content-visibility:auto lets the browser skip painting off-screen
 * sections until the user scrolls near them (Chrome 85+, Edge 85+, Safari 17+).
 * contain-intrinsic-size provides a placeholder height so the scrollbar
 * doesn't jump when the section is rendered (CLS = 0).
 */
.sgs-section,
.sgs-deals-section,
.sgs-newsletter-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 800px; /* Rough height placeholder */
}

/* Hero is always visible — no content-visibility on it */
.sgs-hero {
    content-visibility: visible;
    contain-intrinsic-size: none;
}

.sgs-section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--sgs-spacing-md);
    color: var(--sgs-text);
    position: relative;
    display: inline-block;
    width: 100%;
}
.sgs-section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--sgs-primary), var(--sgs-accent));
    border-radius: 2px;
}

.sgs-section-subtitle {
    text-align: center;
    color: var(--sgs-text-light);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto 60px;
    line-height: 1.6;
}

.sgs-trust-intro {
    text-align: center;
    max-width: 850px;
    margin: 0 auto 50px;
    font-size: 1.1rem;
    color: var(--sgs-text-light);
    line-height: 1.8;
}


/* ============================================================================
   DISCLOSURE
   ============================================================================ */

.sgs-disclosure-box {
    display: flex;
    gap: 24px;
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 2px solid rgba(245,158,11,.2);
    border-left: 5px solid var(--sgs-accent);
    padding: 32px;
    border-radius: var(--sgs-radius-lg);
    max-width: 950px;
    margin: 0 auto;
    box-shadow: var(--sgs-shadow);
    transition: var(--sgs-transition);
}
.sgs-disclosure-box:hover {
    box-shadow: var(--sgs-shadow-lg);
    transform: translateY(-2px);
}

.sgs-disclosure-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(245,158,11,.15);
    border-radius: var(--sgs-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sgs-accent);
}
.sgs-disclosure-title {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sgs-accent-dark);
    margin-bottom: 10px;
}
.sgs-disclosure-text { color: var(--sgs-text); line-height: 1.7; margin: 0; }


/* ============================================================================
   CATEGORIES
   ============================================================================ */

.sgs-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    /* PERF: contain layout so individual card repaints don't cascade */
    contain: layout;
}

.sgs-category-card {
    background: #fff;
    border: 2px solid var(--sgs-border-light);
    border-radius: var(--sgs-radius-xl);
    padding: 40px 32px;
    text-align: center;
    text-decoration: none;
    color: var(--sgs-text);
    transition: var(--sgs-transition);
    position: relative;
    overflow: hidden;
}
.sgs-category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sgs-primary), var(--sgs-accent));
    transform: scaleX(0);
    transition: transform .4s ease;
}
.sgs-category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--sgs-shadow-xl);
    border-color: var(--sgs-primary);
}
.sgs-category-card:hover::before { transform: scaleX(1); }

.sgs-category-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: var(--sgs-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--sgs-transition);
}
.sgs-category-card:hover .sgs-category-icon { transform: scale(1.1) rotate(5deg); }

.sgs-category-icon--blue   { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.sgs-category-icon--pink   { background: linear-gradient(135deg, #FCE7F3, #FBCFE8); }
.sgs-category-icon--purple { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); }
.sgs-category-icon--orange { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.sgs-category-icon--green  { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.sgs-category-icon--yellow { background: linear-gradient(135deg, #FEF9C3, #FDE047); }
.sgs-category-icon--teal   { background: linear-gradient(135deg, #CCFBF1, #99F6E4); }

.sgs-category-name { font-size: 1.35rem; font-weight: 700; margin-bottom: 10px; color: var(--sgs-text); }
.sgs-category-desc { color: var(--sgs-text-light); font-size: 1rem; margin: 0; line-height: 1.5; }


/* ============================================================================
   REVIEWS
   ============================================================================ */

.sgs-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    contain: layout; /* PERF */
}

.sgs-review-card {
    background: #fff;
    border-radius: var(--sgs-radius-xl);
    overflow: hidden;
    border: 2px solid var(--sgs-border-light);
    transition: var(--sgs-transition);
    position: relative;
}
.sgs-review-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--sgs-radius-xl);
    padding: 2px;
    background: linear-gradient(135deg, var(--sgs-primary), var(--sgs-accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none; /* Prevent accidental blocking of clicks */
}
.sgs-review-card:hover { box-shadow: var(--sgs-shadow-xl); transform: translateY(-6px); }
.sgs-review-card:hover::after { opacity: 1; }

/*
 * FIX CLS: Explicit aspect-ratio reserves the correct space before the image
 * loads, preventing layout shifts (CLS = 0 for this element).
 * 400×300 matches the sgs-review-card image size registered in functions.php.
 */
.sgs-review-image {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--sgs-bg-alt), #E2E8F0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sgs-text-light);
    overflow: hidden;
    font-size: 2.5rem;
    position: relative;
}
.sgs-review-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.05) 100%);
}
.sgs-review-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.sgs-review-card:hover .sgs-review-image img { transform: scale(1.05); }

.sgs-review-content { padding: 28px; }
.sgs-review-title   { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; line-height: 1.4; }
.sgs-review-title a { color: var(--sgs-text); text-decoration: none; transition: var(--sgs-transition-fast); }
.sgs-review-title a:hover { color: var(--sgs-primary); }
.sgs-review-excerpt { color: var(--sgs-text-light); font-size: 1rem; margin-bottom: 18px; line-height: 1.65; }
.sgs-review-link {
    color: var(--sgs-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--sgs-transition-fast);
}
.sgs-review-link:hover { color: var(--sgs-primary-dark); gap: 10px; }

.sgs-view-all { text-align: center; margin-top: 60px; }
.sgs-no-content { text-align: center; color: var(--sgs-text-light); grid-column: 1/-1; padding: 60px 20px; font-size: 1.1rem; }


/* ============================================================================
   DEALS
   ============================================================================ */

.sgs-deals-section {
    background: linear-gradient(135deg, var(--sgs-bg-dark) 0%, var(--sgs-bg-dark-alt) 100%);
    color: #fff;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}
.sgs-deals-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(79,70,229,.1) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(245,158,11,.1) 0%, transparent 50%);
    pointer-events: none;
}
.sgs-deals-section .sgs-section-title { color: #fff; }
.sgs-deals-section .sgs-section-title::after { background: linear-gradient(90deg, #fff, var(--sgs-accent)); }
.sgs-deals-section .sgs-section-subtitle { color: rgba(255,255,255,.8); }

.sgs-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    position: relative;
    z-index: 1;
    contain: layout; /* PERF */
}

.sgs-deal-card {
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--sgs-radius-xl);
    overflow: hidden;
    transition: var(--sgs-transition);
}
.sgs-deal-card:hover {
    background: rgba(255,255,255,.1);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,.3);
}

.sgs-deal__link { text-decoration: none; color: inherit; display: block; }

/*
 * FIX CLS: aspect-ratio prevents layout shift while deal image loads.
 * 350×350 matches sgs-deal-card image size from functions.php.
 */
.sgs-deal__image {
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    overflow: hidden;
    font-size: 2rem;
    position: relative;
}
.sgs-deal__image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.3) 100%);
}
.sgs-deal__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.sgs-deal-card:hover .sgs-deal__image img { transform: scale(1.08); }

.sgs-deal__content { padding: 28px; }
.sgs-deal__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; color: #fff; line-height: 1.4; }

.sgs-rating { margin-bottom: 14px; }
.sgs-rating__score {
    background: var(--sgs-secondary);
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--sgs-radius);
    font-weight: 700;
    font-size: .95rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sgs-deal__description { color: rgba(255,255,255,.75); font-size: 1rem; margin-bottom: 18px; line-height: 1.6; }

.sgs-price { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.sgs-price__current   { font-size: 1.75rem; font-weight: 800; color: var(--sgs-accent); }
.sgs-price__original  { color: rgba(255,255,255,.5); text-decoration: line-through; font-size: 1.1rem; }


/* ============================================================================
   NEWSLETTER
   ============================================================================ */

.sgs-newsletter-section {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #6366F1 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}
.sgs-newsletter-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.08) 0%, transparent 50%);
    pointer-events: none;
}

.sgs-newsletter-box {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1;
}

.sgs-newsletter-badge {
    display: inline-block;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: var(--sgs-radius-full);
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,.3);
}

.sgs-newsletter-title  { font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 18px; color: #fff; }
.sgs-newsletter-desc   { opacity: .92; margin-bottom: 36px; font-size: 1.15rem; line-height: 1.7; }
.sgs-newsletter-form   { display: flex; flex-direction: column; gap: 14px; }

.sgs-newsletter-input-group { display: flex; gap: 12px; }
.sgs-newsletter-input-group input {
    flex: 1;
    padding: 18px 24px;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.95);
    border-radius: var(--sgs-radius-lg);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--sgs-transition-fast);
}
.sgs-newsletter-input-group input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,.2);
    background: #fff;
}

.sgs-newsletter-privacy   { font-size: .9rem; opacity: .85; margin-top: 18px; line-height: 1.6; }
.sgs-newsletter-privacy a { color: #fff; text-decoration: underline; font-weight: 600; }


/* ============================================================================
   FOOTER
   ============================================================================ */

.sgs-footer { background: var(--sgs-bg-dark); color: #CBD5E1; padding: 100px 0 50px; }

.sgs-footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 60px;
    margin-bottom: 50px;
}

.sgs-footer-brand p { margin-top: 18px; line-height: 1.8; color: rgba(203,213,225,.8); }

.sgs-footer-social { display: flex; gap: 12px; margin-top: 28px; }
.sgs-social-link {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.08);
    border-radius: var(--sgs-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: var(--sgs-transition);
}
.sgs-social-link:hover { background: var(--sgs-primary); color: #fff; transform: translateY(-3px); }

.sgs-footer-title   { color: #fff; font-weight: 700; text-transform: uppercase; font-size: .9rem; letter-spacing: .05em; margin-bottom: 28px; }
.sgs-footer-menu    { list-style: none; padding: 0; margin: 0; }
.sgs-footer-menu li { margin-bottom: 16px; }
.sgs-footer-menu a  { color: rgba(148,163,184,.9); text-decoration: none; transition: var(--sgs-transition-fast); display: inline-block; }
.sgs-footer-menu a:hover { color: #fff; transform: translateX(5px); }

.sgs-footer-divider  { height: 1px; background: rgba(255,255,255,.1); margin: 60px 0 40px; }
.sgs-footer-bottom   { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; font-size: .95rem; }
.sgs-footer-disclaimer { margin-top: 10px; font-size: .88rem; color: #64748B; line-height: 1.6; }
.sgs-verified {
    background: rgba(16,185,129,.2);
    color: #10B981;
    padding: 8px 16px;
    border-radius: var(--sgs-radius);
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid rgba(16,185,129,.3);
}


/* ============================================================================
   SINGLE POST STYLES (preserved exactly — used in post content)
   ============================================================================ */

.sgs-analysis-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
    padding: 25px;
    background: var(--sgs-bg-alt);
    border-radius: var(--sgs-radius-lg);
}
.sgs-analysis-list    { list-style: none; padding: 0; }
.sgs-analysis-list li { position: relative; padding-left: 30px; margin-bottom: 12px; font-weight: 500; }
.sgs-pros li::before  { content: '✓'; position: absolute; left: 0; color: var(--sgs-secondary); font-weight: 900; }
.sgs-cons li::before  { content: '✕'; position: absolute; left: 0; color: var(--color-ali); font-weight: 900; }
.sgs-analysis-title   { margin-top: 0; color: var(--sgs-text); font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }

.smart-container { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.smart-header h1 { font-size: 2.2rem; margin-bottom: 10px; }
.smart-meta      { color: #666; margin-bottom: 20px; }
.smart-thumb img { border-radius: 12px; width: 100%; height: auto; }
.smart-rating    { background: #fef3c7; padding: 20px; border-radius: 10px; margin: 30px 0; text-align: center; }
.smart-rating .stars { font-size: 1.8rem; color: #f59e0b; }
.smart-cta       { margin: 40px 0; padding: 30px; border-radius: 12px; background: #f8fafc; text-align: center; }
.smart-cta .price { font-size: 2rem; font-weight: bold; margin-bottom: 20px; }

.buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.btn     { padding: 12px 25px; border-radius: 40px; font-weight: 600; text-decoration: none; display: inline-block; transition: var(--sgs-transition); }
.btn.amazon { background: var(--color-amazon); color: #000; }
.btn.ali    { background: var(--color-ali); color: #fff; }
.btn.amazon:hover { background: #FFB300; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255,153,0,.3); }
.btn.ali:hover    { background: var(--color-ali-dark); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(228,50,37,.3); }


/* ============================================================================
   RESPONSIVE — TABLET
   ============================================================================ */

@media (max-width: 1024px) {
    .sgs-categories-grid,
    .sgs-reviews-grid,
    .sgs-deals-grid       { grid-template-columns: repeat(2, 1fr); }

    .sgs-footer-grid      { grid-template-columns: 1fr 1fr; gap: 50px; }
    .sgs-section          { padding: 80px 0; }

    /* PERF: Disable GPU-composited backdrop-filter on mid-range tablets */
    .sgs-header,
    .sgs-hero__badge,
    .sgs-stat,
    .sgs-deal-card,
    .sgs-newsletter-badge {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .sgs-hero::before { animation: none !important; }
}


/* ============================================================================
   RESPONSIVE — MOBILE
   ============================================================================ */

@media (max-width: 768px) {
    .sgs-mobile-toggle { display: block; }

    .sgs-header__nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--sgs-bg-dark);
        flex-direction: column;
        padding: 24px;
        border-bottom: 1px solid rgba(255,255,255,.1);
        box-shadow: var(--sgs-shadow-xl);
        z-index: 999;
    }
    .sgs-header__nav.is-open { display: flex; }
    .sgs-header__nav .sgs-nav-link {
        width: 100%;
        padding: 16px;
        border-bottom: 1px solid rgba(255,255,255,.1);
        color: #fff;
    }
    .sgs-header__nav .sgs-nav-link:last-child { border-bottom: none; }

    .sgs-hero            { padding: 80px 0 60px; }
    .sgs-hero__stats     { gap: var(--sgs-spacing-sm); }
    .sgs-section         { padding: 60px 0; }

    .sgs-categories-grid,
    .sgs-reviews-grid,
    .sgs-deals-grid      { grid-template-columns: 1fr; gap: 24px; }

    .sgs-footer-grid     { grid-template-columns: 1fr; gap: 40px; }
    .sgs-hero__buttons   { flex-direction: column; align-items: center; }
    .sgs-btn             { width: 100%; max-width: 320px; }

    .sgs-disclosure-box        { flex-direction: column; text-align: center; padding: 28px 24px; }
    .sgs-newsletter-input-group { flex-direction: column; }
    .sgs-footer-bottom         { flex-direction: column; text-align: center; }

    /*
     * PERF: Kill heavy animations on mobile to reduce CPU/battery drain.
     * FIX: Scoped to .sgs-* only — previously used bare `*` which would
     * disable transitions in 3rd-party plugins (WooCommerce, etc.).
     */
    .sgs-hero::before           { display: none; }

    .sgs-hero__badge,
    .sgs-hero__title,
    .sgs-hero__subtitle,
    .sgs-hero__buttons,
    .sgs-hero__stats            { animation-duration: 0.01ms !important; }

    .sgs-stat,
    .sgs-category-card,
    .sgs-review-card,
    .sgs-deal-card,
    .sgs-btn,
    .sgs-disclosure-box,
    .sgs-social-link,
    .sgs-footer-menu a,
    .sgs-nav-link               { transition-duration: 0.01ms !important; }
}


/* ============================================================================
   RESPONSIVE — SMALL MOBILE
   ============================================================================ */

@media (max-width: 480px) {
    .sgs-container,
    .ast-container       { padding: 0 var(--sgs-spacing-sm); }

    .sgs-section-title   { font-size: 1.75rem; }
    .sgs-hero__title     { font-size: 2rem; }
    .sgs-hero__subtitle  { font-size: 1rem; }

    .sgs-hero__stats     { flex-direction: column; align-items: center; gap: 12px; }
    .sgs-stat            { width: 100%; max-width: 280px; justify-content: center; }
    .sgs-category-card   { padding: 32px 24px; }

    .sgs-review-content,
    .sgs-deal__content   { padding: 24px 20px; }
}


/* ============================================================================
   PRINT
   ============================================================================ */

@media print {
    .sgs-header,
    .sgs-footer,
    .sgs-newsletter-section,
    .sgs-btn              { display: none; }

    .sgs-hero             { background: #f5f5f5 !important; color: #000; padding: 40px 0; }
    .sgs-section          { padding: 30px 0; }
}


/* ============================================================================
   ACCESSIBILITY — reduced motion
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration:       0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration:      0.01ms !important;
        scroll-behavior:          auto !important;
    }
}


/* ============================================================================
   FOCUS VISIBLE
   ============================================================================ */

:focus-visible {
    outline: 3px solid var(--sgs-primary);
    outline-offset: 2px;
}


/* ============================================================================
   END OF STYLESHEET
   ============================================================================ */