/* =================================================================
   SilverExtensions — Mobile Stylesheet
   Full responsive system covering tablet through small phone.
   Loads after main.css, overrides by specificity + media queries.
   Breakpoints: 1024 / 880 / 640 / 480 / 360
   ================================================================= */

/* ── 1024px — Tablet landscape / small desktop ──────────────────── */

@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .pricing-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .ext-body-grid {
    gap: 32px;
  }

  .footer-inner {
    gap: 36px;
  }
}

/* ── 880px — Tablet portrait ────────────────────────────── */

@media (max-width: 880px) {
  /* Navigation */
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 8px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-border);
  }

  /* Hero */
  .hero {
    padding: 80px 0 60px;
  }

  .hero-title {
    font-size: clamp(32px, 5vw, 52px);
  }

  .hero::before {
    width: 500px;
    height: 500px;
  }

  .stats-row {
    gap: 28px;
  }

  .stat-value {
    font-size: 30px;
  }

  /* Featured */
  .featured {
    padding: 48px 0 56px;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  /* Extension catalog */
  .ext-grid {
    grid-template-columns: 1fr;
  }

  /* Extension detail */
  .ext-detail-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }

  .ext-detail-icon {
    justify-self: center;
    width: 64px;
    height: 64px;
  }

  .ext-detail-cta {
    align-items: center;
    text-align: center;
  }

  .ext-body-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    position: static;
  }

  /* Pricing page */
  .pricing-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  /* Privacy pitch */
  .pitch-bullets {
    grid-template-columns: 1fr;
  }

  .pitch-inner {
    padding: 40px 28px;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* ── 640px — Large phone / small tablet ──────────────────── */

@media (max-width: 640px) {
  /* Mobile hamburger nav */
  .nav-inner {
    position: relative;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    background: var(--glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 12px 20px 16px;
    gap: 0;
    order: unset;
    width: unset;
    flex-wrap: nowrap;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links a,
  .nav-links button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 0;
    color: var(--text-secondary);
  }

  .nav-links a:last-child {
    border-bottom: none;
    display: flex;
  }

  .nav-links a:hover,
  .nav-links button:hover {
    color: var(--text);
    background: transparent;
  }

  .nav-icon-btn {
    justify-content: flex-start;
  }

  /* Hero */
  .hero {
    padding: 64px 0 48px;
  }

  .hero-title {
    font-size: clamp(28px, 7vw, 44px);
    letter-spacing: -0.5px;
  }

  .hero-sub {
    font-size: 15px;
  }

  .hero-ctas {
    flex-direction: column;
    gap: 10px;
  }

  .hero-ctas .btn {
    width: 100%;
    text-align: center;
  }

  .stats-row {
    gap: 20px;
    flex-wrap: wrap;
  }

  .stat-item {
    min-width: 25%;
  }

  .stat-value {
    font-size: 26px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Featured */
  .section-title {
    font-size: clamp(24px, 5vw, 32px);
  }

  .section-sub {
    font-size: 14px;
    margin-bottom: 32px;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .featured-card {
    padding: 20px;
  }

  .featured-card::before {
    height: 1px;
  }

  /* Extension cards */
  .ext-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .ext-icon {
    width: 36px;
    height: 36px;
  }

  .ext-name {
    font-size: 14px;
  }

  .ext-desc {
    font-size: 12px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Pricing page */
  .pricing-hero {
    padding: 56px 0 36px;
  }

  .pricing-hero h1 {
    font-size: clamp(24px, 5vw, 36px);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pricing-tier {
    padding: 24px 20px;
  }

  /* FAQ */
  .faq-item {
    padding: 20px;
  }

  /* Extension detail page */
  .ext-detail {
    padding: 32px 0 0;
  }

  .back-link {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .ext-detail-header {
    gap: 16px;
    padding-bottom: 32px;
  }

  .ext-detail-head-text h1 {
    font-size: 26px;
  }

  .price-large {
    font-size: 32px;
  }

  .ext-body-section {
    padding: 32px 0 56px;
  }

  .ext-body-main h2 {
    font-size: 20px;
    margin: 24px 0 10px;
  }

  .long-desc {
    font-size: 15px;
  }

  .feature-list li {
    font-size: 14px;
  }

  .pricing-card {
    padding: 24px 20px;
  }

  /* Privacy pitch */
  .privacy-pitch,
  .value-pitch {
    padding: 56px 0;
  }

  .pitch-inner {
    padding: 32px 20px;
    border-radius: var(--radius-lg);
  }

  .pitch-inner h2 {
    font-size: 26px;
  }

  .pitch-inner > p {
    font-size: 14px;
  }

  .pitch-bullet {
    padding: 16px;
    font-size: 13px;
  }

  /* Privacy page */
  .policy {
    padding: 32px 0 56px;
  }

  .policy h1 {
    font-size: 28px;
  }

  .policy h2 {
    font-size: 20px;
  }

  .policy p, .policy ul {
    font-size: 14px;
  }

  /* Help center */
  .help-hero {
    padding: 48px 0 36px;
  }

  .help-hero h1 {
    font-size: 28px;
  }

  .help-article-grid {
    grid-template-columns: 1fr;
  }

  /* Checkout pages */
  .checkout-result {
    padding: 80px 0;
  }

  .checkout-result h1 {
    font-size: 28px;
  }

  /* 404 */
  .not-found {
    padding: 80px 0;
  }

  .not-found h1 {
    font-size: 60px;
  }

  /* Footer */
  .site-footer {
    padding: 48px 0 20px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* Buttons */
  .btn {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }

  .checkout-actions {
    flex-direction: column;
    width: 100%;
  }

  /* Scroll progress */
  #scroll-progress {
    height: 2px;
  }

  /* A11y panel - fullscreen on mobile */
  .a11y-panel {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    transform: none;
    animation: none;
    overflow-y: auto;
    z-index: 10000;
  }

  .a11y-panel.a11y-hidden {
    transform: none;
  }

  /* Support widget mobile */
  #se-support-widget {
    bottom: 16px;
    right: 16px;
  }

  #se-fab {
    width: 48px;
    height: 48px;
  }

  #se-panel {
    width: calc(100vw - 32px);
    right: -8px;
    bottom: 60px;
    max-height: 70vh;
  }
}

/* ── 480px — Standard phone ──────────────────────────────── */

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  /* Nav */
  .nav-logo {
    font-size: 15px;
  }

  .nav-logo svg {
    width: 24px;
    height: 24px;
  }

  /* Hero */
  .hero {
    padding: 52px 0 40px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 5px 12px 5px 8px;
    margin-bottom: 20px;
  }

  .hero-title {
    font-size: clamp(26px, 8vw, 38px);
    letter-spacing: -0.3px;
  }

  .hero-sub {
    font-size: 14px;
    margin-bottom: 28px;
  }

  .stats-row {
    gap: 16px;
    padding-top: 28px;
  }

  .stat-item {
    min-width: 40%;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  /* Section headings */
  .section-label {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .section-title {
    font-size: clamp(22px, 6vw, 28px);
  }

  .section-sub {
    font-size: 13px;
    margin-bottom: 24px;
  }

  /* Featured cards */
  .featured-card {
    padding: 16px;
    border-radius: var(--radius);
  }

  .featured-card-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .featured-icon {
    width: 40px;
    height: 40px;
  }

  .featured-name {
    font-size: 16px;
  }

  .featured-tagline {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .price-pill {
    font-size: 12px;
    padding: 3px 10px;
  }

  /* Extension cards */
  .category-block {
    margin-bottom: 32px;
  }

  .category-title {
    font-size: 12px;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
  }

  .ext-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: var(--radius-sm);
  }

  .ext-icon {
    width: 32px;
    height: 32px;
    padding: 4px;
  }

  .ext-name {
    font-size: 13px;
  }

  .ext-desc {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  /* Extension detail */
  .ext-detail-icon {
    width: 56px;
    height: 56px;
    padding: 8px;
  }

  .ext-detail-head-text h1 {
    font-size: 22px;
  }

  .ext-detail-tagline {
    font-size: 14px;
  }

  .price-large {
    font-size: 28px;
  }

  .ext-body-main h2 {
    font-size: 18px;
  }

  .long-desc {
    font-size: 14px;
    line-height: 1.7;
  }

  .feature-list {
    gap: 8px;
  }

  .feature-list li {
    font-size: 13px;
    gap: 8px;
  }

  .pricing-card {
    padding: 20px 16px;
  }

  .pricing-card-price {
    font-size: 30px;
  }

  .tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Pricing page */
  .pricing-hero h1 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .pricing-sub {
    font-size: 14px;
  }

  .tier-header h3 {
    font-size: 15px;
  }

  .tier-price {
    font-size: 28px;
  }

  .tier-features li {
    font-size: 12px;
  }

  /* FAQ */
  .pricing-faq h2 {
    font-size: 24px;
  }

  .faq-item {
    padding: 16px;
  }

  .faq-item h3 {
    font-size: 14px;
  }

  .faq-item p {
    font-size: 13px;
  }

  /* Pitch */
  .pitch-inner {
    padding: 24px 16px;
  }

  .pitch-inner h2 {
    font-size: 22px;
  }

  .pitch-icon {
    width: 52px;
    height: 52px;
  }

  .pitch-bullet {
    padding: 14px;
    font-size: 12px;
  }

  /* Privacy */
  .policy h1 {
    font-size: 24px;
  }

  .policy h2 {
    font-size: 18px;
  }

  .policy-tldr {
    padding: 16px;
  }

  /* Checkout */
  .checkout-result {
    padding: 60px 0;
  }

  .checkout-result h1 {
    font-size: 24px;
  }

  .check-icon {
    width: 64px;
    height: 64px;
  }

  .not-found h1 {
    font-size: 48px;
  }

  /* Footer */
  .site-footer {
    padding: 36px 0 16px;
  }

  .footer-tagline {
    font-size: 13px;
  }

  .footer-col a {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .footer-bottom {
    font-size: 12px;
  }
}

/* ── 360px — Small phone (iPhone SE, Galaxy S-series) ────── */

@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  .nav-logo {
    font-size: 14px;
    gap: 6px;
  }

  .hero {
    padding: 44px 0 32px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-sub {
    font-size: 13px;
  }

  .stats-row {
    gap: 12px;
  }

  .stat-value {
    font-size: 22px;
  }

  .featured-card {
    padding: 14px;
  }

  .featured-name {
    font-size: 15px;
  }

  .ext-detail-head-text h1 {
    font-size: 20px;
  }

  .price-large {
    font-size: 24px;
  }

  .pricing-card-price {
    font-size: 26px;
  }

  .pitch-inner h2 {
    font-size: 20px;
  }

  .policy h1 {
    font-size: 22px;
  }

  .checkout-result h1 {
    font-size: 22px;
  }
}

/* ── Touch enhancements (any touch device) ─────────────────── */

@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  .ext-card {
    min-height: 56px;
  }

  .nav-links a,
  .nav-links button {
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
  }

  /* Disable hover transforms that feel weird on touch */
  .featured-card:hover {
    transform: none;
  }

  .pricing-tier:hover {
    transform: none;
  }

  .ext-card:hover {
    transform: none;
  }

  /* Keep active states for feedback */
  .featured-card:active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  .ext-card:active {
    opacity: 0.8;
  }

  .btn:active {
    transform: scale(0.97);
  }
}

/* ── Landscape phone adjustments ────────────────────── */

@media (max-width: 880px) and (orientation: landscape) {
  .hero {
    padding: 48px 0 36px;
  }

  .hero-title {
    font-size: clamp(24px, 4vw, 36px);
  }

  .stats-row {
    gap: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .featured {
    padding: 36px 0 40px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ext-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Safe area insets (notched phones) ────────────────── */

@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .site-nav {
    padding-bottom: env(safe-area-inset-top);
  }

  #se-support-widget {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
  }
}

/* ── Print styles ──────────────────────────── */

@media print {
  body {
    background: white;
    color: black;
  }

  .site-nav,
  #scroll-progress,
  #se-support-widget,
  .hero-badge,
  .hero-ctas,
  .stats-row,
  #orb-canvas,
  #particles,
  #grid-overlay,
  .a11y-panel {
    display: none !important;
  }

  .hero {
    padding: 24px 0;
  }

  .hero-title {
    font-size: 28px;
    color: black;
  }

  .hero-highlight {
    color: black;
    -webkit-text-fill-color: black;
  }

  .featured-card,
  .ext-card,
  .pricing-tier,
  .pricing-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    background: white;
  }

  .site-footer {
    border-top: 1px solid #ddd;
    background: white;
  }
}
