/* ==========================================================================
   ESTUDIO ROER ARQUITECTURA - Sobriety & Trust Design System
   Paleta Inspirada en Materiales: Concreto, Madera & Acero
   Mobile-First & Universal Responsive Optimization
   ========================================================================== */

:root {
  /* Paleta Sobria de Materiales */
  --steel-dark: #1e252d;           /* Acero Grafito Oscuro */
  --steel-medium: #2d3642;         /* Acero Estructural */
  --wood-warm: #8c5b36;            /* Madera Tono Cálido (Nogal/Cedro) */
  --wood-hover: #734828;           /* Madera Oscura Hover */
  --wood-light: rgba(140, 91, 54, 0.1);

  --concrete-bg: #f5f7f8;          /* Concreto Superficie Clara */
  --concrete-card: #ffffff;        /* Blanco Pulido */
  --concrete-border: #e1e5e8;      /* Borde Tono Concreto */

  --text-main: #1e252d;            /* Texto Acero */
  --text-muted: #566370;          /* Texto Neutro */
  --text-light: #8895a3;

  /* Fonts */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(30, 37, 45, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 37, 45, 0.08);

  /* Radius & Transitions */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--concrete-bg);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--steel-dark);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

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

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1.5px solid var(--concrete-border);
  padding: 0.75rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-badge {
  width: 36px;
  height: 36px;
  background: var(--steel-dark);
  color: var(--wood-warm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  border-left: 3px solid var(--wood-warm);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--steel-dark);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--wood-warm);
}

/* Button Styles & Mobile Touch Targets */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 40px;
}

.btn-micro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.38rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--steel-dark);
  background: transparent;
  color: var(--steel-dark);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  min-height: 36px;
}

.btn-micro:hover {
  background: var(--steel-dark);
  color: white;
}

.btn-micro-filled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--wood-warm);
  color: white;
  border: 1px solid var(--wood-warm);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  min-height: 40px;
}

.btn-micro-filled:hover {
  background: var(--wood-hover);
  border-color: var(--wood-hover);
}

.btn-primary {
  background: var(--wood-warm);
  color: white;
}

.btn-primary:hover {
  background: var(--wood-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--steel-dark);
  border: 1px solid var(--steel-dark);
}

.btn-secondary:hover {
  background: var(--steel-dark);
  color: white;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1ebc57;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--steel-dark);
  padding: 0.25rem 0.5rem;
  min-height: 44px;
  min-width: 44px;
}

/* Hero Section */
.hero {
  padding: 3.75rem 0;
  background: linear-gradient(180deg, #ffffff 0%, var(--concrete-bg) 100%);
  border-bottom: 1px solid var(--concrete-border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wood-warm);
  background: var(--wood-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 3px solid var(--wood-warm);
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--steel-dark);
}

.hero-title span {
  color: var(--wood-warm);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2.25rem;
}

.hero-metrics {
  display: flex;
  gap: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--concrete-border);
}

.metric h4 {
  font-size: 1.5rem;
  color: var(--steel-dark);
  font-family: var(--font-body);
  font-weight: 800;
}

.metric p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-image-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--concrete-border);
}

.hero-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
}

/* Sections & Grid */
.section {
  padding: 3.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.25rem;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wood-warm);
  margin-bottom: 0.35rem;
  display: block;
}

.section-title {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: var(--steel-dark);
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Servicios Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--concrete-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid var(--concrete-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--wood-warm);
}

.service-icon {
  width: 40px;
  height: 40px;
  background: var(--steel-dark);
  color: var(--wood-warm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.service-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.service-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.service-link {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--wood-warm);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.service-link:hover {
  text-decoration: underline;
}

/* Calculadora Card & iOS Auto-Zoom Prevention */
.calc-card {
  background: var(--steel-dark);
  color: white;
  border-radius: var(--radius-md);
  padding: 2.25rem 1.75rem;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
}

.calc-card h2 {
  color: white;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
  align-items: flex-start;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d1d7de;
  margin-bottom: 0.35rem;
}

/* Minimum 16px font size prevents automatic iOS Safari zoom on input click */
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  font-size: 16px;
  color: white;
  outline: none;
  transition: var(--transition);
  min-height: 42px;
}

.form-control:focus {
  border-color: var(--wood-warm);
  background: rgba(255, 255, 255, 0.12);
}

select.form-control option {
  background: var(--steel-dark);
  color: white;
}

.calc-result {
  background: rgba(140, 91, 54, 0.15);
  border: 1px solid var(--wood-warm);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
}

.calc-result.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.calc-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  margin: 0.3rem 0;
}

/* Resources & Blog Tabs - Horizontal Scroll on Mobile */
.resources-tabs-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--concrete-border);
  background: white;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 40px;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--steel-dark);
  color: white;
  border-color: var(--steel-dark);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.content-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--concrete-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.content-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--wood-warm);
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--wood-warm);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

/* FAQ Accordion Mobile Touch Friendly */
.faq-list {
  max-width: 750px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--concrete-border);
  overflow: hidden;
}

.faq-header {
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--steel-dark);
  min-height: 48px;
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--concrete-bg);
}

.faq-body p {
  padding: 0.85rem 1.15rem;
  font-size: 0.88rem;
  color: var(--text-main);
}

.faq-item.active .faq-body {
  max-height: 280px;
}

/* Contacto Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
}

.contact-info {
  background: var(--steel-dark);
  color: white;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.contact-info h3 {
  color: white;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.contact-info p {
  color: #a3b0be;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.contact-item a {
  color: #e1e5e8;
}

.contact-item a:hover {
  color: var(--wood-warm);
}

.contact-icon {
  width: 36px;
  height: 36px;
  background: rgba(140, 91, 54, 0.2);
  color: var(--wood-warm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-form-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  border: 1px solid var(--concrete-border);
  box-shadow: var(--shadow-sm);
}

.contact-form-card .form-control {
  background: var(--concrete-bg);
  color: var(--steel-dark);
  border-color: var(--concrete-border);
}

.contact-form-card .form-control:focus {
  border-color: var(--wood-warm);
  background: white;
}

.contact-form-card label {
  color: var(--steel-dark);
}

/* Floating Stacked & Draggable Widget */
.floating-widget-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.floating-widget-stack:active {
  cursor: grabbing;
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 2px solid white;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  outline: none;
}

.floating-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.gift-btn {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  animation: pulse-gift 2.5s infinite;
}

.wa-btn {
  background: #25d366;
  color: white;
}

@keyframes pulse-gift {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.floating-tooltip {
  position: absolute;
  right: 58px;
  background: var(--steel-dark);
  color: white;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-btn:hover .floating-tooltip {
  opacity: 1;
}

/* Footer & Modal */
.footer {
  background: #151a20;
  color: #8895a3;
  padding: 2.25rem 0 1.25rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  color: white;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.footer-socials a:hover {
  color: var(--wood-warm);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 37, 45, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: white;
  border-radius: var(--radius-md);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-md);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  min-height: 40px;
  min-width: 40px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS (Mobile-First Polish)
   ========================================================================== */

/* Tablets (< 900px) */
@media (max-width: 900px) {
  .hero-grid, .calc-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-image {
    height: 300px;
  }

  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }
}

/* Mobile Phones (< 600px) */
@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.75rem 0;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .hero-actions .btn-micro, .hero-actions .btn-micro-filled {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .hero-metrics {
    gap: 1.25rem;
    justify-content: space-around;
  }

  .metric h4 {
    font-size: 1.3rem;
  }

  .metric p {
    font-size: 0.72rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .calc-card {
    padding: 1.75rem 1.25rem;
  }

  .contact-info, .contact-form-card {
    padding: 1.5rem 1.25rem;
  }

  .floating-widget-stack {
    bottom: 16px;
    right: 16px;
  }

  .floating-tooltip {
    display: none; /* Hide hover tooltips on mobile touch screens for cleaner view */
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Ultra Small Mobile Screens (< 380px) */
@media (max-width: 380px) {
  .brand-name {
    font-size: 0.95rem;
  }

  .logo-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .hero-title {
    font-size: 1.7rem;
  }
}
