/*
 * Theme Name:  Smart Gear Select
 * Theme URI:   https://smartgearselect.com
 * Description: Child theme for Smart Gear Select — expert tech reviews and buying guides.
 * Author:      Smart Gear Select
 * Author URI:  https://smartgearselect.com
 * Template:    astra
 * Version:     3.1.2
 * Text Domain: smartgearselect
 * License:     GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 */

/* ══════════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand colours */
    --sgs-primary:       #4f46e5;
    --sgs-primary-dark:  #3730a3;
    --sgs-primary-light: #eef2ff;
    --sgs-accent:        #f59e0b;
    --sgs-success:       #16a34a;
    --sgs-danger:        #ef4444;

    /* Neutrals */
    --sgs-heading:       #111827;
    --sgs-text:          #374151;
    --sgs-text-muted:    #6b7280;
    --sgs-bg:            #ffffff;
    --sgs-bg-alt:        #f9fafb;
    --sgs-border:        #e5e7eb;

    /* Typography */
    --sgs-font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sgs-text-xs:       0.75rem;
    --sgs-text-sm:       0.875rem;
    --sgs-text-md:       1rem;
    --sgs-text-lg:       1.125rem;
    --sgs-text-xl:       1.25rem;

    /* Spacing */
    --sgs-space-xs:      0.25rem;
    --sgs-space-sm:      0.5rem;
    --sgs-space-md:      1rem;
    --sgs-space-lg:      1.5rem;
    --sgs-space-xl:      2rem;
    --sgs-space-2xl:     3rem;
    --sgs-space-3xl:     5rem;

    /* Radii */
    --sgs-radius-sm:     4px;
    --sgs-radius-md:     8px;
    --sgs-radius-lg:     12px;
    --sgs-radius-xl:     16px;

    /* Shadows */
    --sgs-shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --sgs-shadow-md:     0 4px 12px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
    --sgs-shadow-lg:     0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE
══════════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sgs-font-sans);
    color: var(--sgs-text);
    background-color: var(--sgs-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--sgs-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
══════════════════════════════════════════════════════════════════════════════ */

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

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

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: 3px solid var(--sgs-accent);
    outline-offset: 2px;
    clip: auto;
    clip-path: none;
    width: auto;
    height: auto;
    margin: 0;
}

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

[hidden] {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════════ */

.sgs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sgs-space-xs);
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--sgs-radius-md);
    font-family: var(--sgs-font-sans);
    font-size: var(--sgs-text-sm);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease,
                color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.sgs-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.sgs-btn:active {
    transform: translateY(0);
}

.sgs-btn:disabled,
.sgs-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.sgs-btn--primary {
    background-color: var(--sgs-primary);
    border-color: var(--sgs-primary);
    color: #fff;
}

.sgs-btn--primary:hover {
    background-color: var(--sgs-primary-dark);
    border-color: var(--sgs-primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

/* Outline */
.sgs-btn--outline {
    background-color: transparent;
    border-color: var(--sgs-primary);
    color: var(--sgs-primary);
}

.sgs-btn--outline:hover {
    background-color: var(--sgs-primary);
    color: #fff;
}

/* Ghost */
.sgs-btn--ghost {
    background-color: transparent;
    border-color: var(--sgs-border);
    color: var(--sgs-text);
}

.sgs-btn--ghost:hover {
    background-color: var(--sgs-bg-alt);
    border-color: var(--sgs-primary);
    color: var(--sgs-primary);
}

/* Sizes */
.sgs-btn--sm {
    padding: 8px 16px;
    font-size: var(--sgs-text-xs);
}

.sgs-btn--lg {
    padding: 16px 32px;
    font-size: var(--sgs-text-lg);
}

.sgs-btn--full {
    width: 100%;
    justify-content: center;
}

/* ══════════════════════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════════════════════ */

.sgs-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,.97);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sgs-border);
    box-shadow: var(--sgs-shadow-sm);
}

.sgs-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sgs-space-md);
    height: 68px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sgs-space-lg);
}

/* Logo */
.sgs-logo {
    display: flex;
    align-items: center;
    gap: var(--sgs-space-sm);
    text-decoration: none;
    flex-shrink: 0;
}

.sgs-logo:hover {
    text-decoration: none;
}

.sgs-logo__icon {
    font-size: 1.75rem;
    line-height: 1;
}

.sgs-logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sgs-logo__name {
    font-size: var(--sgs-text-md);
    font-weight: 800;
    color: var(--sgs-heading);
    letter-spacing: -0.02em;
}

.sgs-logo__tagline {
    font-size: var(--sgs-text-xs);
    color: var(--sgs-text-muted);
    font-weight: 400;
}

/* Primary nav */
.sgs-primary-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.sgs-nav-list {
    display: flex;
    align-items: center;
    gap: var(--sgs-space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.sgs-nav-list a {
    display: block;
    padding: 8px 14px;
    font-size: var(--sgs-text-sm);
    font-weight: 600;
    color: var(--sgs-text);
    border-radius: var(--sgs-radius-md);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sgs-nav-list a:hover,
.sgs-nav-list .current-menu-item > a,
.sgs-nav-list .current_page_item > a {
    background: var(--sgs-primary-light);
    color: var(--sgs-primary);
    text-decoration: none;
}

/* Header actions */
.sgs-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sgs-space-sm);
    flex-shrink: 0;
}

.sgs-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--sgs-border);
    border-radius: var(--sgs-radius-md);
    background: transparent;
    color: var(--sgs-text);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
    line-height: 1;
}

.sgs-icon-btn:hover {
    background: var(--sgs-primary-light);
    border-color: var(--sgs-primary);
    color: var(--sgs-primary);
    text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE NAV
══════════════════════════════════════════════════════════════════════════════ */

.sgs-mobile-toggle {
    display: none;
}

.sgs-mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(17,24,39,.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sgs-mobile-nav.active {
    display: block;
}

.sgs-mobile-nav__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 90vw);
    height: 100%;
    background: var(--sgs-bg);
    box-shadow: var(--sgs-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sgs-mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sgs-space-md) var(--sgs-space-lg);
    border-bottom: 1px solid var(--sgs-border);
}

.sgs-mobile-nav__title {
    font-size: var(--sgs-text-md);
    font-weight: 700;
    color: var(--sgs-heading);
}

.sgs-mobile-nav__body {
    padding: var(--sgs-space-md);
    flex: 1;
}

.sgs-mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sgs-mobile-nav__list a {
    display: flex;
    align-items: center;
    gap: var(--sgs-space-sm);
    padding: 12px var(--sgs-space-md);
    font-size: var(--sgs-text-md);
    font-weight: 600;
    color: var(--sgs-text);
    border-radius: var(--sgs-radius-md);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 44px; /* tap target */
}

.sgs-mobile-nav__list a:hover,
.sgs-mobile-nav__list a:focus-visible {
    background: var(--sgs-primary-light);
    color: var(--sgs-primary);
    text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SEARCH OVERLAY
══════════════════════════════════════════════════════════════════════════════ */

.sgs-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(17,24,39,.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    padding: 12vh var(--sgs-space-md) var(--sgs-space-md);
    display: none;
}

.sgs-search-overlay.active {
    display: flex;
}

.sgs-search-overlay__inner {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: var(--sgs-radius-lg);
    padding: var(--sgs-space-lg);
    box-shadow: var(--sgs-shadow-lg);
}

.sgs-search-overlay__close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.sgs-search-overlay form,
.sgs-search-overlay .search-form {
    display: flex;
    gap: var(--sgs-space-sm);
    align-items: center;
}

.sgs-search-overlay input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    font-size: var(--sgs-text-md);
    border: 1px solid var(--sgs-border);
    border-radius: var(--sgs-radius-md);
    color: var(--sgs-text);
    min-width: 0;
}

.sgs-search-overlay input[type="search"]:focus {
    outline: 3px solid var(--sgs-primary);
    outline-offset: 2px;
}

.sgs-search-overlay button[type="submit"] {
    padding: 12px 20px;
    background: var(--sgs-primary);
    color: #fff;
    border: 0;
    border-radius: var(--sgs-radius-md);
    font-weight: 600;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════════════════════ */

.sgs-site-footer {
    background: var(--sgs-heading);
    color: rgba(255,255,255,.75);
    padding: var(--sgs-space-2xl) 0 var(--sgs-space-lg);
}

.sgs-site-footer .sgs-logo__name,
.sgs-site-footer .sgs-logo__tagline {
    color: #fff;
}

.sgs-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sgs-space-lg);
}

.sgs-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--sgs-space-xl);
    padding-bottom: var(--sgs-space-xl);
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: var(--sgs-space-lg);
}

.sgs-footer-brand__desc {
    font-size: var(--sgs-text-sm);
    line-height: 1.65;
    color: rgba(255,255,255,.65);
    margin: var(--sgs-space-sm) 0 var(--sgs-space-md);
}

.sgs-footer-col__heading {
    font-size: var(--sgs-text-sm);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--sgs-space-md);
}

.sgs-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sgs-space-xs);
}

.sgs-footer-nav a {
    font-size: var(--sgs-text-sm);
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: color 0.15s ease;
}

.sgs-footer-nav a:hover,
.sgs-footer-nav a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.sgs-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sgs-space-sm);
    font-size: var(--sgs-text-xs);
    color: rgba(255,255,255,.5);
}

.sgs-footer-bottom a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: color 0.15s ease;
}

.sgs-footer-bottom a:hover,
.sgs-footer-bottom a:focus-visible {
    color: #fff;
}

.sgs-footer-legal {
    display: flex;
    gap: var(--sgs-space-md);
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CONTENT AREA
══════════════════════════════════════════════════════════════════════════════ */

.sgs-content {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--sgs-space-xl) var(--sgs-space-lg);
}

.sgs-content h1,
.sgs-content h2,
.sgs-content h3,
.sgs-content h4 {
    color: var(--sgs-heading);
    line-height: 1.25;
    margin-top: var(--sgs-space-xl);
    margin-bottom: var(--sgs-space-sm);
}

.sgs-content p {
    margin: 0 0 var(--sgs-space-md);
    line-height: 1.75;
}

.sgs-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--sgs-text-sm);
    margin-bottom: var(--sgs-space-lg);
}

.sgs-content table th,
.sgs-content table td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--sgs-border);
}

.sgs-content table th {
    background: var(--sgs-bg-alt);
    font-weight: 700;
    color: var(--sgs-heading);
}

.ast-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sgs-space-lg);
}

/* ══════════════════════════════════════════════════════════════════════════════
   SCROLL TO TOP
══════════════════════════════════════════════════════════════════════════════ */

.sgs-scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--sgs-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--sgs-shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 500;
}

.sgs-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sgs-scroll-top:hover,
.sgs-scroll-top:focus-visible {
    background: var(--sgs-primary-dark);
    box-shadow: var(--sgs-shadow-lg);
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .sgs-primary-nav { display: none; }
    .sgs-mobile-toggle { display: inline-flex; }

    .sgs-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .sgs-header-inner {
        padding: 0 var(--sgs-space-md);
        height: 60px;
    }

    .sgs-footer-grid {
        grid-template-columns: 1fr;
    }

    .sgs-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .sgs-footer-legal {
        justify-content: center;
    }

    .sgs-scroll-top {
        bottom: 20px;
        right: 20px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PRINT
══════════════════════════════════════════════════════════════════════════════ */

@media print {
    .sgs-site-header,
    .sgs-site-footer,
    .sgs-scroll-top,
    .sgs-mobile-nav,
    .sgs-search-overlay {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   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;
    }
}
