/* ============================================
   MED-TEX ELECTRICAL CONTRACTORS — STYLES
   ============================================ */

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

:root {
  --terracotta: #C4704B;
  --terracotta-dark: #A85A38;
  --terracotta-light: #D4916E;
  --sand: #F5EDE3;
  --sand-light: #FAF6F1;
  --sand-dark: #E8DDD0;
  --cream: #FDFBF8;
  --charcoal: #2C2420;
  --charcoal-light: #4A3F38;
  --warm-gray: #7A6E66;
  --warm-gray-light: #A89B92;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(44, 36, 32, 0.06), 0 1px 2px rgba(44, 36, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(44, 36, 32, 0.08), 0 2px 6px rgba(44, 36, 32, 0.04);
  --shadow-lg: 0 12px 40px rgba(44, 36, 32, 0.10), 0 4px 12px rgba(44, 36, 32, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  color: var(--charcoal);
}

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

a:hover { color: var(--terracotta-dark); }

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(253, 251, 248, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(196, 112, 75, 0.08);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(253, 251, 248, 0.96);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--charcoal);
  text-decoration: none;
}

.nav-logo:hover { color: var(--charcoal); }

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

.nav-links a {
  color: var(--charcoal-light);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  transition: all var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--terracotta);
  background: rgba(196, 112, 75, 0.07);
}

.nav-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--terracotta) !important;
  background: rgba(196, 112, 75, 0.08) !important;
  font-weight: 600 !important;
}

.nav-phone:hover {
  background: rgba(196, 112, 75, 0.15) !important;
  color: var(--terracotta-dark) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(253, 251, 248, 0.92) 0%,
    rgba(245, 237, 227, 0.85) 40%,
    rgba(196, 112, 75, 0.35) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(196, 112, 75, 0.1);
  border: 1px solid rgba(196, 112, 75, 0.2);
  color: var(--terracotta-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero-headline {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1.05;
  margin-bottom: 24px;
  max-width: 700px;
}

.hero-headline span {
  color: var(--terracotta);
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--warm-gray);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--terracotta);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--warm-gray);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--sand-dark);
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--warm-gray-light);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: float 2.4s ease-in-out infinite;
}

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

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  border-color: var(--terracotta);
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 112, 75, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--charcoal);
}

.btn-outline:hover {
  background: var(--charcoal);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}

.btn-outline-light:hover {
  background: var(--white);
  color: var(--terracotta);
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* --- SECTION COMMON --- */
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--warm-gray);
  max-width: 560px;
  line-height: 1.7;
}

.section-header {
  margin-bottom: 64px;
}

.section-header--centered {
  text-align: center;
}

.section-header--centered .section-desc {
  margin: 0 auto;
}

/* --- SERVICES --- */
.services {
  padding: 120px 0;
  background: var(--cream);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--terracotta), var(--terracotta-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.service-card:hover .service-icon {
  background: rgba(196, 112, 75, 0.1);
  transform: scale(1.05);
}

.service-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--charcoal);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--warm-gray);
  line-height: 1.7;
}

/* --- ABOUT --- */
.about {
  padding: 120px 0;
  background: var(--sand-light);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-images {
  position: relative;
}

.about-img-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-img-main img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.about-img-float {
  position: absolute;
  bottom: -40px;
  right: -40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--sand-light);
}

.about-img-float img {
  width: 280px;
  height: 200px;
  object-fit: cover;
}

.about-badge {
  position: absolute;
  top: -20px;
  right: 40px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.4;
}

.about-content {
  padding: 20px 0;
}

.about-text {
  font-size: 1.05rem;
  color: var(--warm-gray);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
}

.value-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--charcoal-light);
}

.value-item svg {
  flex-shrink: 0;
}

/* --- WHY US --- */
.why-us {
  padding: 120px 0;
  background: var(--cream);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  padding: 40px 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--sand-dark);
  transition: all var(--transition);
}

.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.why-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--sand-dark);
  line-height: 1;
  margin-bottom: 20px;
  transition: color var(--transition);
}

.why-card:hover .why-number {
  color: var(--terracotta-light);
}

.why-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--charcoal);
}

.why-card p {
  font-size: 0.9rem;
  color: var(--warm-gray);
  line-height: 1.7;
}

/* --- CTA BANNER --- */
.cta-banner {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.cta-text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--white);
  margin-bottom: 16px;
}

.cta-text p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  max-width: 440px;
}

.cta-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-actions .btn-primary {
  background: var(--white);
  color: var(--terracotta);
  border-color: var(--white);
}

.cta-actions .btn-primary:hover {
  background: var(--sand-light);
  border-color: var(--sand-light);
  color: var(--terracotta-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* --- CONTACT --- */
.contact {
  padding: 120px 0;
  background: var(--sand-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--warm-gray);
  line-height: 1.7;
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  gap: 20px;
}

.contact-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.contact-item strong {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 4px;
}

.contact-item p {
  font-size: 0.95rem;
  color: var(--charcoal-light);
  line-height: 1.6;
}

.contact-item a {
  color: var(--charcoal-light);
}

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

/* --- FORM --- */
.contact-form-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--sand-dark);
}

.contact-form h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.form-note {
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin-bottom: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--sand-dark);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
  background: var(--sand-light);
  transition: all var(--transition);
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--terracotta);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(196, 112, 75, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--warm-gray-light);
}

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

.form-success {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(196, 112, 75, 0.06);
  border: 1px solid rgba(196, 112, 75, 0.15);
  border-radius: var(--radius-sm);
  margin-top: 20px;
  color: var(--terracotta-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-success.show {
  display: flex;
}

/* --- FOOTER --- */
.footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-logo:hover { color: var(--white); }

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  transition: color var(--transition);
  text-decoration: none;
}

.footer-col a:hover { color: var(--terracotta-light); }

.footer-col address {
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-bottom {
  padding: 28px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

/* --- ANIMATIONS --- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(253, 251, 248, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 4px;
    border-bottom: 1px solid var(--sand-dark);
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-phone {
    justify-content: center;
    margin-top: 8px;
  }

  .hero-content { padding: 140px 24px 100px; }

  .hero-stats { gap: 24px; }
  .hero-stat-divider { display: none; }

  .services { padding: 80px 0; }
  .services-grid { grid-template-columns: 1fr; }

  .about { padding: 80px 0; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .about-img-float {
    right: -16px;
    bottom: -24px;
  }

  .about-img-main img { height: 360px; }

  .about-values { grid-template-columns: 1fr; }

  .why-us { padding: 80px 0; }
  .why-grid { grid-template-columns: 1fr; }

  .cta-banner { padding: 80px 0; }
  .cta-inner { flex-direction: column; text-align: center; }

  .contact { padding: 80px 0; }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-form-wrap { padding: 32px 24px; }
  .form-row { grid-template-columns: 1fr; }

  .footer { padding: 60px 0 0; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 2.4rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .cta-actions { flex-direction: column; width: 100%; }
  .cta-actions .btn { width: 100%; justify-content: center; }
}
