/* ==========================================================================
   XavierCortes.es - Modern Responsive Stylesheet
   Mobile-First Architecture
   ========================================================================== */

:root {
  /* Colors */
  --primary: #11569b;
  --primary-dark: #0c355f;
  --primary-light: #e6f1fc;
  --accent: #52bfb2;
  --accent-hover: #3ea89b;
  --dark-bg: #07121c;
  --dark-surface: #0f1e2e;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --text-light: #f8fafc;
  --text-light-muted: #94a3b8;
  --border-light: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.1);
  --whatsapp: #25d366;
  --whatsapp-hover: #20ba5a;

  /* Typography */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Spacing & Layout */
  --container-width: 1200px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #ffffff;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: #ffffff;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--dark-bg);
  border-bottom: 1px solid var(--border-dark);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo span {
  color: var(--accent);
}

/* Desktop Navigation */
.main-nav {
  display: none;
}

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

.nav-link {
  color: var(--text-light-muted);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* Mobile Menu Button */
.menu-toggle-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  gap: 5px;
  z-index: 1010;
}

.menu-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ffffff;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}

.menu-toggle-btn.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle-btn.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle-btn.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Off-canvas Drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(7, 18, 28, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
  border-top: 1px solid var(--border-dark);
}

.mobile-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav-link {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-dark);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #ffffff;
}

.mobile-nav-link.active {
  color: var(--accent);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-light-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  background-color: var(--dark-bg);
  background-image: linear-gradient(135deg, rgba(7, 18, 28, 0.92) 0%, rgba(12, 53, 95, 0.85) 100%),
                    url('../img/corner-office-lit-up-at-night.webp');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 3rem 0;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column-reverse;
  gap: 2.5rem;
  align-items: center;
}

.hero-image-wrapper {
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background-color: #ffffff;
  border: 4px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.hero-image-wrapper:hover {
  transform: translateY(-4px);
}

.hero-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-text {
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(82, 191, 178, 0.15);
  color: var(--accent);
  border: 1px solid rgba(82, 191, 178, 0.35);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-light-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #0e4881;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 86, 155, 0.35);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--dark-bg);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(82, 191, 178, 0.35);
}

.btn-outline {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Page Headers (for Subpages)
   ========================================================================== */
.page-header {
  background-color: var(--dark-bg);
  background-image: linear-gradient(135deg, rgba(7, 18, 28, 0.95), rgba(17, 86, 155, 0.85)),
                    url('../img/corner-office-lit-up-at-night.webp');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 3.5rem 0;
  text-align: center;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light-muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: var(--accent);
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Sections & Grids
   ========================================================================== */
.section {
  padding: 4rem 0;
}

.section-bg-light {
  background-color: var(--light-bg);
}

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

.section-badge {
  display: inline-block;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 1rem;
}

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

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.feature-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.feature-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.feature-card:hover .feature-card-image img {
  transform: scale(1.05);
}

.feature-card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.feature-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.feature-card-text {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.feature-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: auto;
}

.feature-card-link:hover {
  color: var(--accent);
}

/* Services Detail List */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.service-item-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-item-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent);
}

.service-item-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.service-item-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Why Choose Me Grid */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.why-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.2s ease;
}

.why-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.why-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.why-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.why-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Quote Box (About Page) */
.quote-card {
  background-color: var(--dark-bg);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  position: relative;
  border: 1px solid var(--border-dark);
  margin: 2.5rem 0;
  box-shadow: var(--shadow-xl);
}

.quote-card::before {
  content: "“";
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 5rem;
  color: rgba(82, 191, 178, 0.2);
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.quote-author {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
}

/* Contact Channels Cards */
.contact-channels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.channel-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.channel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.channel-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.channel-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.channel-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.channel-info {
  color: var(--text-muted);
  font-weight: 500;
}

.channel-info a {
  color: var(--primary);
}

.channel-info a:hover {
  text-decoration: underline;
}

/* Contact Form */
.contact-form-wrapper {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin: 0 auto;
}

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

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 86, 155, 0.15);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.form-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.form-status {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 500;
  display: none;
}

.form-status.is-success {
  display: block;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-status.is-error {
  display: block;
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Floating WhatsApp Button */
.whatsapp-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background-color: var(--whatsapp);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  z-index: 999;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
}

.whatsapp-floating-btn:hover {
  background-color: var(--whatsapp-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}

.whatsapp-floating-btn svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  background-color: var(--dark-bg);
  border-top: 1px solid var(--border-dark);
  color: var(--text-light-muted);
  padding: 3.5rem 0 2rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-brand h3 span {
  color: var(--accent);
}

.footer-brand p {
  line-height: 1.6;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-heading {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  position: relative;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  font-size: 0.95rem;
  color: var(--text-light-muted);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablets (>= 768px) */
@media (min-width: 768px) {
  .main-nav {
    display: block;
  }

  .menu-toggle-btn {
    display: none;
  }

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

  .features-grid .feature-card:nth-child(3) {
    grid-column: span 2;
  }

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

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

  .about-grid {
    grid-template-columns: 1fr 1.4fr !important;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1.5fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
  .hero {
    padding: 5rem 0;
  }

  .hero-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3.5rem;
  }

  .hero-text {
    flex: 1;
  }

  .hero-image-wrapper {
    flex: 0 0 420px;
    margin: 0;
  }

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

  .features-grid .feature-card:nth-child(3) {
    grid-column: span 1;
  }

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

/* Mobile Specific Optimizations (< 576px) */
@media (max-width: 575px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .whatsapp-floating-btn {
    bottom: 16px;
    right: 16px;
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
  }

  .contact-form-wrapper {
    padding: 1.5rem 1.25rem;
  }
}
