/*
Tooplate 2117 Infinite Loop
REFACTORED: FINAL FIXES - Fixed Hero Background & Testimonials
*/

@import url("https://fonts.googleapis.com/css?family=Raleway:100,300,400,500,700,900");

/* --- GLOBAL STYLES & OVERFLOW FIXES --- */
body {
    font-family: "Raleway", sans-serif;
    font-size: 1.2em;
    color: #707070;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

html,
body,
section,
.tm-parallax,
.tm-parallax-2 {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* Prevent text zoom on mobile and ensure inputs are readable */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

input,
select,
textarea {
    font-size: 16px !important;
}

a {
    transition: all 0.3s ease;
    color: #38B;
}

a:hover,
a:focus {
    text-decoration: none;
    color: #D40;
}

.tm-section-pad-top {
    padding-top: 80px;
    padding-bottom: 40px;
}

.tm-text-primary {
    color: #37A;
}

.tm-btn-primary {
    color: white;
    background-color: #369;
    padding: 14px 30px;
}

.tm-btn-primary:hover,
.tm-btn-primary:focus {
    color: white;
    background-color: #38B;
}

.tm-icon {
    display: block;
    color: #37A;
}

/* --- NAVBAR --- */
.tm-navbar {
    position: fixed;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    transition: all 0.3s ease;
}

.tm-navbar.scroll {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

/* Navbar Brand/Link Colors */
.tm-navbar .navbar-brand {
    color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
}

.tm-navbar .nav-link {
    color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
}

.tm-navbar.scroll .navbar-brand {
    color: #369 !important;
}

.tm-navbar.scroll .nav-link {
    color: #369 !important;
}

.tm-navbar.scroll .nav-link.current,
.tm-navbar.scroll .nav-link.active {
    color: #fff !important;
    background: #369 !important;
    border-radius: 4px;
}

.tm-navbar .nav-link:hover,
.tm-navbar.scroll .nav-link:hover {
    color: #369 !important;
    background: none !important;
    text-decoration: none !important;
}

/* --- HERO SECTION --- */
#infinite {
    background-color: #222;
    background-image: url(../img/infinite-loop-01.jpg);
    background-repeat: no-repeat;
    height: 100vh;
    min-height: 375px;
    position: center;
    background-size: cover;
    background-position: center center;
}

.tm-hero-title {
    font-size: 3.5rem;
    text-shadow: 2px 2px 2px #333;
}

/* --- TESTIMONIALS FIX (REQUIRED) --- */
#testimonials {
    color: white;
    background-image: url(../img/infinite-loop-02.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: scroll;
    position: relative;
    z-index: 1;
    padding-top: 80px;
    padding-bottom: 60px;
}


.tm-bg-overlay {
    background-color: rgba(0, 0, 0, 0.65);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.tm-testimonials-content {
    position: relative;
    z-index: 2;
}

.tm-testimonial-item blockquote {
    color: #fff !important;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0 auto 20px auto;
    padding: 20px;
    font-weight: 400;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.tm-testimonial-item figcaption {
    color: #fff !important;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    margin-top: 10px;
}

/* --- GALLERY FIX (REQUIRED) --- */
.tm-gallery-container {
    padding-top: 70px;
    padding-bottom: 120px;
    width: 100%;
    max-width: 100%;
}

.tm-gallery .slick-slide {
    margin: 0 10px;
    outline: none;
}

.tm-gallery .slick-list {
    margin: 0 -10px;
}

.tm-gallery .slick-slide img,
.tm-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
    max-width: 100%;
    display: block;
}

.tm-gallery .slick-prev,
.tm-gallery .slick-next {
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(51, 102, 153, 0.8);
    border-radius: 50%;
}

/* Hide gallery image titles/captions */
.tm-gallery-item figcaption {
    display: none;
}

/* CRITICAL FIXES FOR SLICK CAROUSEL VISIBILITY/HEIGHT COLLAPSE */
.slick-list,
.slick-track {
    min-height: 250px;
}

.tm-gallery.slick-initialized .slick-slide {
    display: inline-block !important;
    float: none !important;
    height: auto;
}

.tm-testimonials-carousel.slick-initialized .slick-slide {
    display: block !important;
    float: none !important;
    height: auto;
}

.tm-gallery-item img {
    opacity: 1 !important;
}

/* --- CONTACT --- */
#contact {
    color: white;
    background-image: url(../img/infinite-loop-03.jpg);
    background-size: cover;
    background-attachment: fixed;
}

.tm-input {
    margin: 0 0 20px 0;
    width: 90%;
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid white;
    background: transparent;
    color: white;
}

.tm-btn-submit {
    width: 50%;
}

.tm-footer {
    position: relative;
    bottom: auto;
    left: 0;
    right: 0;
    padding: 0 15px;
    margin-top: 50px;
}

/* ========================================================= */
/* FINAL MOBILE OPTIMIZATION (<= 767px)                      */
/* ========================================================= */
@media (max-width: 767px) {

    /* Base Layout Reset */
    .container,
    .tm-container-gallery,
    .tm-container-contact,
    .tm-testimonials-content {
        padding-left: 15px;
        padding-right: 15px;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    [class*="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Body and overflow fixes */
    body {
        font-size: 1rem;
    }

    /* Navbar Mobile Optimization */
    .tm-navbar {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    .navbar-brand {
        font-size: 1rem !important;
        padding: 5px 0;
        max-width: calc(100% - 60px);
        color: white !important;
    }

    .tm-navbar.scroll .navbar-brand {
        color: #369 !important;
    }

    .navbar-toggler {
        position: absolute;
        right: 15px;
        top: 12px;
        z-index: 1000;
        border-color: rgba(255, 255, 255, 0.5);
        padding: 5px 8px;
    }

    .tm-navbar.scroll .navbar-toggler {
        border-color: #369;
    }

    /* Navbar collapse menu */
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98);
        padding: 20px 15px;
        margin-top: 10px;
        border-radius: 5px;
    }

    .navbar-collapse .nav-link {
        color: #369 !important;
    }

    /* Hero Section Mobile Optimization */
    #infinite {
        min-height: 100vh;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-attachment: scroll !important;
    }

    .tm-hero-text-container {
        padding: 20px 15px;
        margin-top: 60px;
    }

    .tm-hero-text-container-inner {
        text-align: center;
        max-width: 100%;
        margin: 0 auto;
        padding: 20px 10px;
    }

    .tm-hero-title {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 15px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }

    .tm-hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
        padding: 0 10px;
    }

    /* Down arrow positioning */
    .tm-intro-next {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);

    }

    /* Section titles and descriptions */
    .tm-section-title {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
        line-height: 1.3;
    }

    .tm-section-desc {
        font-size: 0.95rem !important;
        line-height: 1.6;
        padding: 0 10px;
        margin-bottom: 30px;
    }

    /* WHAT WE DO SECTION - Complete Mobile Optimization */
    #whatwedo {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }

    #whatwedo .tm-intro-text {
        font-size: 0.95rem !important;
        line-height: 1.6;
    }

    #whatwedo .tm-content-box {
        margin-bottom: 30px;
    }

    #whatwedo .tm-content-box [class*="col-lg-"],
    #whatwedo .tm-content-box [class*="col-md-"] {
        width: 100%;
        float: none;
        padding-left: 15px;
        padding-right: 15px;
        margin-left: 0;
        margin-right: 0;
    }

    /* Center icons and add proper spacing */
    #whatwedo .tm-content-box .col-lg-1 {
        text-align: center;
        margin-bottom: 15px;
        padding-top: 20px;
        width: 100%;
    }

    #whatwedo .tm-icon {
        font-size: 2.5rem !important;
        margin-bottom: 10px;
    }

    /* Add vertical space between service blocks */
    #whatwedo .tm-content-box .row:not(:first-child) {
        margin-top: 40px;
        padding-top: 30px;
        border-top: 1px solid #e0e0e0;
    }

    /* TESTIMONIALS SECTION - Enhanced for Mobile */
    #testimonials {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
        min-height: auto !important;
        background-attachment: scroll !important;
        overflow: hidden;
    }

    .tm-testimonials-content {
        padding: 20px 15px 30px 15px;
        position: relative !important;
        z-index: 60 !important;
    }

    .tm-testimonials-carousel {
        margin-top: 20px;
        padding-bottom: 40px;
    }

    .tm-testimonial-item {
        padding: 15px 10px;
    }

    .tm-testimonial-item blockquote {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        padding: 15px !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        background-color: rgba(0, 0, 0, 0.6) !important;
        border-radius: 10px;
        margin-bottom: 15px !important;
        color: #ffffff !important;
        font-weight: 400;
        max-height: none !important;
        display: block !important;
    }

    .tm-testimonial-item figcaption {
        font-size: 1rem !important;
        margin-top: 10px;
        font-weight: 700 !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        color: #ffffff !important;
    }

    /* Make testimonial dots more visible */
    .tm-testimonials-carousel .slick-dots {
        bottom: 10px;
        position: absolute;
    }

    .tm-testimonials-carousel .slick-dots li {
        margin: 0 5px;
    }

    .tm-testimonials-carousel .slick-dots li button:before {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.6);
        opacity: 1;
    }

    .tm-testimonials-carousel .slick-dots li.slick-active button:before {
        color: white;
        opacity: 1;
    }

    /* Ensure testimonial section overlay is visible */
    #testimonials .tm-bg-overlay {
        z-index: 2;
        /* below the content */
        pointer-events: none;
        /* allow interactions to pass through */
        opacity: 0.45;
    }

    #testimonials .container {
        position: relative;
        z-index: 2;
    }

    /* GALLERY SECTION - Complete Mobile Optimization */
    .tm-section-pad-top {
        padding-top: 50px !important;
        padding-bottom: 40px !important;
    }

    .tm-gallery-container {
        padding-top: 40px !important;
        padding-bottom: 60px !important;
    }

    /* Gallery images - Show full image without cropping */
    .tm-gallery .slick-slide img,
    .tm-gallery-item img {
        height: auto !important;
        min-height: 200px;
        max-height: 300px;
        object-fit: contain !important;
        background-color: #f5f5f5;
        border-radius: 8px;
        width: 100% !important;
        padding: 5px;
    }

    /* Gallery item spacing */
    .tm-gallery .slick-slide {
        padding: 0 5px;
    }

    .tm-gallery .slick-list {
        margin: 0 -5px;
    }

    /* Gallery arrows for mobile */
    .tm-gallery .slick-prev,
    .tm-gallery .slick-next {
        width: 35px !important;
        height: 35px !important;
    }

    .tm-gallery .slick-prev {
        left: 5px !important;
    }

    .tm-gallery .slick-next {
        right: 5px !important;
    }

    /* CONTACT SECTION - Mobile Optimization */
    #contact {
        padding-top: 60px !important;
        padding-bottom: 80px !important;
    }

    .tm-container-contact {
        padding: 30px 15px;
    }

    .contact-item {
        margin-left: 0;
        margin-bottom: 25px;
        text-align: left;
        padding: 10px 0;
    }

    .contact-item a {
        display: flex;
        align-items: center;
        word-break: break-word;
    }

    .contact-item i {
        flex-shrink: 0;
        margin-right: 15px !important;
    }

    .contact-item span {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Form inputs */
    .tm-input {
        width: 100% !important;
        margin-bottom: 15px !important;
        padding: 12px 15px !important;
        font-size: 1rem !important;
    }

    .tm-btn-submit {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        margin-top: 10px;
    }

    /* Footer */
    .tm-footer {
        position: relative;
        bottom: auto;
        padding: 20px 15px;
        text-align: center;
        margin-top: 40px;
        font-size: 0.85rem;
    }

    .tm-footer p {
        line-height: 1.6;
        margin-bottom: 0;
    }
}

/* Testimonials Carousel Styling */
.tm-testimonials-carousel {
    background: transparent;
}

.tm-testimonial-item {
    padding: 40px 20px;
    text-align: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

.tm-testimonial-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tm-testimonial-text {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    font-style: italic;
}

.tm-testimonial-author {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin: 0;
}

/* Slick dots styling */
.tm-testimonials-carousel .slick-dots {
    bottom: -40px;
}

.tm-testimonials-carousel .slick-dots li button:before {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.tm-testimonials-carousel .slick-dots li.slick-active button:before {
    color: #fff;
}

/* ===============================
   HERO CENTERING (without moving navbar)
   =============================== */

/* NAVBAR must remain fixed at the top */
.tm-navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* HERO SECTION: push down by navbar height */
#infinite {
    position: relative;
    min-height: calc(100vh - 70px);
    /* adjust if navbar is taller */
    padding-top: 70px;
    /* ensures hero starts below navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* HERO CONTENT: perfect center */
.tm-hero-text-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 5;
}

/* Title + subtitle responsive */
.tm-hero-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.tm-hero-subtitle {
    font-size: clamp(1rem, 1.1vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Keep down arrow at bottom */
.tm-intro-next {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
}


/* ===== Testimonials: center slides & keep visible after swipe ===== */

/* allow carousel to overflow so slides don't get clipped while animating */
.tm-testimonials-carousel .slick-list {
    overflow: visible !important;
    z-index: 5;
}

/* make each slick slide a centered flex container so slide content is centered horizontally */
.tm-testimonials-carousel .slick-slide {
    display: flex !important;
    justify-content: center;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    /* avoid creating new stacking contexts */
    -webkit-transform: none !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    will-change: auto !important;
    box-sizing: border-box;
    padding: 18px 0;
    /* spacing above/below slides */
}

/* limit the width of the testimonial card and center it */
.tm-testimonial-content {
    position: relative !important;
    z-index: 10 !important;
    width: min(760px, 92%);
    max-width: 760px;
    margin: 0 auto;
    background: rgba(10, 10, 10, 0.55);
    /* darker translucent card on top of blurred bg */
    border-radius: 10px;
    padding: 22px 24px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* typography inside card */
.tm-testimonial-text {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 12px 0;
    font-style: normal;
}

/* author line */
.tm-testimonial-author {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    margin: 0;
    text-align: left;
}

/* place arrows & dots above background */
.tm-testimonials-carousel .slick-prev,
.tm-testimonials-carousel .slick-next,
.tm-testimonials-carousel .slick-dots {
    z-index: 20 !important;
}

/* ensure prev/next are vertically centered and not clipped */
.tm-testimonials-carousel .slick-prev,
.tm-testimonials-carousel .slick-next {
    top: 50%;
    transform: translateY(-50%);
}

/* mobile adjustments */
@media (max-width: 767px) {
    .tm-testimonial-content {
        width: calc(100% - 40px);
        padding: 16px;
        min-height: auto;
    }

    .tm-testimonial-text {
        font-size: 0.95rem;
    }

    .tm-testimonial-author {
        text-align: center;
    }

    .tm-testimonials-carousel .slick-prev,
    .tm-testimonials-carousel .slick-next {
        display: none;
    }
}

/* ---------- Slick carousel fixes (testimonial) ---------- */

/* Make the track a flex row so slides remain visible and centered
   — DO NOT force transform: none; Slick needs transforms to move slides */
.tm-testimonials-carousel .slick-track {
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* keep backface settings but allow transforms */
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    will-change: transform;
}

/* Let slides be stable and centered — do NOT override transform on slides */
.tm-testimonials-carousel .slick-slide {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin: 0 12px;
    /* spacing between slides */
    display: block !important;
    float: none !important;
    box-sizing: border-box;
    padding: 0 !important;
}

/* Ensure active slide card sits above everything */
.tm-testimonials-carousel .slick-current .tm-testimonial-content {
    z-index: 120 !important;
}

/* Keep non-current slides visually present but lower */
.tm-testimonials-carousel .slick-slide .tm-testimonial-content {
    z-index: 10;
    transition: box-shadow .25s ease, transform .25s ease, opacity .25s ease;
}

/* Prevent the overlay/background from occluding cards */
#testimonials .tm-bg-overlay {
    pointer-events: none !important;
}

/* For browsers that aggressively flatten layers, keep the testimonial area GPU-accelerated */
.tm-testimonials-content,
.tm-testimonials-carousel {
    transform: translateZ(0);
}

/* --- Force only the current testimonial to be visible --- */
/* Allow Slick to move the track (use block so transform: translateX works) */
.tm-testimonials-carousel .slick-track {
    overflow: visible !important;
}

/* Hide non-current slides */
.tm-testimonials-carousel .slick-slide:not(.slick-current) {
    opacity: 0.3 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0.95) !important;
    /* slight shrink for non-current slides */
}

/* Show only the current slide */
.tm-testimonials-carousel .slick-current {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* keep arrows and dots usable above slides */
.tm-testimonials-carousel .slick-prev,
.tm-testimonials-carousel .slick-next,
.tm-testimonials-carousel .slick-dots {
    z-index: 50 !important;
}