/* ============================================
   Cerrajeros El Salvador — Style System
   Design Tokens + Components
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --color-primary: #1a365d;
  --color-primary-light: #2b6cb0;
  --color-primary-dark: #0f2440;
  --color-accent: #e53e3e;
  --color-accent-hover: #c53030;
  --color-accent-light: #fed7d7;
  --color-bg: #f7fafc;
  --color-surface: #ffffff;
  --color-text: #1a202c;
  --color-text-muted: #718096;
  --color-border: #e2e8f0;
  --color-success: #38a169;
  --color-success-light: #c6f6d5;
  --color-whatsapp: #25D366;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 70px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary); }

ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--font-size-3xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--font-size-2xl); margin-bottom: var(--space-2); }
h4 { font-size: var(--font-size-xl); margin-bottom: var(--space-2); }

p { margin-bottom: var(--space-4); }

.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  margin: var(--space-4) auto 0;
  border-radius: 2px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.logo {
  font-weight: 800;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.logo:hover { color: var(--color-primary); }

.logo-badge {
  background: var(--color-accent);
  color: white;
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav a:hover { color: var(--color-primary); }

.header-phone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: white !important;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--font-size-base);
  transition: background var(--transition-fast);
}
.header-phone:hover {
  background: var(--color-accent-hover);
  color: white !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-2);
}
.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* Mobile nav */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    gap: var(--space-4);
    border-bottom: 2px solid var(--color-border);
  }
  .nav.active { display: flex; }
  .nav a { font-size: var(--font-size-base); }
  .header-phone { font-size: var(--font-size-sm); padding: var(--space-2) var(--space-3); }
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--header-height) + var(--space-16));
  padding-bottom: var(--space-20);
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.03)" d="M0,160L48,176C96,192,192,224,288,213.3C384,203,480,149,576,138.7C672,128,768,160,864,176C960,192,1056,192,1152,176C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: white;
  font-size: 2.75rem;
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.6s ease;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-badge {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-6);
  animation: pulse 2s infinite;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-accent);
  color: white;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: var(--font-size-xl);
  transition: background var(--transition-fast), transform var(--transition-fast);
  animation: fadeInUp 0.6s ease 0.4s both;
}
.hero-cta:hover {
  background: var(--color-accent-hover);
  color: white;
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-top: var(--space-12);
  animation: fadeInUp 0.6s ease 0.6s both;
}

.hero-stat {
  text-align: center;
}
.hero-stat-number {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: white;
}
.hero-stat-label {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.7);
}

@media (max-width: 768px) {
  .hero h1 { font-size: var(--font-size-3xl); }
  .hero p { font-size: var(--font-size-base); }
  .hero-stats { flex-wrap: wrap; gap: var(--space-6); }
  .hero-cta { font-size: var(--font-size-lg); }
}

/* --- Sections --- */
.section {
  padding: var(--space-16) 0;
}
.section-alt {
  background: var(--color-surface);
}

/* --- Service Cards --- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--transition-base);
}
.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary-light);
}

.service-card-icon {
  width: 56px;
  height: 56px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 1.5rem;
}

.service-card h3 { font-size: var(--font-size-lg); margin-bottom: var(--space-2); }
.service-card p { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.service-card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-primary-light);
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .service-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- City Grid --- */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.city-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: all var(--transition-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.city-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.city-name {
  font-weight: 700;
  color: var(--color-primary);
}
.city-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.city-arrow {
  color: var(--color-primary-light);
  font-weight: 700;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  color: white;
  text-align: center;
  padding: var(--space-16) 0;
}
.cta-section h2 {
  color: white;
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-4);
}
.cta-section p {
  color: rgba(255,255,255,0.9);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-8);
}
.cta-section .hero-cta {
  background: white;
  color: var(--color-accent);
}
.cta-section .hero-cta:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* --- FAQ --- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: none;
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast);
}
.faq-question:hover { background: var(--color-bg); }
.faq-question::after {
  content: '+';
  font-size: var(--font-size-xl);
  color: var(--color-primary-light);
  transition: transform var(--transition-fast);
}
.faq-question[aria-expanded="true"]::after {
  content: '−';
}
.faq-answer {
  display: none;
  padding: 0 var(--space-6) var(--space-4);
  color: var(--color-text-muted);
}
.faq-answer.active { display: block; }

/* --- Testimonials --- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.testimonial-text {
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.testimonial-author {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}
.testimonial-rating {
  color: #ecc94b;
  margin-bottom: var(--space-2);
}

@media (max-width: 768px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* --- WhatsApp Float --- */
.whatsapp-float {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 999;
  width: 60px;
  height: 60px;
  background: var(--color-whatsapp);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-base);
  animation: whatsappFloat 3s ease-in-out infinite;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}
.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: white;
}

@keyframes whatsappFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  background: var(--color-bg);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .current { color: var(--color-text); font-weight: 600; }
.breadcrumbs-sep { color: var(--color-text-muted); margin: 0 var(--space-2); }

/* --- Page Content --- */
.page-content {
  padding: var(--space-12) 0;
  min-height: 60vh;
}
.page-content h1 { 
  margin-bottom: var(--space-6);
}
.page-content ul, .page-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: var(--space-2); color: var(--color-text-muted); }

/* --- Footer --- */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: var(--space-16) 0 var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}
.footer h4 {
  color: white;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}
.footer a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: var(--font-size-sm);
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}
.footer a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  text-align: center;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.4);
}

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

/* --- Blog --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.blog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.blog-card-body {
  padding: var(--space-6);
}
.blog-card h3 { font-size: var(--font-size-lg); margin-bottom: var(--space-2); }
.blog-card p { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.blog-card-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* --- Price Table --- */
.price-list {
  max-width: 700px;
  margin: 0 auto;
}
.price-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.price-item:last-child { border-bottom: none; }
.price-service {
  font-weight: 600;
  color: var(--color-text);
}
.price-amount {
  font-weight: 800;
  color: var(--color-primary);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-8 { margin-top: var(--space-8); }
