/* ============================================================================
   SOKYO Analytics — Material Design 3 Stylesheet (COMPLETE - WITH FIXES)
   ============================================================================ */

/* ── Imports & Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@900&family=Playfair+Display:wght@900&family=Bebas+Neue&family=Righteous&family=Orbitron:wght@900&family=Bungee&family=Abril+Fatface&display=swap');

/* ── M3 Design Tokens ── */
:root {
    --md-sys-color-primary:              #3F6212;
    --md-sys-color-on-primary:           #FFFFFF;
    --md-sys-color-primary-container:    #C7D7B2;
    --md-sys-color-on-primary-container: #0F2000;
    --md-sys-color-secondary:            #556B2F;
    --md-sys-color-on-secondary:         #FFFFFF;
    --md-sys-color-secondary-container:  #DDE3D0;
    --md-sys-color-on-secondary-container: #141F00;
    --md-sys-color-tertiary:             #6A7BFF;
    --md-sys-color-on-tertiary:          #FFFFFF;
    --md-sys-color-tertiary-container:   #E6E8FF;
    --md-sys-color-on-tertiary-container:#001160;
    --md-sys-color-error:                #BA1A1A;
    --md-sys-color-on-error:             #FFFFFF;
    --md-sys-color-error-container:      #FFDAD6;
    --md-sys-color-background:           #F7F8F3;
    --md-sys-color-on-background:        #2F342C;
    --md-sys-color-surface:              #F7F8F3;
    --md-sys-color-on-surface:           #2F342C;
    --md-sys-color-surface-variant:      #EEF0E7;
    --md-sys-color-on-surface-variant:   #6E7566;
    --md-sys-color-surface-container-lowest:  #FFFFFF;
    --md-sys-color-surface-container-low:     #F4F5F0;
    --md-sys-color-surface-container:         #EEF0E7;
    --md-sys-color-surface-container-high:    #E8EAE2;
    --md-sys-color-surface-container-highest: #E2E4DB;
    --md-sys-color-outline:              #C7D7B2;
    --md-sys-color-outline-variant:      #E5E7DE;
    --md-sys-color-inverse-surface:      #2F342C;
    --md-sys-color-inverse-on-surface:   #F4F5F0;
    --md-sys-elevation-1: 0 1px 3px 1px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08);
    --md-sys-elevation-2: 0 2px 6px 2px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.08);
    --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.10);
    --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,.08), 0 2px 3px rgba(0,0,0,.10);
    --md-sys-shape-extra-small:  4px;
    --md-sys-shape-small:        8px;
    --md-sys-shape-medium:       12px;
    --md-sys-shape-large:        16px;
    --md-sys-shape-extra-large:  28px;
    --md-sys-shape-full:         9999px;
    --md-sys-motion-easing-standard:           cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized:         cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-sys-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
    --md-sys-motion-duration-medium2: 300ms;
    --md-sys-motion-duration-medium3: 350ms;
    --c-moss:       #AEBF96;
    --c-moss-light: #C7D7B2;
    --c-moss-dark:  #7F8C6D;
    --c-charcoal:   #2F342C;
    --c-slate:      #6E7566;
}

body.dark {
    --md-sys-color-primary:              #A3C77E;
    --md-sys-color-on-primary:           #1B3700;
    --md-sys-color-primary-container:    #2B5000;
    --md-sys-color-on-primary-container: #BFDD9B;
    --md-sys-color-secondary:            #B7CCA0;
    --md-sys-color-on-secondary:         #233515;
    --md-sys-color-secondary-container:  #394C2A;
    --md-sys-color-on-secondary-container: #D3E8BA;
    --md-sys-color-tertiary:             #B8BFFF;
    --md-sys-color-on-tertiary:          #1A2876;
    --md-sys-color-tertiary-container:   #3140A0;
    --md-sys-color-background:           #1C2119;
    --md-sys-color-on-background:        #DDE3D0;
    --md-sys-color-surface:              #1C2119;
    --md-sys-color-on-surface:           #DDE3D0;
    --md-sys-color-surface-variant:      #343C30;
    --md-sys-color-on-surface-variant:   #8A9480;
    --md-sys-color-surface-container-lowest:  #161B14;
    --md-sys-color-surface-container-low:     #1C2119;
    --md-sys-color-surface-container:         #262B23;
    --md-sys-color-surface-container-high:    #2C332A;
    --md-sys-color-surface-container-highest: #343C30;
    --md-sys-color-outline:              #7F8C6D;
    --md-sys-color-outline-variant:      #3A4234;
    --md-sys-elevation-1: 0 1px 3px 1px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.3);
    --md-sys-elevation-2: 0 2px 6px 2px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.3);
    --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.3);
    --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,.22), 0 2px 3px rgba(0,0,0,.32);
}

/* ============================================================================
   CRITICAL FIX: Remove ALL default link styling
   ============================================================================ */
a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover,
a:visited,
a:active,
a:focus {
    text-decoration: none;
}

/* Only style links that are explicitly meant to look like links */
.text-link,
a.text-link {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
* { font-family: 'Google Sans', 'Segoe UI', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    transition: background-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
    margin: 0; min-height: 100vh;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
::selection { background: var(--c-moss); color: #fff; }
::-moz-selection { background: var(--c-moss); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--md-sys-color-surface); }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline); border-radius: 4px; border: 2px solid var(--md-sys-color-surface); }
::-webkit-scrollbar-thumb:hover { background: var(--c-moss); }
* { scrollbar-width: thin; scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--md-sys-color-primary); outline-offset: 3px; border-radius: var(--md-sys-shape-extra-small); }
*:focus:not(:focus-visible) { outline: none; }
img { image-rendering: -webkit-optimize-contrast; }
img[loading="lazy"] { opacity: 0; transition: opacity .3s ease-in; }
img[loading="lazy"].loaded { opacity: 1; }

/* ============================================================================
   AMBIENT BACKGROUND — Grid Lines + Arc Overlay
   ============================================================================ */
.md3-bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-image:
        linear-gradient(var(--md-sys-color-outline-variant) 1px, transparent 1px),
        linear-gradient(90deg, var(--md-sys-color-outline-variant) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.45;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
body.dark .md3-bg-grid { opacity: 0.12; }

.md3-arc-overlay {
    position: fixed;
    top: -220px;
    left: 50%;
    transform: translateX(-50%);
    width: 150vw;
    height: 640px;
    background: radial-gradient(ellipse at 50% 30%,
        color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent) 0%,
        color-mix(in srgb, var(--md-sys-color-secondary) 4%, transparent) 50%,
        transparent 75%);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
body.dark .md3-arc-overlay {
    background: radial-gradient(ellipse at 50% 30%,
        color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent) 0%,
        transparent 65%);
}

/* Ensure stacked elements sit above the ambient background */
.md3-scrim, .md3-drawer, .md3-top-app-bar, .md3-main, .md3-footer {
    position: relative;
    z-index: 1;
}
.md3-scrim  { z-index: 299; }
.md3-drawer { z-index: 300; }
.md3-top-app-bar { z-index: 200; }

/* ============================================================================
   ============================================================================ */
.md3-top-app-bar {
    position: sticky; top: 0; z-index: 200;
    background: var(--md-sys-color-surface-container-low);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    transition: background var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                box-shadow var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                border-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
.md3-top-app-bar.scrolled { box-shadow: var(--md-sys-elevation-2); background: var(--md-sys-color-surface-container); border-bottom-color: transparent; }
.md3-top-app-bar__inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 8px; }
.md3-top-app-bar__logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; transition: opacity var(--md-sys-motion-duration-short4); }
.md3-top-app-bar__logo:hover { opacity: .88; }
.md3-top-app-bar__logo-img { height: 48px; width: auto; object-fit: contain; }
.md3-nav-tabs { display: none; align-items: center; gap: 2px; flex: 1; justify-content: center; }
@media (min-width: 768px) { .md3-nav-tabs { display: flex; } }
.md3-nav-tab {
    position: relative; padding: 8px 16px; border-radius: var(--md-sys-shape-full); text-decoration: none;
    font-size: 14px; font-weight: 500; letter-spacing: .1px; color: var(--md-sys-color-on-surface-variant);
    transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
                background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    white-space: nowrap;
}
.md3-nav-tab::after { content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 0; height: 3px; background: var(--md-sys-color-primary); border-radius: 3px 3px 0 0; transition: width var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-emphasized); }
.md3-nav-tab:hover { color: var(--md-sys-color-on-surface); background: rgba(0,0,0,.06); }
body.dark .md3-nav-tab:hover { background: rgba(255,255,255,.08); }
.md3-nav-tab--active, .md3-nav-tab.active { color: var(--md-sys-color-primary); font-weight: 700; }
.md3-nav-tab--active::after, .md3-nav-tab.active::after { width: 100%; }

/* Legacy compat */
.nav-link { color: var(--md-sys-color-on-surface-variant); text-decoration: none; }
.nav-link.active { color: var(--md-sys-color-primary); }

.md3-top-app-bar__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.md3-top-app-bar__menu-btn { display: flex; }
@media (min-width: 768px) { .md3-top-app-bar__menu-btn { display: none; } }

/* ============================================================================
   M3 ICON BUTTONS
   ============================================================================ */
.md3-icon-btn {
    position: relative; width: 40px; height: 40px; border-radius: var(--md-sys-shape-full);
    border: none; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none; overflow: hidden;
    transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
                transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.md3-icon-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short4); }
.md3-icon-btn:hover::before  { opacity: .08; }
.md3-icon-btn:focus::before  { opacity: .12; }
.md3-icon-btn:active::before { opacity: .16; }
.md3-icon-btn:active { transform: scale(.95); }
.md3-icon-btn--standard { background: transparent; color: var(--md-sys-color-on-surface-variant); }
.md3-icon-btn--outlined { background: transparent; color: var(--md-sys-color-on-surface-variant); border: 1px solid var(--md-sys-color-outline-variant); }
.md3-icon-btn--outlined:hover { border-color: var(--md-sys-color-outline); }
.md3-icon-btn .material-symbols-rounded { font-size: 20px; line-height: 1; }
.theme-toggle-btn { color: var(--md-sys-color-on-surface); }

/* ============================================================================
   M3 NAVIGATION DRAWER
   ============================================================================ */
.md3-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.32); opacity: 0; pointer-events: none; transition: opacity var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-standard); z-index: 299; }
.md3-scrim.active { opacity: 1; pointer-events: auto; }
.md3-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(360px, 90vw);
    background: var(--md-sys-color-surface-container-low); display: flex; flex-direction: column;
    z-index: 300; transform: translateX(-100%); transition: transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized);
    overflow: hidden; box-shadow: var(--md-sys-elevation-3);
}
.md3-drawer.active { transform: translateX(0); }
.md3-drawer__header { padding: 24px 16px 16px; background: var(--md-sys-color-surface-container-low); border-bottom: 1px solid var(--md-sys-color-outline-variant); flex-shrink: 0; }
.md3-drawer__header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.md3-drawer__brand { display: flex; align-items: center; gap: 12px; }
.md3-drawer__logo-wrap { width: 56px; height: 56px; }
.md3-drawer__logo-img { width: 100%; height: 100%; object-fit: contain; }
.md3-drawer__brand-name { font-size: 18px; font-weight: 700; color: var(--md-sys-color-on-surface); margin: 0; }
.md3-drawer__brand-sub { font-size: 11px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: .15em; margin: 0; }
.md3-drawer__tagline { font-size: 13px; color: var(--md-sys-color-on-surface-variant); line-height: 1.5; margin: 0; }
.md3-drawer__content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; background: var(--md-sys-color-surface-container); }
.md3-drawer__footer { padding: 16px; background: var(--md-sys-color-surface-container-low) !important; border-top: 1px solid var(--md-sys-color-outline-variant) !important; flex-shrink: 0; }
.md3-drawer__social { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.md3-drawer__copyright { font-size: 12px; color: var(--md-sys-color-on-surface-variant); text-align: center; margin: 0; }

/* ── Nav List ── */
.md3-nav-list { list-style: none; padding: 0; margin: 4px 0; }
.md3-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px; height: 56px;
    border-radius: 0 var(--md-sys-shape-full) var(--md-sys-shape-full) 0;
    margin: 2px 12px 2px 0; text-decoration: none;
    font-size: 14px; font-weight: 500; color: var(--md-sys-color-on-surface-variant);
    position: relative; overflow: hidden;
    transition: background var(--md-sys-motion-duration-short4), color var(--md-sys-motion-duration-short4);
}
.md3-nav-item::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short4); }
.md3-nav-item:hover::before { opacity: .08; }
.md3-nav-item:active::before { opacity: .16; }
.md3-nav-item--active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); font-weight: 700; }
.md3-nav-item__icon { font-size: 22px; flex-shrink: 0; }
.md3-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 4px 0; }
.sidebar-footer { background: var(--md-sys-color-surface-container-low) !important; border-top: 1px solid var(--md-sys-color-outline-variant) !important; }

/* Legacy compat */
.sidebar-link { color: var(--md-sys-color-on-surface-variant); text-decoration: none; }
.sidebar-link.active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.social-icon-btn { color: var(--md-sys-color-on-surface-variant) !important; }
.social-icon-btn:hover { background: var(--md-sys-color-primary-container) !important; color: var(--md-sys-color-on-primary-container) !important; }

/* ============================================================================
   M3 BUTTONS
   ============================================================================ */
.md3-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--md-sys-shape-full); border: none;
    font-size: 14px; font-weight: 500; letter-spacing: .1px; cursor: pointer; text-decoration: none;
    overflow: hidden;
    transition: background var(--md-sys-motion-duration-short4), box-shadow var(--md-sys-motion-duration-short4), transform var(--md-sys-motion-duration-short3);
    -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.md3-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short4); }
.md3-btn:hover::before  { opacity: .08; }
.md3-btn:active::before { opacity: .16; }
.md3-btn:active { transform: scale(.98); }
.md3-btn--filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.md3-btn--filled:hover { box-shadow: var(--md-sys-elevation-1); }
.md3-btn--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.md3-btn--tonal:hover { box-shadow: var(--md-sys-elevation-1); }
.md3-btn--tonal-primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.md3-btn--tonal-primary:hover { box-shadow: var(--md-sys-elevation-1); }
.md3-btn--outlined { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }
.md3-btn--large { padding: 14px 32px; font-size: 15px; }
.md3-btn--large .material-symbols-rounded { font-size: 20px; }

/* ============================================================================
   M3 CHIPS
   ============================================================================ */
.md3-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: var(--md-sys-shape-full); font-size: 13px; font-weight: 500; border: 1px solid var(--md-sys-color-outline-variant); }
.md3-chip--assist { background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface-variant); }
.md3-chip__icon { font-size: 16px; color: var(--md-sys-color-primary); }
.md3-chip__label { text-transform: uppercase; letter-spacing: .08em; }

/* ============================================================================
   MAIN LAYOUT
   ============================================================================ */
.md3-main { 
    position: relative; 
    z-index: 10;
    overflow-x: hidden; /* FIXED: Prevent horizontal scrolling */
}

/* ============================================================================
   BREADCRUMB NAVIGATION
   ============================================================================ */
.md3-breadcrumb {
    padding: 24px 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
}
.md3-breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.md3-breadcrumb__item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.md3-breadcrumb__link {
    font-size: 14px;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-sys-motion-duration-short4);
}
.md3-breadcrumb__link:hover {
    color: var(--md-sys-color-on-primary-container);
}
.md3-breadcrumb__item--current span {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}
.md3-breadcrumb__separator {
    font-size: 18px;
    color: var(--md-sys-color-on-surface-variant);
}

/* ============================================================================
   PHONE DETAIL HERO SECTION
   ============================================================================ */
.md3-phone-detail-hero {
    padding: 0 16px 32px;
    max-width: 1280px;
    margin: 0 auto;
}

.md3-hero-card {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-extra-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-2);
    margin-bottom: 16px;
}

.md3-hero-card:hover {
    box-shadow: var(--md-sys-elevation-3);
}

.md3-hero-card__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

@media (min-width: 768px) {
    .md3-hero-card__inner {
        flex-direction: row;
        align-items: flex-start;
    }
    .md3-phone-showcase {
        flex: 0 0 280px;
    }
    .md3-phone-info {
        flex: 1;
    }
}

/* ── Phone Showcase with Ambient Glow ── */
.md3-phone-showcase {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
}

.md3-phone-showcase__ambient {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.md3-showcase-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.md3-phone-showcase__image {
    position: relative;
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 20px 60px rgba(0,0,0,0.15));
    transition: transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized);
    z-index: 2;
}

.md3-phone-showcase__image:hover {
    transform: scale(1.05) rotate(-2deg);
}

.md3-phone-showcase__fallback {
    width: 250px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-extra-large);
    border: 2px dashed var(--md-sys-color-outline);
}

.md3-phone-showcase__fallback .material-symbols-rounded {
    font-size: 100px;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.5;
}

/* ── Phone Info Section ── */
.md3-phone-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Brand Badge - M3 Assist Chip Style */
.md3-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-full);
    border: 1px solid var(--md-sys-color-outline-variant);
    width: fit-content;
}

.md3-brand-badge__logo {
    height: 24px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.md3-brand-badge__text {
    font-size: 14px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Phone Title - M3 Display Typography */
.md3-phone-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.md3-phone-subtitle {
    font-size: 16px;
    color: var(--md-sys-color-on-surface-variant);
    margin: -16px 0 0;
}

/* Price Badge - M3 Filled Tonal Style */
.md3-price-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px;
    background: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-large);
    width: fit-content;
}

.md3-price-badge__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.8;
}

.md3-price-badge__value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--md-sys-color-on-primary-container);
}

/* ── Quick-spec tiles — FIXED for long text wrapping ── */
.md3-quick-specs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
    position: relative;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 480px) {
    .md3-quick-specs {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .md3-quick-specs {
        grid-template-columns: repeat(8, 1fr);
        gap: 10px;
    }
}

.md3-qs-tile {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 76px;        /* replaces aspect-ratio so tall text can breathe */
    padding: 8px 6px;
    overflow: visible;
    transition:
        background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
        border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
        transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    cursor: default;
}

.md3-qs-tile:hover {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-primary);
    transform: translateY(-2px);
}

.md3-qs-tile--accent {
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 60%, transparent);
    border-color: var(--md-sys-color-primary);
}

.md3-qs-tile__icon {
    font-size: 18px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.md3-qs-tile--accent .md3-qs-tile__icon {
    color: var(--md-sys-color-on-primary-container);
}

.md3-qs-tile__value {
    font-size: 10px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    text-align: center;
    line-height: 1.3;
    max-width: 95%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* No line-clamp — let the tile grow to fit content */
}

.md3-qs-tile__label {
    font-size: 8.5px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

@media (min-width: 480px) {
    .md3-qs-tile__value {
        font-size: 11px;
    }
    .md3-qs-tile__label {
        font-size: 9px;
    }
    .md3-qs-tile__icon {
        font-size: 20px;
    }
}

/* Hero Actions */
.md3-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Highlight bench-cards ── */
.md3-bench-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
}

@media (min-width: 640px) {
    .md3-bench-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .md3-bench-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.md3-bench-card {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-large);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition:
        transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized),
        box-shadow var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.md3-bench-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--md-sys-elevation-2);
}

.md3-bench-card__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--md-sys-shape-small);
    background: var(--md-sys-color-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
}

.md3-bench-card__icon .material-symbols-rounded {
    font-size: 18px;
    color: var(--md-sys-color-primary);
}

.md3-bench-card__body {
    min-width: 0;
}

.md3-bench-card__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0 0 2px 0;
}

.md3-bench-card__value {
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================================================
   SPECIFICATIONS SECTION
   ============================================================================ */
.md3-specs-section {
    padding: 0 16px 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.md3-section-header {
    margin-bottom: 20px;
}

.md3-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.md3-section-title__icon {
    font-size: 26px;
    color: var(--md-sys-color-primary);
}

.md3-section-subtitle {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 4px 0 0 0;
}

/* ── Specs grid ── */
.md3-all-specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    row-gap: 14px;
    column-gap: 14px;
}

@media (min-width: 560px) {
    .md3-all-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .md3-all-specs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Spec card ── */
.md3-spec-card {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
    transition:
        transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized),
        box-shadow var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
        border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    will-change: transform;
}

.md3-spec-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.md3-spec-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin: 0;
}

.md3-spec-card__header .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
    padding: 4px;
    border-radius: var(--md-sys-shape-extra-small);
}

/* ── Spec list — collapsible ── */
.md3-spec-list-wrap {
    position: relative;
}

.md3-spec-list-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--md-sys-color-surface-container-low) 90%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
    z-index: 1;
}

.md3-spec-list-wrap.expanded::after {
    opacity: 0;
    pointer-events: none;
}

.md3-spec-list-wrap:not(.has-overflow)::after {
    display: none;
}

.md3-spec-list {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
}

.md3-spec-list.expanded {
    max-height: 1200px;
}

/* ── Spec row ── */
.md3-spec-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    flex-shrink: 0;
}

.md3-spec-row:last-child {
    border-bottom: none;
}

.md3-spec-row:nth-child(even) {
    background: color-mix(in srgb, var(--md-sys-color-primary) 2%, transparent);
}

.md3-spec-row:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 5%, transparent);
}

.md3-spec-row__label {
    font-size: 11px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    min-width: 80px;
    max-width: 120px;
    line-height: 1.4;
}

.md3-spec-row__value {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    text-align: right;
    flex: 1;
    min-width: 0;
    cursor: default;
    /* Always wrap — hover-expand doesn't work on touch devices */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Keep desktop hover highlight subtle */
.md3-spec-row__value:hover {
    color: var(--md-sys-color-on-surface);
}

.md3-spec-row__value--hi {
    color: var(--md-sys-color-primary);
}

/* ── Show more toggle button ── */
.md3-spec-card__toggle {
    display: none; /* shown by JS only when overflow exists */
    width: 100%;
    padding: 8px 16px;
    background: var(--md-sys-color-surface-container);
    border: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    font-size: 11px;
    font-weight: 600;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    letter-spacing: 0.03em;
}

.md3-spec-card__toggle:hover {
    background: var(--md-sys-color-surface-container-high);
}

.md3-spec-card__toggle .material-symbols-rounded {
    font-size: 16px;
    transition: transform 0.3s cubic-bezier(0.05, 0.7, 0.1, 1);
}

.md3-spec-card__toggle[aria-expanded="true"] .material-symbols-rounded {
    transform: rotate(180deg);
}

/* ============================================================================
   BRAND COMPARISON SECTION
   ============================================================================ */
.md3-comparison-section {
    padding: 0 16px 40px;
    max-width: 1280px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .md3-comparison-section {
        padding: 32px 16px;
    }
}

.md3-comparison-card {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-extra-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

/* Skeleton loader rows */
.md3-comparison-skeleton {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.md3-skeleton-row {
    height: 40px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-small);
    animation: skeletonPulse 1.6s ease-in-out infinite;
}

.md3-skeleton-row:nth-child(2) {
    animation-delay: .2s;
    width: 80%;
}

.md3-skeleton-row:nth-child(3) {
    animation-delay: .4s;
    width: 60%;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Horizontal scroll wrapper for narrow viewports */
.md3-ct-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface);
}

/* The table itself */
.md3-comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 14px;
}

/* Column header cells */
.md3-ct-head {
    padding: 16px 20px 14px;
    background: var(--md-sys-color-surface-container);
    border-bottom: 2px solid var(--md-sys-color-outline-variant);
    text-align: center;
    font-weight: 600;
    vertical-align: bottom;
    min-width: 140px;
}

.md3-ct-head--current {
    background: var(--md-sys-color-primary-container);
    border-bottom-color: var(--md-sys-color-primary);
}

.md3-ct-head__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.md3-ct-head__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    text-align: center;
    /* FIXED: Allow wrapping for long phone names */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.md3-ct-head--current .md3-ct-head__name {
    color: var(--md-sys-color-on-primary-container);
}

.md3-ct-current-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: var(--md-sys-shape-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Row label cells (left-most column) */
.md3-ct-label-head,
.md3-ct-label {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    background: var(--md-sys-color-surface-container-highest);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    text-align: left;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Data cells - FIXED for text wrapping */
.md3-ct-cell {
    padding: 14px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background var(--md-sys-motion-duration-short4);
    /* FIXED: Allow text wrapping */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    vertical-align: middle;
    min-width: 140px;
    max-width: 200px; /* Prevent cells from becoming too wide */
}

.md3-ct-cell--current {
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 30%, transparent);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Alternating row tints */
.md3-comparison-table tbody tr:nth-child(even) .md3-ct-cell {
    background: var(--md-sys-color-surface-container-lowest);
}

.md3-comparison-table tbody tr:nth-child(even) .md3-ct-cell--current {
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 40%, transparent);
}

.md3-comparison-table tbody tr:hover .md3-ct-cell {
    background: var(--md-sys-color-surface-container-high);
}

.md3-comparison-table tbody tr:hover .md3-ct-cell--current {
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 55%, transparent);
}

/* CTA below comparison */
.md3-comparison-cta {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* ============================================================================
   RELATED PHONES SECTION
   ============================================================================ */
.md3-related-section {
    padding: 0 16px 40px;
    max-width: 1280px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .md3-related-section {
        padding: 32px 16px;
    }
}

.md3-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

@media (max-width: 767px) {
    .md3-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .md3-related-grid {
        grid-template-columns: 1fr;
    }
}

/* Related card */
.md3-related-card {
    position: relative;
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-extra-large);
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.md3-related-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-primary);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
    pointer-events: none;
}

.md3-related-card:hover {
    box-shadow: var(--md-sys-elevation-3);
    transform: translateY(-6px);
    border-color: var(--md-sys-color-primary);
}

.md3-related-card:hover::before {
    opacity: 0.04;
}

/* Image area */
.md3-related-card__image-wrap {
    position: relative;
    background: var(--md-sys-color-surface-container);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.md3-related-card__image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    padding: 12px;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.10));
    transition: transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized);
}

.md3-related-card:hover .md3-related-card__image {
    transform: scale(1.06);
}

.md3-related-card__fallback {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.4;
}

.md3-related-card__fallback .material-symbols-rounded {
    font-size: 64px;
}

/* Badge overlay */
.md3-related-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 4px;
}

.md3-related-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--md-sys-shape-full);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.md3-related-badge--5g {
    background: var(--md-sys-color-tertiary);
    color: var(--md-sys-color-on-tertiary);
}

/* Content area */
.md3-related-card__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.md3-related-card__brand {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.md3-related-card__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0;
    line-height: 1.3;
    /* FIXED: Better text wrapping */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Limit to 3 lines maximum */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.md3-related-card__soc {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    /* FIXED: Allow wrapping instead of ellipsis */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.md3-related-card__soc .material-symbols-rounded {
    font-size: 15px;
    flex-shrink: 0;
    color: var(--md-sys-color-primary);
}

/* Spec micro-chips */
.md3-related-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.md3-related-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.md3-related-card__price {
    font-size: 16px;
    font-weight: 800;
    color: var(--md-sys-color-primary);
    margin: 4px 0 0;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.md3-footer {
    position: relative;
    margin-top: 48px;
    overflow: hidden;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
    transition: background var(--md-sys-motion-duration-medium2), border-color var(--md-sys-motion-duration-medium2);
}

.md3-footer__blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.md3-footer__inner {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px 48px;
}

.md3-footer__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 64px;
}

.md3-footer__logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.md3-footer__logo-wrap:hover {
    transform: scale(1.06);
}

.md3-footer__logo-img {
    width: 128px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.15));
}

.md3-footer__links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 48px;
    text-align: center;
    margin-bottom: 64px;
}

@media (min-width: 768px) {
    .md3-footer__links {
        grid-template-columns: repeat(4, 1fr);
        text-align: left;
    }
}

.md3-footer__col-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--md-sys-color-on-surface);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.md3-footer__link {
    display: block;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color var(--md-sys-motion-duration-short4), transform var(--md-sys-motion-duration-short4);
}

.md3-footer__link:hover {
    color: var(--md-sys-color-primary);
    transform: translateX(2px);
}

.md3-footer__divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--md-sys-color-outline-variant), transparent);
    margin-bottom: 48px;
}

.md3-footer__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

@media (min-width: 768px) {
    .md3-footer__bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.md3-footer__copyright {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.md3-footer__social {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.text-charcoal { color: var(--md-sys-color-on-surface); }
.text-slate    { color: var(--md-sys-color-on-surface-variant); }
.text-muted    { color: var(--md-sys-color-on-surface-variant); opacity: .7; }
.text-moss     { color: var(--c-moss); }
.text-moss-light { color: var(--c-moss-light); }

.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-1\.5 { gap: 6px; }
.w-fit { width: fit-content; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Padding helpers */
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-3 { margin-top: 12px; }
.ml-2 { margin-left: 8px; }
.ml-4 { margin-left: 16px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }

/* Text helpers */
.text-sm { font-size: 13px; line-height: 1.4; }
.text-xs { font-size: 11px; line-height: 1.4; }
.text-lg { font-size: 17px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-black { font-weight: 900; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.2; }
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grid helpers */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.col-span-full { grid-column: 1 / -1; }

/* Misc helpers */
.space-y-2 > * + * { margin-top: 8px; }
.min-h-\[2rem\]  { min-height: 2rem; }
.min-h-\[2\.5rem\] { min-height: 2.5rem; }
.block { display: block; }
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.rounded-lg { border-radius: var(--md-sys-shape-large); }
.rounded-full { border-radius: var(--md-sys-shape-full); }
.border-t { border-top: 1px solid var(--md-sys-color-outline-variant); }
.pt-3 { padding-top: 12px; }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.float-animation { animation: float 6s ease-in-out infinite; }
@keyframes blob { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(20px,-20px) scale(1.05)} }
@keyframes pulse-slow { 0%,100%{opacity:.2;transform:scale(1)} 50%{opacity:.3;transform:scale(1.05)} }
.animate-blob       { animation: blob 20s infinite ease-in-out; will-change: transform; }
.animate-pulse-slow { animation: pulse-slow 8s infinite ease-in-out; will-change: opacity,transform; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animation-delay-1000 { animation-delay: 1s; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-3000 { animation-delay: 3s; }
.animation-delay-4000 { animation-delay: 4s; }
body.dark .animate-blob, body.dark .animate-pulse-slow { animation-duration: 25s; }
@keyframes shimmer { 0%{background-position:-1000px 0} 100%{background-position:1000px 0} }
.skeleton { background: linear-gradient(90deg, var(--md-sys-color-surface-container) 0%, var(--md-sys-color-surface-container-high) 50%, var(--md-sys-color-surface-container) 100%); background-size: 1000px 100%; animation: shimmer 2s infinite linear; }

/* ── Scroll-in fade animations ── */
.anim-fade-up {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.45s var(--md-sys-motion-easing-standard),
        transform 0.45s var(--md-sys-motion-easing-emphasized);
}
.anim-fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger tiles */
.md3-qs-tile:nth-child(1) { transition-delay: 0.04s; }
.md3-qs-tile:nth-child(2) { transition-delay: 0.08s; }
.md3-qs-tile:nth-child(3) { transition-delay: 0.12s; }
.md3-qs-tile:nth-child(4) { transition-delay: 0.16s; }
.md3-qs-tile:nth-child(5) { transition-delay: 0.20s; }
.md3-qs-tile:nth-child(6) { transition-delay: 0.24s; }
.md3-qs-tile:nth-child(7) { transition-delay: 0.28s; }
.md3-qs-tile:nth-child(8) { transition-delay: 0.32s; }

/* ============================================================================
   MOBILE OPTIMIZATIONS (FIXES)
   ============================================================================ */
@media (max-width: 640px) {
    /* Tiles: keep compact but let height grow naturally */
    .md3-qs-tile {
        padding: 6px 4px;
        gap: 3px;
        min-height: 72px;
    }

    .md3-qs-tile__value {
        font-size: 9px;
    }

    .md3-qs-tile__label {
        font-size: 7.5px;
    }

    /* Reduce comparison table cell padding on mobile */
    .md3-ct-cell {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 120px;
    }

    .md3-ct-head__name {
        font-size: 12px;
    }
}

/* ============================================================================
   OVERFLOW PREVENTION
   ============================================================================ */
.md3-phone-detail-hero,
.md3-specs-section,
.md3-comparison-section,
.md3-related-section {
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    body { background:#fff !important; color:#000 !important; }
    .md3-top-app-bar, .md3-drawer, .md3-scrim, .theme-toggle-btn, button, nav { display:none !important; }
    .md3-spec-card, .md3-related-card { break-inside:avoid; page-break-inside:avoid; }
}
