/* ========================================
   C.M.P Plumbing — Custom Styles
   Classic & Elegant Design System
   ======================================== */

/* --- Custom Properties --- */
:root {
  --color-terracotta: #B85D38;
  --color-terracotta-dark: #9A4B28;
  --color-sand: #E8D5C4;
  --color-sand-light: #F5EDE4;
  --color-sand-lighter: #FAF6F2;
  --color-charcoal: #2C2420;
  --color-warm-gray: #6B5E56;
  --color-cream: #FDF9F5;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

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

/* --- Selection --- */
::selection {
  background-color: var(--color-terracotta);
  color: white;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-sand-light);
}
::-webkit-scrollbar-thumb {
  background: var(--color-terracotta);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-terracotta-dark);
}

/* --- Hero Reveal Animations --- */
.hero-reveal {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 0.8s ease forwards;
}

.hero-reveal:nth-child(1) { animation-delay: 0.1s; }
.hero-reveal:nth-child(2) { animation-delay: 0.3s; }
.hero-reveal:nth-child(3) { animation-delay: 0.5s; }
.hero-reveal:nth-child(4) { animation-delay: 0.7s; }
.hero-reveal:nth-child(5) { animation-delay: 0.9s; }

.hero-badge {
  opacity: 0;
  transform: translateY(20px);
  animation: heroBadge 0.8s ease forwards;
  animation-delay: 1.1s;
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroBadge {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Section Reveal (Scroll-triggered) --- */
.section-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
#services .section-reveal:nth-child(1) { transition-delay: 0.05s; }
#services .section-reveal:nth-child(2) { transition-delay: 0.1s; }
#services .section-reveal:nth-child(3) { transition-delay: 0.15s; }
#services .section-reveal:nth-child(4) { transition-delay: 0.2s; }
#services .section-reveal:nth-child(5) { transition-delay: 0.25s; }
#services .section-reveal:nth-child(6) { transition-delay: 0.3s; }

/* --- Navbar --- */
.nav-scrolled {
  background-color: rgba(253, 249, 245, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 20px rgba(44, 36, 32, 0.08);
}

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

/* --- Mobile Menu --- */
.mobile-link {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }
#mobileMenu.open .mobile-link:nth-child(6) { transition-delay: 0.35s; }
#mobileMenu.open .mobile-link:nth-child(7) { transition-delay: 0.4s; }

/* --- Button Hover Effects --- */
a, button {
  transition: all 0.3s ease;
}

/* --- Form Styling --- */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(184, 93, 56, 0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B5E56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Back to Top --- */
#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Image hover zoom --- */
.overflow-hidden img {
  transition: transform 0.6s ease;
}

.group:hover .overflow-hidden img,
.overflow-hidden:hover img {
  transform: scale(1.03);
}

/* --- Divider --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-sand), transparent);
}

/* --- Responsive --- */
@media (max-width: 767px) {
  .hero-reveal {
    animation-duration: 0.6s;
  }
}

/* --- Print --- */
@media print {
  nav, #backToTop, #contactForm, #successMessage {
    display: none !important;
  }
  
  body {
    color: #000;
    background: #fff;
  }
  
  .bg-cmp-charcoal, #testimonials {
    background: #f5f5f5 !important;
    color: #000 !important;
  }
}
