/*
Theme Name: ReplaceRemote B2B
Theme URI: https://replaceremote.com
Description: Professional B2B WordPress theme for ReplaceRemote — OEM remote control manufacturer. Roku purple accent, Alibaba.com store layout style, clean white background, WhatsApp integration, multi-language ready.
Version: 1.0.0
Author: ReplaceRemote
License: GPL-2.0-or-later
Text Domain: replaceremote
*/

/* ═════════════════════════════════════════════════════════════
 * ReplaceRemote B2B — Design Token System
 * Base: Roku Purple (#4F01A3) on Clean White
 * Layout: Alibaba.com B2B Store Style
 * ═════════════════════════════════════════════════════════════ */

:root {
  /* Surface */
  --rr-bg: #ffffff;
  --rr-surface: #f8f8fa;
  --rr-surface-warm: #f3f0f7;

  /* Foreground */
  --rr-fg: #1a1a2e;
  --rr-fg-2: #3d3d5c;
  --rr-muted: #6b6b80;

  /* Accent — Roku Deep Purple */
  --rr-accent: #4F01A3;
  --rr-accent-hover: #3d017e;
  --rr-accent-soft: #f5f0fa;
  --rr-accent-light: #924EC8;

  /* Semantic */
  --rr-success: #17a34a;
  --rr-warn: #eab308;

  /* Border */
  --rr-border: #e5e5ea;
  --rr-border-soft: #f0f0f3;

  /* Font */
  --rr-font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  /* Spacing */
  --rr-space-xs: 8px;
  --rr-space-sm: 16px;
  --rr-space-md: 24px;
  --rr-space-lg: 32px;
  --rr-space-xl: 48px;
  --rr-space-2xl: 80px;

  /* Radius */
  --rr-radius-sm: 8px;
  --rr-radius-md: 12px;
  --rr-radius-lg: 16px;
  --rr-radius-pill: 9999px;

  /* Elevation */
  --rr-shadow: 0 2px 8px rgba(26, 26, 46, 0.08);

  /* WhatsApp */
  --rr-whatsapp: #25D366;

  /* Layout */
  --rr-header-h: 72px;
  --rr-container: 1200px;
}

/* ═════════════════════════════════════════════════════════════
 * Reset & Base
 * ═════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--rr-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rr-fg);
  background: var(--rr-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--rr-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--rr-accent-hover); }

.container {
  max-width: var(--rr-container);
  margin: 0 auto;
  padding: 0 24px;
}

::selection {
  background: var(--rr-accent);
  color: #fff;
}

/* ═════════════════════════════════════════════════════════════
 * Typography
 * ═════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--rr-font);
  font-weight: 600;
  line-height: 1.2;
  color: var(--rr-fg);
}

h1 { font-size: 48px; letter-spacing: -0.01em; }
h2 { font-size: 32px; letter-spacing: -0.01em; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

/* ═════════════════════════════════════════════════════════════
 * Buttons
 * ═════════════════════════════════════════════════════════════ */

.rr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--rr-radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.rr-btn-primary {
  background: var(--rr-accent);
  color: #fff;
}

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

.rr-btn-outline {
  background: transparent;
  color: var(--rr-accent);
  border: 1.5px solid var(--rr-accent);
}

.rr-btn-outline:hover {
  background: var(--rr-accent-soft);
}

.rr-btn-lg { padding: 14px 36px; font-size: 16px; }
.rr-btn-sm { padding: 6px 16px; font-size: 12px; }

.rr-btn-whatsapp {
  background: var(--rr-whatsapp);
  color: #fff;
  border: none;
}

.rr-btn-whatsapp:hover {
  background: #1da851;
  color: #fff;
}

/* ═════════════════════════════════════════════════════════════
 * Site Header
 * ═════════════════════════════════════════════════════════════ */

.rr-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--rr-bg);
  border-bottom: 1px solid var(--rr-border-soft);
  height: var(--rr-header-h);
}

.rr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.rr-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--rr-fg) !important;
}

.rr-logo-icon { color: var(--rr-accent); font-size: 24px; }

.rr-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.rr-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--rr-fg-2);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.rr-nav a:hover,
.rr-nav .current-menu-item > a,
.rr-nav .rr-nav-active {
  color: var(--rr-accent) !important;
  border-bottom-color: var(--rr-accent) !important;
}

.rr-header-actions { display: flex; align-items: center; gap: 12px; }

/* Mobile */
.rr-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.rr-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--rr-fg);
  border-radius: 1px;
  transition: all .15s;
}

@media (max-width: 1024px) {
  .rr-nav {
    position: fixed;
    top: var(--rr-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    background: var(--rr-bg);
    padding: 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 999;
  }
  .rr-nav--open { transform: translateX(0); }
  .rr-mobile-toggle { display: flex; }
  .rr-header-actions .rr-btn { display: none; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
}

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
}

/* ═════════════════════════════════════════════════════════════
 * Site Footer
 * ═════════════════════════════════════════════════════════════ */

.rr-footer {
  background: var(--rr-fg);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 32px;
}

.rr-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.rr-footer h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rr-footer a {
  display: block;
  font-size: 14px;
  color: rgba(255,255,255,0.6) !important;
  margin-bottom: 8px;
  transition: color .15s;
}

.rr-footer a:hover { color: var(--rr-accent-light) !important; }

.rr-footer-desc {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
}

.rr-footer-social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.rr-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-size: 14px;
  transition: background .15s;
}

.rr-footer-social a:hover { background: var(--rr-accent); }

.rr-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 1024px) {
  .rr-footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .rr-footer-grid { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════
 * WhatsApp Floating Button
 * ═════════════════════════════════════════════════════════════ */

.rr-whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--rr-whatsapp);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform .15s;
  animation: rr-pulse 2s ease-in-out 1;
}

.rr-whatsapp-float:hover { transform: scale(1.08); }

.rr-whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

@keyframes rr-pulse {
  0% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(37, 211, 102, 0.7); }
  100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
}

@media (max-width: 640px) {
  .rr-whatsapp-float {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
  .rr-whatsapp-float svg { width: 26px; height: 26px; }
}

/* ═════════════════════════════════════════════════════════════
 * Page Sections
 * ═════════════════════════════════════════════════════════════ */

.rr-section {
  padding: 80px 0;
}

.rr-section-alt {
  background: var(--rr-surface);
}

.rr-section-heading {
  text-align: center;
  margin-bottom: 48px;
}

.rr-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rr-accent);
  background: var(--rr-accent-soft);
  padding: 4px 12px;
  border-radius: var(--rr-radius-pill);
  margin-bottom: 12px;
}

.rr-section-heading h2 {
  margin-bottom: 12px;
}

.rr-section-heading p {
  color: var(--rr-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ═════════════════════════════════════════════════════════════
 * Hero
 * ═════════════════════════════════════════════════════════════ */

.rr-hero {
  padding: 80px 0 48px;
}

.rr-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.rr-hero-content h1 {
  font-size: 52px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.rr-hero-subtitle {
  font-size: 20px;
  color: var(--rr-muted);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
}

.rr-hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.rr-hero-image img {
  width: 100%;
  border-radius: var(--rr-radius-lg);
  box-shadow: var(--rr-shadow);
}

@media (max-width: 1024px) {
  .rr-hero-grid { grid-template-columns: 1fr; text-align: center; }
  .rr-hero-content { order: 1; }
  .rr-hero-content h1 { font-size: 32px; }
  .rr-hero-subtitle { max-width: 100%; }
  .rr-hero-actions { justify-content: center; }
}

/* ═════════════════════════════════════════════════════════════
 * Trust Strip
 * ═════════════════════════════════════════════════════════════ */

.rr-trust-strip {
  background: var(--rr-surface);
  border-top: 1px solid var(--rr-border-soft);
  border-bottom: 1px solid var(--rr-border-soft);
  padding: 32px 0;
}

.rr-trust-items {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
}

.rr-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rr-trust-icon { font-size: 22px; }

.rr-trust-num {
  font-size: 24px;
  font-weight: 600;
  color: var(--rr-accent);
  letter-spacing: -0.01em;
}

.rr-trust-label {
  font-size: 12px;
  color: var(--rr-muted);
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .rr-trust-items {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }
  .rr-trust-item {
    min-width: 120px;
    scroll-snap-align: start;
  }
}

/* ═════════════════════════════════════════════════════════════
 * Cards
 * ═════════════════════════════════════════════════════════════ */

.rr-card {
  background: var(--rr-bg);
  border: 1px solid var(--rr-border);
  border-radius: var(--rr-radius-md);
  padding: 24px;
  transition: border-color .15s, box-shadow .15s;
}

.rr-card:hover {
  border-color: var(--rr-accent-light);
  box-shadow: var(--rr-shadow);
}

/* ═════════════════════════════════════════════════════════════
 * Grids
 * ═════════════════════════════════════════════════════════════ */

.rr-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.rr-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.rr-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .rr-grid-3, .rr-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .rr-grid-2, .rr-grid-3, .rr-grid-4 { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════
 * Category Cards
 * ═════════════════════════════════════════════════════════════ */

.rr-category-card {
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rr-category-icon { font-size: 36px; }

.rr-category-name {
  font-size: 16px;
  font-weight: 600;
}

.rr-category-desc {
  font-size: 14px;
  color: var(--rr-muted);
  line-height: 1.5;
}

.rr-category-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--rr-accent);
  margin-top: 8px;
}

/* ═════════════════════════════════════════════════════════════
 * CTA Banner
 * ═════════════════════════════════════════════════════════════ */

.rr-cta-banner {
  background: var(--rr-accent);
  padding: 48px 0;
}

.rr-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.rr-cta-content h2 {
  color: #fff;
  font-size: 32px;
  margin-bottom: 8px;
}

.rr-cta-content p {
  color: rgba(255,255,255,0.8);
  font-size: 20px;
}

.rr-btn-white {
  background: #fff;
  color: var(--rr-accent);
}

.rr-btn-white:hover {
  background: var(--rr-accent-soft);
  color: var(--rr-accent);
}

@media (max-width: 640px) {
  .rr-cta-inner { flex-direction: column; text-align: center; }
  .rr-cta-content h2 { font-size: 24px; }
}

/* ═════════════════════════════════════════════════════════════
 * WordPress Overrides
 * ═════════════════════════════════════════════════════════════ */

/* Clean up admin bar offset */
.admin-bar .rr-header { top: 32px; }

/* Content area spacing */
.rr-content {
  padding: 48px 0;
}

.rr-content h2, .rr-content h3 {
  margin: 32px 0 12px;
}

.rr-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.rr-content ul, .rr-content ol {
  margin: 0 0 16px 24px;
}

.rr-content li {
  margin-bottom: 8px;
}

/* WPForms styling */
.rr-content .wpforms-container input,
.rr-content .wpforms-container textarea,
.rr-content .wpforms-container select {
  border: 1px solid var(--rr-border) !important;
  border-radius: var(--rr-radius-sm) !important;
  padding: 10px 14px !important;
  font-family: var(--rr-font) !important;
}

.rr-content .wpforms-container button[type=submit] {
  background: var(--rr-accent) !important;
  border: none !important;
  border-radius: var(--rr-radius-sm) !important;
  padding: 12px 28px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #fff !important;
}

.rr-content .wpforms-container button[type=submit]:hover {
  background: var(--rr-accent-hover) !important;
}

/* Elementor compatibility */
.elementor-widget-container h1 { font-size: 48px; }
.elementor-widget-container h2 { font-size: 32px; }

/* Utility */
.rr-text-center { text-align: center; }
.rr-mt-lg { margin-top: 48px; }
.rr-mb-lg { margin-bottom: 48px; }

/* Animations */
@keyframes rr-fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.rr-fade-in {
  animation: rr-fadeIn 0.5s ease both;
}

/* Print */
@media print {
  .rr-header, .rr-footer, .rr-whatsapp-float { display: none; }
}
