/* ========================================
   Brightwire Electric — Global Components
   Header, Footer, Nav, Sticky CTA, Buttons, Animations
   ======================================== */

/* ----------------------------------------
   Buttons
   ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.35);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.45);
}

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

.btn-secondary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

.btn-white {
  background: var(--color-white);
  color: var(--color-navy);
}

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

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* ----------------------------------------
   Header / Navigation
   ---------------------------------------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition);
}

.header.transparent {
  background: transparent;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 10px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-logo img {
  height: 80px;
  width: auto;
  transition: all var(--transition);
}

.header.transparent .header-logo img {
  filter: brightness(0) invert(1);
}

.header.scrolled .header-logo img {
  height: 54px;
}

/* Desktop Nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.header.transparent .nav-link {
  color: var(--color-white);
}

.header.transparent .nav-link:hover,
.header.transparent .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-white);
}

.header.scrolled .nav-link {
  color: var(--color-text);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

.header.transparent .header-phone {
  color: var(--color-white);
}

.header.scrolled .header-phone {
  color: var(--color-navy);
}

.header-cta {
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--color-accent);
  color: var(--color-white);
  transition: all var(--transition);
}

.header-cta:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  transition: all var(--transition);
}

.header.transparent .hamburger span {
  background: var(--color-white);
}

.header.scrolled .hamburger span {
  background: var(--color-navy);
}

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

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

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

/* Mobile Nav Drawer */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-mobile-overlay.active {
  opacity: 1;
}

.nav-mobile {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--color-white);
  z-index: 999;
  padding: 80px 24px 24px;
  transition: right var(--transition);
  overflow-y: auto;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
}

.nav-mobile.active {
  right: 0;
}

.nav-mobile-link {
  display: block;
  padding: 16px 0;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition);
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  color: var(--color-primary);
}

.nav-mobile-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-navy);
}

.nav-mobile-cta {
  display: block;
  margin-top: 16px;
  text-align: center;
}

/* ----------------------------------------
   Sticky Bottom CTA (Mobile Only)
   ---------------------------------------- */

.sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background: var(--color-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    transform: translateY(100%);
    transition: transform var(--transition);
  }

  .sticky-cta.visible {
    transform: translateY(0);
  }

  .sticky-cta-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
  }

  .sticky-cta-call {
    background: var(--color-navy);
    color: var(--color-white);
  }

  .sticky-cta-quote {
    background: var(--color-accent);
    color: var(--color-white);
  }

  body {
    padding-bottom: 70px;
  }
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */

.footer {
  background: var(--color-navy-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.65);
}

.footer-logo {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer h4 {
  color: var(--color-white);
  font-size: 1rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links a {
  display: block;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
}

.footer-contact-item i {
  color: var(--color-accent);
  margin-top: 3px;
  width: 16px;
  flex-shrink: 0;
}

.footer-contact-item a {
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--transition);
}

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

.footer-bottom {
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom-right {
  display: flex;
  gap: 20px;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .footer {
    padding: 40px 0 0;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ----------------------------------------
   Breadcrumbs
   ---------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--color-white);
}

.breadcrumb span {
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb .current {
  color: var(--color-white);
}

/* ----------------------------------------
   Section Headers
   ---------------------------------------- */

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  margin-bottom: 10px;
}

/* ----------------------------------------
   Inner Page Hero
   ---------------------------------------- */

.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary-dark) 100%);
  overflow: hidden;
  padding-top: 80px;
}

.page-hero-40 {
  min-height: 40vh;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: 16px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  max-width: 600px;
}

/* ----------------------------------------
   Bottom CTA Section
   ---------------------------------------- */

.cta-section {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary-dark) 60%, var(--color-primary) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  color: var(--color-white);
  margin-bottom: 16px;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px;
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ----------------------------------------
   Shared Form States
   ---------------------------------------- */

.form-success {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.form-success.active {
  display: block;
}

.form-error {
  display: none;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: var(--color-error);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.form-error.active {
  display: block;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------
   Scroll Animations
   ---------------------------------------- */

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for card grids */
.fade-up.delay-1 { transition-delay: 0.1s; }
.fade-up.delay-2 { transition-delay: 0.2s; }
.fade-up.delay-3 { transition-delay: 0.3s; }
.fade-up.delay-4 { transition-delay: 0.4s; }
.fade-up.delay-5 { transition-delay: 0.5s; }
.fade-up.delay-6 { transition-delay: 0.6s; }

/* ----------------------------------------
   Responsive Helpers
   ---------------------------------------- */

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .hamburger {
    display: flex;
  }

  .nav-desktop {
    display: none;
  }

  .header-phone {
    display: none;
  }

  .header-cta {
    display: none;
  }
}

@media (max-width: 480px) {
  .btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
  }
}
