/* =========================================================
   Up & Down Garage Doors — Design Enhancements v1.0.5
   ========================================================= */

/* ── Global ── */
html {
  scroll-behavior: smooth;
}

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

/* ── Sticky smart header ── */
header.wp-block-template-part {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100% !important;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform;
}

/* Hide header when scrolling down */
header.wp-block-template-part.ud-header-hidden {
  transform: translateY(-100%);
  box-shadow: none;
}

/* Scrolled state: slightly more opaque */
header.wp-block-template-part.ud-scrolled {
  background: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 3px 30px rgba(0, 0, 0, 0.12);
}

/* Push body content below fixed header */
body {
  padding-top: var(--ud-header-h, 80px) !important;
  transition: padding-top 0.2s ease;
}

/* ── Logo ── */
.wp-block-site-logo {
  display: flex !important;
  align-items: center;
}

.wp-block-site-logo img,
.wp-block-site-logo a img {
  max-height: 64px !important;
  width: auto !important;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.wp-block-site-logo a:hover img {
  opacity: 0.85;
  transform: scale(1.03);
}

/* ── Navigation ── */
.wp-block-navigation__container a,
.wp-block-navigation .wp-block-navigation-item__content {
  position: relative;
  text-decoration: none !important;
  transition: color 0.25s ease !important;
  font-weight: 500;
}

.wp-block-navigation__container a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #e63946;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wp-block-navigation__container a:hover::after,
.wp-block-navigation__container a:focus::after {
  width: 100%;
}

.wp-block-navigation__container a:hover {
  color: #e63946 !important;
}

/* ── CTA buttons ── */
.cta-button.primary,
a.cta-button.primary {
  background: #e63946 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease !important;
  animation: ud-pulse 2.4s ease infinite;
}

.cta-button.primary:hover,
a.cta-button.primary:hover {
  background: #c1121f !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.45) !important;
  animation: none;
}

.cta-button.secondary,
a.cta-button.secondary {
  border-radius: 8px !important;
  font-weight: 600 !important;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease !important;
}

.cta-button.secondary:hover,
a.cta-button.secondary:hover {
  background: rgba(255,255,255,0.2) !important;
  transform: translateY(-2px) !important;
}

@keyframes ud-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3); }
  50%       { box-shadow: 0 4px 28px rgba(230, 57, 70, 0.55); }
}

/* ── UAGB buttons ── */
.uagb-buttons-repeater,
.wp-block-button__link {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.uagb-buttons-repeater:hover,
.wp-block-button__link:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18) !important;
}

/* ── Service cards ── */
.wp-block-uagb-container:not(.uagb-is-root-container) {
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.32s ease !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.wp-block-uagb-container:not(.uagb-is-root-container):hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18) !important;
}

/* ── Info boxes ── */
.wp-block-uagb-info-box {
  transition: transform 0.28s ease !important;
}

.wp-block-uagb-info-box:hover {
  transform: translateY(-4px) !important;
}

/* ── Counters ── */
.wp-block-uagb-counter {
  transition: transform 0.3s ease !important;
}

.wp-block-uagb-counter:hover {
  transform: scale(1.04) !important;
}

/* ── Scroll-triggered fade-in animations ── */
.ud-animate {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.ud-animate.ud-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for child groups */
.ud-animate-group > *:nth-child(1) { transition-delay: 0s; }
.ud-animate-group > *:nth-child(2) { transition-delay: 0.1s; }
.ud-animate-group > *:nth-child(3) { transition-delay: 0.2s; }
.ud-animate-group > *:nth-child(4) { transition-delay: 0.3s; }

/* ── Hero section improvements ── */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.2) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: ud-hero-in 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes ud-hero-in {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: none; }
}

.hero-section h1 {
  text-shadow: 0 2px 12px rgba(0,0,0,0.6) !important;
}

/* ── Footer ── */
footer.wp-block-template-part {
  transition: none;
  position: static !important;
  border-top: 3px solid #e63946;
}

/* ── Internal links ── */
.wp-block-navigation .wp-block-navigation-item a,
.uagb-infobox-cta-link,
.uagb-buttons-repeater {
  transition: color 0.22s ease, opacity 0.22s ease !important;
}

/* ── Phone / email links ── */
a[href^="tel:"],
a[href^="mailto:"] {
  font-weight: 600;
  transition: color 0.2s ease, text-shadow 0.2s ease !important;
}

a[href^="tel:"]:hover,
a[href^="mailto:"]:hover {
  color: #e63946 !important;
  text-shadow: 0 0 8px rgba(230,57,70,0.25);
}

/* ── Scroll-to-top button ── */
#ud-scroll-top {
  position: fixed;
  bottom: 32px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 9000;
  box-shadow: 0 4px 16px rgba(230,57,70,0.4);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
}

#ud-scroll-top.ud-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#ud-scroll-top:hover {
  background: #c1121f;
  transform: translateY(-2px);
}

/* ── Mobile header ── */
@media (max-width: 768px) {
  body {
    padding-top: var(--ud-header-h, 64px) !important;
  }

  header.wp-block-template-part {
    padding: 0 !important;
  }

  .hero-section {
    min-height: 60vh !important;
  }
}

/* ── Smooth image loading ── */
img {
  transition: opacity 0.4s ease;
}

img.loading {
  opacity: 0;
}

/* ── Focus visible (accessibility) ── */
:focus-visible {
  outline: 3px solid #e63946;
  outline-offset: 3px;
  border-radius: 3px;
}
