/* =========================================
   MESECI — CSS Base
   meseci.com.mx
   ========================================= */

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1f2937; background: #fff; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* VARIABLES */
:root {
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-700: #374151;
  --gray-900: #111827;
  --wa-green: #25D366;
  --container: 1400px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
}

/* CONTAINER */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* =========================================
   TOPBAR  (Layout.astro — compartido)
   ========================================= */
.topbar {
  background: #0f172a;
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #1e293b;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}
.topbar-item:hover { color: #e2e8f0; }
.topbar-item svg { flex-shrink: 0; opacity: .7; }
.topbar-divider {
  width: 1px;
  height: 14px;
  background: #334155;
}
.topbar-badge {
  background: #dc2626;
  color: white;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16a34a;
  color: white;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s;
}
.topbar-wa:hover { background: #15803d; }

/* =========================================
   HEADER
   ========================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 24px; }
.logo img { height: 44px; width: auto; }

/* NAV */
.main-nav ul { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--gray-700); transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-cta { background: var(--red) !important; color: white !important; padding: 8px 18px !important; }
.nav-cta:hover { background: var(--red-dark) !important; }

/* DROPDOWN */
.has-dropdown { position: relative; }
.has-dropdown .dropdown { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 240px; padding: 8px 0; }
.has-dropdown:hover .dropdown { display: block; }
.dropdown li a { display: block; padding: 10px 20px; font-size: 14px; color: var(--gray-700); border-radius: 0; }
.dropdown li a:hover { background: var(--gray-50); color: var(--red); }
.arrow { font-size: 11px; }

/* MEGAMENU */
.has-megamenu .megamenu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 720px; padding: 0; z-index: 200; }
.has-megamenu:hover .megamenu { display: block; }
.megamenu-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 24px 28px 20px; }
.megamenu-col { }
.megamenu-heading { display: block; font-size: 13px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 2px solid var(--red-light); }
.megamenu-heading:hover { color: var(--red-dark); }
.megamenu-col ul { display: flex; flex-direction: column; gap: 4px; }
.megamenu-col li a { display: block; padding: 5px 0; font-size: 13px; color: var(--gray-700); font-weight: 400; }
.megamenu-col li a:hover { color: var(--red); }
.megamenu-footer { border-top: 1px solid var(--gray-200); padding: 12px 28px; text-align: center; }
.megamenu-footer a { font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .02em; }
.megamenu-footer a:hover { color: var(--red-dark); text-decoration: underline; }

/* MOBILE MENU TOGGLE */
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--gray-700); transition: .3s; border-radius: 2px; }

/* =========================================
   BREADCRUMBS
   ========================================= */
.breadcrumbs-nav { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding: 10px 0; }
.breadcrumbs-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--gray-700); }
.breadcrumbs-list li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs-list li:not(:last-child)::after { content: '›'; color: #9ca3af; }
.breadcrumbs-list a { color: var(--red); }
.breadcrumbs-list a:hover { text-decoration: underline; }
.breadcrumbs-list span { color: var(--gray-700); }

/* =========================================
   FOOTER
   ========================================= */
.site-footer { background: var(--gray-900); color: #d1d5db; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; padding: 56px 0 40px; }
.footer-brand p { font-size: 14px; line-height: 1.6; margin: 16px 0; }
.footer-contact { display: flex; flex-direction: column; gap: 6px; }
.footer-contact a { font-size: 14px; color: #d1d5db; transition: color .15s; }
.footer-contact a:hover { color: white; }
.footer-col h4 { font-size: 14px; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: #9ca3af; transition: color .15s; }
.footer-col a:hover { color: white; }
.footer-loc { display: flex; gap: 10px; margin-bottom: 16px; }
.footer-loc svg { flex-shrink: 0; margin-top: 2px; }
.footer-loc strong { display: block; color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.footer-loc address { font-style: normal; font-size: 12px; color: #9ca3af; line-height: 1.5; }
.footer-map-link { font-size: 11px; color: #dc2626; font-weight: 600; letter-spacing: .02em; }
.footer-wa-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--wa-green); color: white; padding: 8px 16px; border-radius: 6px; font-weight: 600; font-size: 13px; margin-top: 4px; transition: filter .15s; }
.footer-wa-btn:hover { filter: brightness(1.1); }
.footer-bottom { border-top: 1px solid #374151; padding: 20px 0; }
.footer-bottom p { font-size: 13px; color: #6b7280; text-align: center; }
.footer-bottom a { color: #9ca3af; }
.footer-bottom a:hover { color: white; }

/* =========================================
   SERVICE BAR / CTA BAR (Layout.astro — compartido)
   ========================================= */
.service-bar {
  background: #1e293b;
  border-top: 1px solid rgba(255,255,255,.06);
}
.service-bar--cta {
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: none;
}
.sb-list {
  display: flex;
  align-items: stretch;
}
.sb-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 28px;
  border-right: 1px solid rgba(255,255,255,.07);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sb-item:last-child { border-right: none; }
.sb-item:hover {
  background: rgba(255,255,255,.04);
  color: white;
}
.sb-item svg {
  flex-shrink: 0;
  color: rgba(255,255,255,.2);
}
.sb-label { flex: 1; }
.sb-item--cta {
  background: #dc2626;
  color: white;
  border-right: none;
  transition: background .15s;
}
.sb-item--cta svg { color: rgba(255,255,255,.6); }
.sb-item--cta:hover { background: #b91c1c; color: white; }

/* =========================================
   WHATSAPP FLOTANTE
   ========================================= */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--wa-green); border-radius: 50%;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
}

/* =========================================
   SECCIÓN HERO GENÉRICO
   ========================================= */
.page-hero { background: linear-gradient(135deg, #1f2937 0%, #374151 100%); color: white; padding: 72px 0; text-align: center; }
.page-hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.page-hero p { font-size: 18px; color: #d1d5db; max-width: 640px; margin: 0 auto 32px; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: white; padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 16px; transition: background .15s; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; background: white; color: var(--gray-900); padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 16px; border: 2px solid var(--gray-200); transition: border-color .15s; }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

/* =========================================
   BLOG — LISTA
   ========================================= */
.blog-header { background: var(--gray-900); color: white; padding: 56px 0; }
.blog-header h1 { font-size: clamp(28px,4vw,40px); font-weight: 800; }
.blog-header p { color: #9ca3af; margin-top: 12px; font-size: 17px; }

.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding: 48px 0; }
.blog-grid { display: flex; flex-direction: column; gap: 32px; }

/* BLOG CARD */
.blog-card { display: grid; grid-template-columns: 260px 1fr; gap: 24px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.blog-card-img { aspect-ratio: 4/3; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 24px 24px 24px 0; display: flex; flex-direction: column; }
.blog-card-category { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin-bottom: 8px; }
.blog-card-title { font-size: 20px; font-weight: 700; color: var(--gray-900); line-height: 1.35; margin-bottom: 10px; }
.blog-card-title a:hover { color: var(--red); }
.blog-card-desc { font-size: 15px; color: var(--gray-700); line-height: 1.55; flex: 1; }
.blog-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.blog-card-date { font-size: 13px; color: #6b7280; }
.read-more { font-size: 14px; font-weight: 600; color: var(--red); }
.read-more:hover { text-decoration: underline; }

/* =========================================
   BLOG — SIDEBAR
   ========================================= */
.blog-sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; }
.sidebar-widget-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--red); }
.sidebar-cta { background: var(--gray-900); color: white; text-align: center; }
.sidebar-cta h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.sidebar-cta p { font-size: 14px; color: #9ca3af; margin-bottom: 20px; }
.sidebar-cta-phone { display: block; font-size: 22px; font-weight: 800; color: white; margin-bottom: 12px; }
.sidebar-cta-wa { display: block; background: var(--wa-green); color: white; text-align: center; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 15px; }
.sidebar-cta-wa:hover { filter: brightness(1.1); }
.sidebar-categories { display: flex; flex-direction: column; gap: 8px; }
.sidebar-cat-link { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: var(--gray-700); transition: background .15s, color .15s; }
.sidebar-cat-link:hover { background: var(--red-light); color: var(--red); }

/* =========================================
   BLOG — ARTÍCULO
   ========================================= */
.article-hero { background: var(--gray-900); color: white; padding: 56px 0; }
.article-hero h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; line-height: 1.25; max-width: 820px; }
.article-meta { display: flex; gap: 16px; align-items: center; margin-top: 16px; font-size: 14px; color: #9ca3af; }
.article-category { background: var(--red); color: white; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; }

.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding: 48px 0; }
.article-content { font-size: 17px; line-height: 1.75; color: var(--gray-700); }
.article-content h2 { font-size: 26px; font-weight: 700; color: var(--gray-900); margin: 40px 0 16px; }
.article-content h3 { font-size: 21px; font-weight: 700; color: var(--gray-900); margin: 32px 0 12px; }
.article-content h4 { font-size: 18px; font-weight: 700; color: var(--gray-900); margin: 24px 0 10px; }
.article-content p { margin-bottom: 20px; }
.article-content ul, .article-content ol { margin: 16px 0 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.article-content li { line-height: 1.6; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content strong { color: var(--gray-900); }
.article-content a { color: var(--red); text-decoration: underline; }
.article-content a:hover { color: var(--red-dark); }
.article-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.article-content th { background: var(--gray-900); color: white; padding: 12px 16px; text-align: left; font-weight: 700; }
.article-content td { padding: 11px 16px; border-bottom: 1px solid var(--gray-200); }
.article-content tr:nth-child(even) td { background: var(--gray-50); }
.article-content blockquote { border-left: 4px solid var(--red); padding: 16px 24px; background: var(--gray-50); margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.article-content img { border-radius: var(--radius); margin: 24px 0; }

/* CTA dentro del artículo */
.article-cta-inline { background: var(--red); color: white; padding: 24px; border-radius: var(--radius); margin: 32px 0; text-align: center; }
.article-cta-inline strong { display: block; font-size: 18px; margin-bottom: 8px; }
.article-cta-inline a { color: white; font-weight: 700; text-decoration: underline; }

/* FAQ */
.faq-section { margin-top: 48px; }
.faq-section h2 { font-size: 26px; font-weight: 800; color: var(--gray-900); margin-bottom: 24px; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-question { padding: 18px 20px; font-size: 16px; font-weight: 600; color: var(--gray-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--gray-50); }
.faq-question:hover { background: var(--red-light); color: var(--red); }
.faq-answer { padding: 16px 20px; font-size: 15px; color: var(--gray-700); line-height: 1.65; display: none; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-question { background: white; color: var(--red); }

/* =========================================
   UTILIDADES
   ========================================= */
.section { padding: 64px 0; }
.section-title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 800; color: var(--gray-900); margin-bottom: 12px; }
.section-subtitle { font-size: 17px; color: var(--gray-700); max-width: 600px; }
.text-center { text-align: center; }
.text-red { color: var(--red); }
.bg-gray { background: var(--gray-50); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .blog-layout, .article-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .blog-card { grid-template-columns: 200px 1fr; }
}

@media (max-width: 768px) {
  .topbar-left { display: none; }
  .main-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; background: white; border-top: 1px solid var(--gray-200); box-shadow: var(--shadow-lg); padding: 16px; z-index: 200; max-height: 80vh; overflow-y: auto; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; }
  .has-dropdown .dropdown { position: static; box-shadow: none; border: none; padding: 0 0 0 16px; }
  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .has-megamenu .megamenu { position: static; transform: none; min-width: auto; border: none; box-shadow: none; display: none; padding: 0 0 0 8px; }
  .has-megamenu:hover .megamenu { display: none; }
  .has-megamenu.open .megamenu { display: block; }
  .megamenu-inner { grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 8px; }
  .megamenu-footer { padding: 10px 8px; text-align: left; }
  .menu-toggle { display: flex; }
  .blog-card { grid-template-columns: 1fr; }
  .blog-card-img { aspect-ratio: 16/9; }
  .blog-card-body { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 24px; }
  .whatsapp-float { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .sb-list { flex-wrap: wrap; }
  .sb-item { flex: 1 1 50%; border-bottom: 1px solid rgba(255,255,255,.07); }
  .sb-item--cta { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .page-hero { padding: 48px 0; }
  .section { padding: 48px 0; }
  .sb-item { flex: 1 1 100%; }
}

/* =========================================
   PRODUCT DETAIL — Contenido del producto
   ========================================= */
.product-content { font-size: 16px; line-height: 1.8; color: #374151; }
.product-content h1 { font-size: 26px; font-weight: 800; color: #111827; margin: 32px 0 16px; line-height: 1.25; }
.product-content h2 { font-size: 22px; font-weight: 700; color: #111827; margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 3px solid #dc2626; line-height: 1.3; }
.product-content h3 { font-size: 18px; font-weight: 700; color: #dc2626; margin: 24px 0 10px; }
.product-content h4 { font-size: 16px; font-weight: 700; color: #374151; margin: 20px 0 8px; }
.product-content p { margin-bottom: 16px; }
.product-content ul, .product-content ol { margin: 12px 0 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.product-content ul { list-style: disc; }
.product-content ol { list-style: decimal; }
.product-content li { line-height: 1.65; }
.product-content li::marker { color: #dc2626; font-weight: 700; }
.product-content strong { color: #111827; font-weight: 700; }
.product-content a { color: #dc2626; text-decoration: underline; }
.product-content a:hover { color: #b91c1c; }
.product-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.product-content th { background: #111827; color: white; padding: 10px 14px; text-align: left; font-weight: 700; }
.product-content td { padding: 10px 14px; border-bottom: 1px solid #e5e7eb; }
.product-content tr:nth-child(even) td { background: #f9fafb; }
.product-content blockquote { border-left: 4px solid #dc2626; padding: 12px 20px; background: #fef2f2; border-radius: 0 8px 8px 0; margin: 20px 0; color: #6b7280; font-style: italic; }
.product-content img { border-radius: 8px; margin: 16px 0; }

/* Primera h1 del body de markdown — si coincide con el title del hero, ocultarla */
.product-content > h1:first-child { display: none; }
