/* =========================================================
   BuildBay Hero — cinematic full-bleed construction banner
   Palette: navy #0f172a · terracotta #c0532f · white
   ========================================================= */

/* ---------- Base ---------- */
.bb-slideshow {
    position: relative;
    width: 100%;
    height: var(--bb-height, calc(100vh - 140px));
    min-height: 480px;
    max-height: 820px;
    overflow: hidden;
    background: #0f172a;
    isolation: isolate;
}

.bb-slideshow .swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Smooth, professional crossfade easing (overrides Swiper's default linear opacity transition) */
.bb-slideshow.swiper-fade .swiper-slide {
    transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Full-bleed media ---------- */
.bb-slide-media-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    will-change: transform;
}

.bb-slide-media {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    transform: scale(1);
}

/* Subtle continuous Ken Burns on every slide */
.swiper-slide-active .bb-slide-media {
    animation: bbKenBurnsSoft 9s ease-out forwards;
}
@keyframes bbKenBurnsSoft {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}
.bb-anim-zoom.swiper-slide-active .bb-slide-media {
    animation-name: bbKenBurnsStrong;
    animation-duration: 12s;
}
@keyframes bbKenBurnsStrong {
    from { transform: scale(1); }
    to   { transform: scale(1.22); }
}

/* Cinematic gradient overlay — guarantees text contrast without hiding the footage */
.bb-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(9, 14, 27, 0.96) 0%, rgba(9, 14, 27, 0.62) 32%, rgba(9, 14, 27, 0.22) 58%, rgba(9, 14, 27, 0.4) 100%),
        linear-gradient(to right, rgba(9, 14, 27, 0.55) 0%, rgba(9, 14, 27, 0.05) 42%, rgba(9, 14, 27, 0) 70%),
        radial-gradient(120% 90% at 85% 15%, rgba(192, 83, 47, 0.14), transparent 60%);
}

/* Faint blueprint grid texture over the footage — subtle engineering motif */
.bb-hero-blueprint-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
    mix-blend-mode: overlay;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0px, rgba(255, 255, 255, 0.5) 1px, transparent 1px, transparent 64px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0px, rgba(255, 255, 255, 0.5) 1px, transparent 1px, transparent 64px);
}

/* ---------- Floating blueprint-inspired accents ---------- */
.bb-hero-shapes {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.bb-shape {
    position: absolute;
    color: rgba(255, 255, 255, 0.28);
}
.bb-shape-corner {
    width: 64px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.bb-shape-corner-tl {
    top: 8%;
    left: 5%;
    border-width: 1px 0 0 1px;
    animation: bbFloatSlow 8s ease-in-out infinite;
}
.bb-shape-corner-br {
    bottom: 16%;
    right: 6%;
    border-width: 0 1px 1px 0;
    animation: bbFloatSlow 8s ease-in-out infinite;
    animation-delay: 1.2s;
}
.bb-shape-plus {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 300;
    animation: bbFloatSlow 7s ease-in-out infinite;
}
.bb-shape-plus-1 { top: 22%; right: 12%; animation-delay: 0.4s; }
.bb-shape-plus-2 { bottom: 30%; left: 9%; font-size: 1.1rem; animation-delay: 2s; }
.bb-shape-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px dashed rgba(192, 83, 47, 0.35);
    top: 12%;
    right: 18%;
    animation: bbSpinSlow 60s linear infinite;
}
.bb-shape-dashline {
    width: 1px;
    height: 90px;
    top: 40%;
    left: 3.5%;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.35) 0 6px, transparent 6px 12px);
    animation: bbFloatSlow 9s ease-in-out infinite;
    animation-delay: 0.8s;
}

@keyframes bbFloatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-14px) rotate(2deg); }
}
@keyframes bbSpinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Hero content block (bottom-left overlay) ---------- */
.bb-hero-content {
    position: absolute;
    z-index: 3;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 6%;
    width: 60%;
}

.bb-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(14px);
    animation: bbFadeUp 0.6s ease forwards;
    animation-play-state: paused;
}

.bb-hero-credential {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid rgba(192, 83, 47, 0.55);
    border-radius: 999px;
    background: rgba(192, 83, 47, 0.12);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}
.bb-eyebrow-line {
    width: 32px;
    height: 1px;
    background: #c0532f;
    flex-shrink: 0;
}
.bb-eyebrow-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(192, 83, 47, 0.9);
    font-size: 0.55rem;
    flex-shrink: 0;
}
.swiper-slide-active .bb-hero-eyebrow {
    animation-play-state: running;
}

/* ---------- Kinetic headline ---------- */
.bb-hero-headline {
    font-family: var(--global-heading-font-family, 'Montserrat', sans-serif);
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.01em;
    margin: 0 0 0.85rem;
    color: #ffffff !important;
}

.bb-word-mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.18em;
    margin-bottom: -0.18em;
}

.bb-word {
    display: inline-block;
    color: #ffffff !important;
    transform: translateY(115%);
    animation: bbWordUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-play-state: paused;
}
.swiper-slide-active .bb-word {
    animation-play-state: running;
}
@keyframes bbWordUp {
    to { transform: translateY(0); }
}

.bb-hero-subtitle {
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.6;
    max-width: 46ch;
    margin: 0 0 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    opacity: 0;
    transform: translateY(16px);
    animation: bbFadeUp 0.7s ease forwards;
    animation-delay: 0.45s;
    animation-play-state: paused;
}
.swiper-slide-active .bb-hero-subtitle {
    animation-play-state: running;
}

@keyframes bbFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- CTA buttons ---------- */
.bb-slide-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 1.1rem;
    opacity: 0;
    transform: translateY(16px);
    animation: bbFadeUp 0.7s ease forwards;
    animation-delay: 0.65s;
    animation-play-state: paused;
}
.swiper-slide-active .bb-slide-buttons {
    animation-play-state: running;
}

.bb-slide-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1.7rem;
    background: #c0532f;
    color: #ffffff;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
    border: 1px solid #c0532f;
    box-shadow: 0 8px 24px rgba(192, 83, 47, 0.25);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.bb-btn-arrow {
    font-style: normal;
    transition: transform 0.25s ease;
}

.bb-slide-btn:hover {
    background: #a2431f;
    border-color: #a2431f;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(192, 83, 47, 0.35);
}
.bb-slide-btn:hover .bb-btn-arrow {
    transform: translateX(4px);
}

.bb-slide-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: none;
}
.bb-slide-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
}

/* ---------- Animated stats row ---------- */
.bb-hero-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    opacity: 0;
    transform: translateY(18px);
    animation: bbFadeUp 0.7s ease forwards;
    animation-delay: 0.85s;
    animation-play-state: paused;
}
.swiper-slide-active .bb-hero-stats {
    animation-play-state: running;
}
.bb-hero-stat {
    display: flex;
    flex-direction: column;
}
.bb-hero-stat-number {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}
.bb-hero-stat-label {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.bb-hero-stat-divider {
    width: 1px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* ---------- Slide counter (top-left) ---------- */
.bb-slide-counter {
    position: absolute;
    left: 6%;
    top: 6%;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 16px;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.bb-slide-counter-divider {
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
}
.bb-slide-counter-total {
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- Autoplay progress bar ---------- */
.bb-progress-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 6;
}
.bb-progress-bar {
    height: 100%;
    width: 0%;
    background: #c0532f;
    transition: width 6000ms linear;
}

/* ---------- Bottom navigation bar: prev arrow · pagination dots · next arrow ---------- */
.bb-bottom-nav {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 6%;
    top: auto;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 20px;
}

.bb-bottom-nav .swiper-button-next,
.bb-bottom-nav .swiper-button-prev {
    position: static;
    margin: 0;
    top: auto;
    left: auto;
    right: auto;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    backdrop-filter: none;
    width: 22px;
    height: 22px;
    border-radius: 0;
    transition: color 0.3s ease, transform 0.3s ease;
}
.bb-bottom-nav .swiper-button-next:after,
.bb-bottom-nav .swiper-button-prev:after {
    font-size: 15px;
    font-weight: 700;
}
.bb-bottom-nav:hover .swiper-button-next,
.bb-bottom-nav:hover .swiper-button-prev {
    color: rgba(255, 255, 255, 0.75);
}
.bb-bottom-nav .swiper-button-next:hover,
.bb-bottom-nav .swiper-button-prev:hover {
    color: #c0532f;
    transform: scale(1.15);
}
.bb-bottom-nav .swiper-button-next.swiper-button-disabled,
.bb-bottom-nav .swiper-button-prev.swiper-button-disabled {
    opacity: 0.3;
}

.bb-bottom-nav .swiper-pagination {
    position: relative;
    width: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}
.bb-bottom-nav .swiper-pagination-bullet {
    position: relative;
    z-index: 1;
    margin: 0;
    background: rgba(255, 255, 255, 0.65);
    opacity: 1;
    border-radius: 1px;
    width: 16px;
    height: 3px;
    transition: background 0.25s ease, width 0.25s ease;
}
.bb-bottom-nav .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.9);
}
.bb-bottom-nav .swiper-pagination-bullet-active {
    background: #c0532f;
    width: 30px;
}
.bb-bottom-nav .swiper-pagination-bullet::before {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 14px);
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.92);
    padding: 6px 12px;
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bb-bottom-nav .swiper-pagination-bullet:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Inline quick-quote form — glassmorphism card ---------- */
.bb-quick-quote {
    margin-top: 1.4rem;
    padding: 1.4rem;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.bb-quick-quote-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bb-quick-quote-form input[type="text"],
.bb-quick-quote-form input[type="tel"] {
    width: 100%;
    padding: 0.6rem 0.1rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #ffffff;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.bb-quick-quote-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.bb-quick-quote-form input:focus {
    outline: none;
    border-bottom-color: #c0532f;
    background: transparent;
}

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

.bb-quick-quote-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bb-quote-cancel {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.bb-quote-cancel:hover {
    color: #ffffff;
}

.bb-quick-quote-success {
    color: #86efac;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}
.bb-quick-quote-error {
    color: #fca5a5;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.bb-quote-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .bb-slideshow {
        height: var(--bb-height, calc(100svh - 90px));
        min-height: 520px;
    }
    .bb-hero-content {
        width: 100%;
        padding: 0 6%;
    }
    .bb-shape-ring,
    .bb-shape-dashline {
        display: none;
    }
}

@media (max-width: 768px) {
    .bb-slide-counter {
        display: none;
    }
    .bb-hero-stats {
        gap: 1.1rem;
    }
    .bb-bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        bottom: 4%;
    }
    .bb-quick-quote {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .bb-hero-headline {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .bb-slide-media,
    .bb-shape,
    .bb-word,
    .bb-hero-eyebrow,
    .bb-hero-subtitle,
    .bb-slide-buttons,
    .bb-hero-stats {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
