/**
 * FuelMaps SEO Design System v2.0
 * ================================
 * Mobile-first, responsive, premium design
 * Compatible con todos los templates PHP de /SEO/pages/
 */

/* ============================================
   1. CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */
:root {
  --fm-bg: #f4f6fb;
  --fm-surface: #ffffff;
  --fm-surface-alt: #f8fafc;
  --fm-primary: #4f46e5;
  --fm-primary-hover: #4338ca;
  --fm-primary-light: #eef2ff;
  --fm-primary-glow: rgba(79, 70, 229, 0.15);
  --fm-success: #10b981;
  --fm-success-light: #dcfce7;
  --fm-success-dark: #166534;
  --fm-warning: #f59e0b;
  --fm-warning-light: #fef9c3;
  --fm-warning-dark: #854d0e;
  --fm-danger: #ef4444;
  --fm-danger-light: #fef2f2;
  --fm-text: #0f172a;
  --fm-text-secondary: #475569;
  --fm-text-muted: #94a3b8;
  --fm-border: #e2e8f0;
  --fm-border-light: #f1f5f9;
  --fm-radius-sm: 8px;
  --fm-radius: 16px;
  --fm-radius-lg: 24px;
  --fm-radius-pill: 999px;
  --fm-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --fm-shadow: 0 4px 20px rgba(0,0,0,0.06);
  --fm-shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --fm-shadow-glow: 0 4px 15px var(--fm-primary-glow);
  --fm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --fm-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. BASE RESET & TYPOGRAPHY
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--fm-font);
  background: var(--fm-bg);
  color: var(--fm-text-secondary);
  margin: 0;
  padding: 0;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 70px; /* Space for sticky ad */
}

/* ============================================
   3. LAYOUT
   ============================================ */
.fm-nav {
  background: var(--fm-surface);
  padding: 16px 20px;
  box-shadow: var(--fm-shadow-sm);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
}

.fm-nav a {
  color: var(--fm-primary);
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.fm-container {
  max-width: 800px;
  margin: 20px auto;
  background: var(--fm-surface);
  padding: 24px;
  border-radius: var(--fm-radius);
  box-shadow: var(--fm-shadow);
}

/* ============================================
   4. BREADCRUMBS
   ============================================ */
.fm-breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 20px;
  color: var(--fm-text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-breadcrumb a {
  color: var(--fm-primary);
  text-decoration: none;
  transition: color var(--fm-transition);
}

.fm-breadcrumb a:hover {
  color: var(--fm-primary-hover);
}

/* ============================================
   5. HEADINGS
   ============================================ */
h1, .fm-h1 {
  color: var(--fm-text);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

h2, .fm-h2 {
  color: var(--fm-primary);
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--fm-primary-light);
}

h3, .fm-h3 {
  color: var(--fm-text);
  margin-top: 28px;
  margin-bottom: 12px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ============================================
   6. CONTENT TEXT
   ============================================ */
p {
  margin-bottom: 18px;
  color: var(--fm-text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

strong {
  color: var(--fm-text);
}

/* ============================================
   7. PRICE CARDS
   ============================================ */
.fm-price-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.fm-price-card {
  padding: 20px;
  border-radius: var(--fm-radius);
  text-align: center;
  transition: transform var(--fm-transition);
}

.fm-price-card:hover {
  transform: translateY(-2px);
}

.fm-price-card.gas95 {
  background: var(--fm-success-light);
  color: var(--fm-success-dark);
  border: 1px solid #bbf7d0;
}

.fm-price-card.diesel {
  background: var(--fm-warning-light);
  color: var(--fm-warning-dark);
  border: 1px solid #fef08a;
}

.fm-price-card.gas98 {
  background: var(--fm-primary-light);
  color: var(--fm-primary);
  border: 1px solid #c7d2fe;
}

.fm-price-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.fm-price-val {
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}

/* ============================================
   8. INFO BOX & INFO LIST
   ============================================ */
.fm-info-box {
  background: var(--fm-primary-light);
  border: 1px solid #c7d2fe;
  padding: 20px;
  border-radius: var(--fm-radius);
  margin-bottom: 24px;
}

.fm-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fm-border-light);
  align-items: baseline;
}

.fm-info-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.fm-info-label {
  font-weight: 700;
  min-width: 130px;
  color: var(--fm-text-secondary);
  font-size: 0.9rem;
}

.fm-info-val {
  flex: 1;
  font-weight: 600;
  color: var(--fm-text);
  min-width: 0;
  word-break: break-word;
}

.fm-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fm-info-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--fm-border-light);
  font-size: 0.95rem;
}

.fm-info-list li:last-child {
  border-bottom: none;
}

.fm-info-list strong {
  display: inline-block;
  min-width: 140px;
  color: var(--fm-text);
}

/* ============================================
   9. STATION / CHARGER CARDS
   ============================================ */
.fm-card {
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--fm-surface-alt);
  transition: all var(--fm-transition);
}

.fm-card:hover {
  border-color: var(--fm-primary);
  box-shadow: var(--fm-shadow-sm);
}

.fm-card-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.fm-card-name {
  font-weight: 800;
  color: var(--fm-text);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.fm-card-address {
  font-size: 0.85rem;
  color: var(--fm-text-muted);
  margin-bottom: 8px;
}

.fm-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   10. BADGES
   ============================================ */
.fm-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--fm-radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.fm-badge-gas {
  background: var(--fm-success-light);
  color: var(--fm-success-dark);
}

.fm-badge-diesel {
  background: var(--fm-warning-light);
  color: var(--fm-warning-dark);
}

.fm-badge-power {
  background: #dbeafe;
  color: #1e40af;
}

.fm-badge-operator {
  background: #f3f4f6;
  color: #4b5563;
}

/* ============================================
   11. BUTTONS
   ============================================ */
.fm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--fm-radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--fm-transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.fm-btn-primary {
  background: var(--fm-primary);
  color: #fff;
  box-shadow: var(--fm-shadow-glow);
}

.fm-btn-primary:hover {
  background: var(--fm-primary-hover);
  transform: translateY(-1px);
}

.fm-btn-success {
  background: var(--fm-success);
  color: #fff;
  box-shadow: 0 4px 6px rgba(16,185,129,0.3);
}

.fm-btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.fm-btn-cta {
  background: var(--fm-primary);
  color: #fff;
  padding: 16px 32px;
  border-radius: var(--fm-radius-pill);
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: var(--fm-shadow-glow);
  width: 100%;
}

.fm-btn-cta:hover {
  background: var(--fm-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--fm-primary-glow);
}

.fm-btn-map {
  background: #0f172a;
  color: #fff;
}

.fm-btn-map:hover {
  background: #1e293b;
}

/* ============================================
   12. CHART CONTAINER
   ============================================ */
.fm-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
  margin: 20px 0;
  background: var(--fm-surface-alt);
  border-radius: var(--fm-radius);
  padding: 12px;
  border: 1px solid var(--fm-border);
}

/* ============================================
   13. CALCULATOR / TOOL BOX
   ============================================ */
.fm-calc-box {
  background: var(--fm-primary-light);
  border: 1px solid #c7d2fe;
  padding: 24px;
  border-radius: var(--fm-radius);
  margin-top: 20px;
}

.fm-calc-box label {
  display: block;
  font-weight: 600;
  color: var(--fm-text);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.fm-input {
  width: 100%;
  padding: 12px 16px;
  margin: 4px 0 16px 0;
  border: 1px solid #cbd5e1;
  border-radius: var(--fm-radius-sm);
  font-size: 1rem;
  font-family: var(--fm-font);
  transition: border-color var(--fm-transition);
  background: var(--fm-surface);
}

.fm-input:focus {
  outline: none;
  border-color: var(--fm-primary);
  box-shadow: 0 0 0 3px var(--fm-primary-glow);
}

.fm-calc-result {
  background: var(--fm-surface);
  border-left: 4px solid var(--fm-success);
  padding: 20px;
  margin-top: 16px;
  border-radius: 0 var(--fm-radius-sm) var(--fm-radius-sm) 0;
  box-shadow: var(--fm-shadow-sm);
}

/* ============================================
   14. RELATED ARTICLES / INTERLINKING
   ============================================ */
.fm-related {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--fm-border);
}

.fm-related h3 {
  margin-top: 0;
  color: var(--fm-text);
  font-size: 1.3rem;
}

.fm-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fm-related-list a {
  display: block;
  background: var(--fm-surface-alt);
  padding: 14px 18px;
  border-radius: var(--fm-radius-sm);
  color: #3b82f6;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--fm-transition);
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.fm-related-list a:hover {
  background: var(--fm-primary-light);
  transform: translateX(4px);
  border-color: var(--fm-primary);
}

/* ============================================
   15. GRID LINKS (Herramientas index)
   ============================================ */
.fm-grid-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.fm-grid-links a {
  background: var(--fm-surface-alt);
  color: var(--fm-text);
  padding: 18px 20px;
  border-radius: var(--fm-radius-sm);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--fm-border);
  transition: all var(--fm-transition);
  font-size: 1rem;
}

.fm-grid-links a:hover {
  background: var(--fm-primary-light);
  border-color: var(--fm-primary);
  transform: translateY(-2px);
  box-shadow: var(--fm-shadow);
}

/* ============================================
   16. CONNECTORS LIST (Cargadores)
   ============================================ */
.fm-connector-item {
  margin-bottom: 10px;
  background: var(--fm-success-light);
  padding: 12px 16px;
  border-radius: var(--fm-radius-sm);
  border: 1px solid #bbf7d0;
  font-size: 0.95rem;
}

/* ============================================
   17. ALERT BOXES
   ============================================ */
.fm-alert {
  padding: 16px 20px;
  border-radius: var(--fm-radius-sm);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.fm-alert-error {
  background: var(--fm-danger-light);
  color: #991b1b;
  border-left: 4px solid var(--fm-danger);
}

.fm-alert-info {
  background: var(--fm-primary-light);
  color: var(--fm-primary);
  border-left: 4px solid var(--fm-primary);
}

/* ============================================
   18. RELATED BOX (Gasolineras cercanas)
   ============================================ */
.fm-related-box {
  background: var(--fm-primary-light);
  border-radius: var(--fm-radius);
  padding: 20px;
  margin-top: 28px;
}

.fm-related-box h3 {
  margin-top: 0;
  color: #1e1b4b;
}

.fm-related-box ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  line-height: 2.2;
}

.fm-related-box a {
  color: var(--fm-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--fm-transition);
}

.fm-related-box a:hover {
  color: var(--fm-primary-hover);
  text-decoration: underline;
}

/* ============================================
   19. AD CONTAINERS
   ============================================ */
.ad-lazy {
  text-align: center;
  margin: 24px 0;
  min-height: 1px;
}

.fm-ad-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  text-align: center;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  padding: 4px 0;
}

ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
}

/* ============================================
   20. ENRICHED CONTENT SECTION
   ============================================ */
.fm-enriched {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 2px dashed var(--fm-border);
}

.fm-enriched h2 {
  color: var(--fm-text);
  border-bottom-color: var(--fm-border);
}

/* ============================================
   21. CTA CENTER
   ============================================ */
.fm-cta-center {
  text-align: center;
  margin: 28px 0;
}

/* ============================================
   22. AUTHOR BYLINE
   ============================================ */
.fm-byline {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fm-border);
  gap: 12px;
}

.fm-byline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fm-text);
}

.fm-byline-name {
  margin: 0;
  font-weight: 700;
  color: var(--fm-text);
  font-size: 0.9rem;
}

.fm-byline-date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--fm-text-muted);
}

/* ============================================
   23. DISCLAIMER
   ============================================ */
.fm-disclaimer {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--fm-text-muted);
  line-height: 1.5;
}

/* ============================================
   24. TABLE RESPONSIVE WRAPPER
   ============================================ */
.fm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.fm-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.fm-table-wrap th,
.fm-table-wrap td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--fm-border);
  font-size: 0.9rem;
}

.fm-table-wrap th {
  background: var(--fm-surface-alt);
  font-weight: 700;
  color: var(--fm-text);
}

/* ============================================
   25. WHATSAPP FLOAT
   ============================================ */
.wa-float {
  position: fixed;
  width: 48px;
  height: 48px;
  bottom: 76px;
  right: 16px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50%;
  text-align: center;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--fm-transition);
}

.wa-float:hover {
  background-color: #128c7e;
  transform: scale(1.1);
}

.wa-float svg {
  width: 26px;
  height: 26px;
  fill: white;
}

/* ============================================
   RESPONSIVE BREAKPOINTS (Mobile-First)
   ============================================ */

/* Tablet (≥576px) */
@media (min-width: 576px) {
  .fm-container {
    padding: 32px;
  }

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

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

/* Desktop (≥768px) */
@media (min-width: 768px) {
  body {
    font-size: 17px;
  }

  .fm-container {
    margin: 32px auto;
    padding: 40px;
    border-radius: var(--fm-radius-lg);
    box-shadow: var(--fm-shadow-lg);
  }

  .fm-price-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wa-float {
    display: none;
  }

  .fm-card-flex {
    flex-direction: row;
  }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
  .fm-container {
    margin: 12px;
    padding: 18px;
    border-radius: var(--fm-radius);
  }

  .fm-card-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .fm-btn-cta {
    font-size: 1rem;
    padding: 14px 20px;
  }

  .fm-info-label {
    min-width: 100%;
    margin-bottom: 2px;
  }
}
