/*
  Summit Social Media - Refactored Stylesheet v1.9.1
  -------------------------------------------------
  - Removed bottom padding to eliminate footer whitespace.
  - Footer now uses margin-top: auto for proper flex behavior.
*/

/* ── CSS Custom Properties (Variables) ────────────────────────────────── */
:root {
  --color-primary: #730707; /* Main brand red */
  --color-primary-hover: #e03e3e; /* Lighter red for hover effects */
  --color-background: #e7e3e0; /* Main background taupe */
  --color-text-dark: #333; /* Dark text for readability */
  --color-text-light: #fff; /* Light text for dark backgrounds */
  --color-white: #fff;
  --color-black: #000;
  --color-border: #ccc;
  --font-main: Arial, sans-serif;
}

/* ── Base & Reset (Mobile-First) ─────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-background);
  color: var(--color-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.5;
  padding-top: 5rem; /* Reserve space for fixed header */
  padding-bottom: 0; /* Remove bottom padding */
}

main {
  flex-grow: 1; /* Ensures main content pushes footer down */
}

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

/* ── Header (Mobile) ─────────────────────────────────────────────────── */
.top-bar, .main-header {
  position: fixed; /* Attach header to the top */
  left: 0;
  right: 0;
  background: var(--color-background);
}

.top-bar {
  top: 0;
  font-size: 0.75rem;
  padding: 0.2rem 1rem;
  border-bottom: 1px solid var(--color-primary);
  font-weight: bold;
  z-index: 1001;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
}

.top-bar .top-links {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.top-bar .top-links li {
  position: relative;
  padding: 0;
}

.top-bar .top-links li:not(:first-child)::before {
  display: none;
}

.top-bar .top-links a {
  color: var(--color-text-dark);
  text-decoration: none;
}

.main-header {
  top: 1.5rem; /* Position below the top-bar */
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* Increased gap for more space */
}

.main-header .logo img {
  height: 36px; /* Further reduced logo size for mobile */
  width: auto;
}

.social-icons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.social-icons img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.menu-toggle {
  font-size: 1.75rem;
  background: none;
  border: none;
  z-index: 9999;
  cursor: pointer;
  color: var(--color-text-dark);
}

/* ── Navigation (Mobile) ─────────────────────────────────────────── */
.primary-nav {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: var(--color-background);
  display: block; /* Changed for transform animation */
  visibility: hidden; /* Hide by default */
  opacity: 0;
  transform: translateY(-10px); /* Start slightly up */
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  flex-direction: column;
  padding: 0.5rem 0;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 9998;
}

.primary-nav.nav-open {
  visibility: visible; /* Show when open */
  opacity: 1;
  transform: translateY(0); /* Move to final position */
}

.primary-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.primary-nav li + li {
  border-top: 1px solid var(--color-black);
}

.primary-nav a {
  text-align: center;
  color: var(--color-text-dark);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  display: block;
  transition: background-color 0.2s ease;
}

.primary-nav a:hover {
  background-color: rgba(0, 0, 0, 0.05); /* Subtle hover effect */
}

/* ── Hero Section (Mobile) ─────────────────────────────────────────── */
.hero {
  background-image: url('images/roof-worker.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  height: 30vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  text-align: center;
}

.hero.hero-contact {
  background-image: url('images/truck.jpg');
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(115, 7, 7, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-text-light);
  padding: 1rem;
}

.hero-content h1 {
  font-size: 2rem;
}

.hero-content p {
  font-size: 1rem;
}

/* ── Call to Action Button ───────────────────────────────────────── */
.estimate-cta {
  background-color: var(--color-background);
  padding: 2rem 0;
  display: flex;
  justify-content: center;
}

.btn.free-estimate {
  padding: 1rem 2rem; /* Increased padding for a larger button */
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem; /* Slightly larger font */
  white-space: nowrap;
  text-align: center;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn.free-estimate:hover {
  background-color: var(--color-primary-hover);
}

/* ── Services Grid (Mobile) ──────────────────────────────────────── */
.services-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  background-color: var(--color-background);
}

.service-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: var(--color-white);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.service-card-image {
  width: 100%;
  padding-bottom: 75%;
  position: relative;
  overflow: hidden;
}

.service-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card-content {
  padding: 1rem;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.service-card-content h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.service-card-content p {
  color: var(--color-text-dark);
  flex-grow: 1;
}

/* ── Contact Form (Mobile) ───────────────────────────────────────── */
.contact-section {
  padding: 2rem 0;
}

.contact-form {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

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

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-primary);
  text-align: center;
}

.contact-form input,
.contact-form textarea {
  width: 70%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
  text-align: left;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.contact-form .hidden {
  display: none;
}

/* ── Map Page Styles ───────────────────────────────────────── */
.map-wrapper {
    padding: 2rem 0;
}

.zip-check {
  margin: 2rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.zip-check input {
  padding: 0.75rem;
  font-size: 1rem;
  width: 100%;
  max-width: 250px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-align: center;
}

.zip-check button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.zip-check button:hover {
  background-color: var(--color-primary-hover);
}

.zip-check p {
  margin-top: 1rem;
  font-weight: bold;
}

/* ── Social Media Page Styles ────────────────────────────────── */
.facebook-section {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}
#fb-container {
  max-width: 500px; /* Max width allowed by Facebook */
  width: 100%;
}
/* This helps force the iframe rendered by Facebook to fill the container */
.fb-page,
.fb-page span,
.fb-page span iframe[style] {
  width: 100% !important;
}


/* ── Footer (Mobile) ─────────────────────────────────────────────── */
footer {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  margin-top: auto; /* Ensures it sticks to bottom */
  position: relative;
}


/* ── Desktop Styles (768px and wider) ────────────────────────────── */
@media screen and (min-width: 768px) {
  
  body {
    padding-top: 5.5rem;
    padding-bottom: 0; /* Removed bottom padding */
  }
  
  .top-bar .top-links li {
    padding: 0 0.75rem;
  }

  .top-bar .top-links li:not(:first-child)::before {
    display: block;
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 1em;
    background-color: var(--color-black);
  }
  
  .main-header .logo img {
    height: 60px;
  }
  
  .header-left, .header-right {
    gap: 1.5rem;
  }

  .menu-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    /* Reset mobile animation properties */
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  
  .primary-nav ul {
    flex-direction: row;
    gap: 2rem;
  }

  .primary-nav li {
    position: relative;
  }
  
  .primary-nav li + li {
    border-top: none;
  }
  
  .primary-nav li + li::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 1.2em;
    background-color: var(--color-border);
  }

  .primary-nav a:hover {
    text-decoration: underline;
    background-color: transparent; /* Remove mobile hover effect */
  }

  .social-icons img {
    width: 3rem;
    height: 3rem;
  }

  /* ── Hero Section (Desktop) ─────────────────────────────── */
  .hero {
    background-attachment: fixed;
    height: 35vh;
  }
  
  .hero.hero-contact {
    background-position: center -90px;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content p {
    font-size: 1.5rem;
  }

  /* ── CTA Button (Desktop) ───────────────────────────────── */
  .btn.free-estimate {
    padding: 1rem 5rem;
    font-size: 1.25rem;
  }

  /* ── Services Grid (Desktop) ────────────────────────────── */
  .services-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0 4rem;
  }
  
  /* ── Map (Desktop) ──────────────────────────────────────── */
  #map {
    height: 500px; /* Set a fixed height for the map on larger screens */
    border-radius: 8px;
  }

  .zip-check {
      flex-direction: row;
      justify-content: center;
  }

  /* ── Contact Form (Desktop) ─────────────────────────────── */
  .contact-form {
    max-width: 600px;
  }
  
  .contact-form label {
      text-align: center;
  }

  /* ── Footer (Desktop) ───────────────────────────────────── */
  footer {
    position: relative; 
    z-index: 100;
    margin-top: auto;
  }
}
