/*
 * Custom styles for the Domestic Solutions page with sticky sidebar
 * VERSION 2.1 - Corrected top spacing issue
 */

/* ===================================================================
   1. LAYOUT & SPACING
   =================================================================== */

/*
   NOTE: The incorrect 'margin-top' on '.domestic-solution-main' has been REMOVED.
   The space is now handled by the natural padding of the section below the hero.
*/

/* Main layout for the sidebar and content */
.solution-content-wrapper {
    padding: var(--section-padding) 0;
    background-color: var(--background-color);
}

.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ===================================================================
   2. STICKY SIDEBAR NAVIGATION STYLING
   =================================================================== */
#sidebar-nav {
    position: sticky;
    /* This value determines where the sidebar stops when you scroll down */
    top: 180px; /* (Approx. 80px header + 30px desired space) */
    left: 0;
    width: 280px;
    flex-shrink: 0;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    border: 1px solid #e9ecef;
    padding: 25px;
    z-index: 900;
}

/* Sidebar Title */
.sidebar-title {
    font-family: var(--heading-font);
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.75rem;
}

/* Sidebar Divider Line */
.sidebar-divider {
    margin-top: 0;
    margin-bottom: 1rem;
    border: 0;
    border-top: 1px solid #dee2e6;
}

#sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#sidebar-nav ul li a {
    display: block;
    padding: 12px 15px;
    color: var(--default-color);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

/* Hover state for non-active links (light green background) */
#sidebar-nav ul li a:hover:not(.active) {
    color: var(--accent-color);
    background-color: #e6f4ef;
}

/* Active link style (solid green background) */
#sidebar-nav ul li a.active {
    background-color: var(--accent-color);
    color: var(--contrast-color);
    font-weight: 600;
}

/* ===================================================================
   3. CONTENT DISPLAY AREA
   =================================================================== */
.content-display-area {
    flex-grow: 1;
}

.content-section {
    display: none;
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

.content-section .tap-water-systems-container,
.content-section .borehole-systems-container,
.content-section .accessories-section-container {
    padding: 0;
    margin-top: 0;
    border-top: none;
    background-color: transparent;
    box-shadow: none;
}

.content-section .section-title {
    padding-bottom: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.content-section .section-title h3::after {
    left: 0;
    transform: translateX(0);
}

/* ===================================================================
   4. RESPONSIVE ADJUSTMENTS
   =================================================================== */
@media (max-width: 991px) {
    .main-layout {
        flex-direction: column;
    }

    #sidebar-nav {
        position: static;
        width: 100%;
        margin-bottom: 30px;
    }

    .sidebar-title {
        text-align: center;
    }

    #sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
}

/* ===================================================================
   5. ANIMATIONS
   =================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer location icon wave */
.footer .location-icon--title {
  margin-left: 8px;
  margin-top: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.footer .location-icon--title i {
  font-size: 12px;
}

.footer .location-list {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}

.footer .location-list a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  line-height: 1.35;
}

.footer .location-list li {
  padding: 0;
}

.footer .location-icon {
  --location-green: #25d366;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  color: var(--location-green);
}

.footer .location-icon i {
  font-size: 14px;
  line-height: 1;
  z-index: 1;
}

.footer .location-text {
  display: inline-block;
}

.footer .location-icon::before,
.footer .location-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: location-wave 2.4s ease-out infinite;
}

.footer .location-icon::after {
  animation-delay: 1.2s;
}

@keyframes location-wave {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Footer location map modal */
.location-map-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
}

.location-map-modal.active {
  display: flex;
}

.location-modal-dialog {
  width: min(720px, 92vw);
  background: var(--surface-color);
  color: var(--default-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.location-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
}

.location-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.location-modal-close {
  border: none;
  background: transparent;
  color: var(--default-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.location-modal-close:hover {
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color), transparent 85%);
}

.location-modal-body iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .location-modal-body iframe {
    height: 260px;
  }
}

.location-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.location-modal-select {
  min-width: 180px;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 70%);
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 13px;
}

.location-modal-jump {
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: #25d366;
  color: #0b3c2d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.location-modal-jump:hover {
  filter: brightness(0.95);
}

@media (max-width: 640px) {
  .location-modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .location-modal-select {
    width: 100%;
    max-width: none;
  }
}

/* Footer muted column */
.footer .footer-muted {
  opacity: 0.7;
}

.footer .footer-muted h4 {
  opacity: 0.85;
}

/* Footer office headings */
.footer .office-heading {
  color: #25d366;
}

/* Footer subscribe + stats */
.footer .footer-subscribe {
  margin-top: 16px;
}

.footer .footer-subscribe-form {
  margin-top: 8px;
}

.footer .footer-subscribe-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer .footer-subscribe-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 70%);
  background: color-mix(in srgb, var(--surface-color), transparent 85%);
  color: var(--default-color);
  font-size: 13px;
}

.footer .footer-subscribe-row input::placeholder {
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

.footer .footer-subscribe-row button {
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: #25d366;
  color: #0b3c2d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.footer .footer-subscribe-row button:hover {
  filter: brightness(0.95);
}

.footer .footer-stat {
  margin-top: 16px;
}

.footer .footer-stat-number {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-color);
}

.footer .footer-stat-caption {
  margin: 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

@media (max-width: 768px) {
  .footer .footer-subscribe-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Footer cards row */
.footer .footer-cards-row {
  margin-top: -120px;
  margin-bottom: 20px;
}

.footer .footer-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.footer .footer-card {
  background: color-mix(in srgb, var(--surface-color), transparent 88%);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
  border-radius: 12px;
  padding: 12px 14px;
}

.footer .footer-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.footer .footer-card--wide {
  grid-column: span 2;
}

.footer .footer-subscribe-form {
  margin: 0;
}

.footer .footer-subscribe-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer .footer-subscribe-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 70%);
  background: color-mix(in srgb, var(--surface-color), transparent 85%);
  color: var(--default-color);
  font-size: 13px;
}

.footer .footer-subscribe-row input::placeholder {
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

.footer .footer-subscribe-row button {
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: #25d366;
  color: #0b3c2d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.footer .footer-subscribe-row button:hover {
  filter: brightness(0.95);
}

.footer .footer-stat-number {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-color);
}

.footer .footer-stat-caption {
  margin: 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

@media (max-width: 992px) {
  .footer .footer-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer .footer-card--wide {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .footer .footer-subscribe-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1200px) {
  .footer .footer-cards-row {
    margin-top: 16px;
  }
}

/* Footer values/helpdesk cards */
.footer .footer-values,
.footer .footer-quick-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer .footer-values li,
.footer .footer-quick-links li {
  padding: 4px 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}


.footer .footer-card p {
  margin: 6px 0;
  font-size: 13px;
}

.footer .footer-card-label {
  margin-top: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

/* Footer list subheadings */
.footer .footer-subheading {
  margin-top: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

/* Footer heading emphasis */
.footer h4 {
  font-weight: 700;
  color: var(--accent-color);
}

.footer .footer-about .logo span {
  font-family: var(--heading-font);
}

/* Footer muted headings */
.footer .footer-heading-muted {
  color: color-mix(in srgb, var(--default-color), transparent 30%);
  font-weight: 600;
}

/* Footer social hover animation */
.footer .social-links a {
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.footer .social-links a:hover {
  color: #f4c542;
  border-color: #f4c542;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 18px rgba(244, 197, 66, 0.25);
}

.footer .social-links a:hover i {
  color: #f4c542;
}

/* Ensure footer social links stay clickable above footer cards */
.footer .social-links {
  position: relative;
  z-index: 3;
}

.footer .footer-cards-row {
  position: relative;
  z-index: 1;
}

/* Footer subscribe CTA */
.footer .footer-card-tagline {
  margin: 0 0 10px;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

.footer .footer-subscribe-row .subscribe-cta {
  animation: subscribe-pulse 1.4s ease-in-out infinite;
  transform-origin: center;
}

.footer .footer-subscribe-row .subscribe-cta:hover {
  animation-play-state: paused;
}

@keyframes subscribe-pulse {
  0%, 100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  60% {
    transform: scale(0.96);
  }
}

/* Footer card link */
.footer .footer-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--accent-color);
}

.footer .footer-card-link:hover {
  color: color-mix(in srgb, var(--accent-color), transparent 25%);
}

.footer .footer-card-link--button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #25d366;
  color: #0b3c2d;
  font-size: 13px;
  font-weight: 600;
}

.footer .footer-card-link--button:hover {
  filter: brightness(0.95);
}

/* Footer projects row */
.footer .footer-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer .footer-project-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #25d366;
  color: #0b3c2d;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
}

.footer .footer-project-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer .footer-project-year {
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

@media (max-width: 576px) {
  .footer .footer-project-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Force Completed Projects header to white */
.footer .footer-project-title {
  color: #ffffff !important;
}

/* Footer cards mobile responsiveness */
@media (max-width: 576px) {
  .footer .footer-cards-grid {
    grid-template-columns: 1fr;
  }

  .footer .footer-card--wide {
    grid-column: span 1;
  }

  .footer .footer-subscribe-row button,
  .footer .footer-card-link--button,
  .footer .footer-project-count {
    width: 100%;
    justify-content: center;
  }

  .footer .footer-subscribe-row {
    gap: 10px;
  }
}
