/* Enhanced Mobile Styles for Services Section */

/* Ensure visibility fix - This should override any hidden states */
.services, .services-animate, .testimony-section, .carousel-testimony, .testimony-wrap {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

/* Specific fixes for testimonial carousel */
.carousel-testimony .owl-stage,
.carousel-testimony .owl-stage-outer,
.carousel-testimony .owl-item,
.carousel-testimony .item {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

.testimony-section .ftco-animate {
    opacity: 1 !important;
}

/* Global visibility fix - ALL components should be visible in mobile */
.ftco-section,
.ftco-no-pt,
.ftco-no-pb,
.heading-section,
.ftco-animate,
.img,
.desc,
.time-open-wrap,
.opening-hours,
.block-18,
.block-18 .text,
.block-18 .number,
#section-counter,
.ftco-counter,
.counter-wrap {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

/* Additional text visibility fix - ALL text elements */
h1, h2, h3, h4, h5, h6,
p, span, strong, em,
.subheading, .heading,
.pl-3, .name, .position,
.text, .number, .phone {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Specific fix for inline text elements */
span, strong, em, .pl-3 span, .position, .name {
    display: inline !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Counter visibility fixes - Only apply to mobile */
@media (max-width: 767.98px) {
    #section-counter,
    .ftco-counter,
    .counter-wrap,
    .block-18,
    .block-18 .text,
    .block-18 .number {
        opacity: 1 !important;
        display: block !important;
        visibility: visible !important;
    }
}

/* DESKTOP FIX - Override main CSS that forces block display */
@media (min-width: 768px) {
    .ftco-counter .row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
    }

    /* Override the main CSS that forces block display */
    .ftco-counter .block-18 {
        display: inline-block !important;
        width: auto !important;
        text-align: center !important;
        vertical-align: top !important;
    }

    .ftco-counter .col-md-6 {
        flex: 0 0 auto !important;
        max-width: none !important;
        width: auto !important;
        display: inline-block !important;
    }

    .ftco-counter .counter-wrap {
        display: inline-block !important;
        vertical-align: top !important;
    }
}

/* Mobile specific counter styles */
@media (max-width: 767.98px) {
    .ftco-counter {
        padding: 2rem 0 !important;
    }

    .counter-wrap {
        margin-bottom: 2rem !important;
    }

    .block-18 {
        text-align: center !important;
        padding: 1.5rem !important;
        background: white !important;
        border-radius: 1rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        transition: all 0.3s ease !important;
    }

    .block-18:hover {
        transform: translateY(-5px) !important;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    }

    .block-18 .number {
        font-size: 2.5rem !important;
        font-weight: 700 !important;
        color: #213652 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
        line-height: 1 !important;
    }

    .block-18 .text span {
        font-size: 1rem !important;
        color: #64748b !important;
        font-weight: 500 !important;
        line-height: 1.4 !important;
    }
}

/* Small phones counter adjustments */
@media (max-width: 576px) {
    .ftco-counter .row {
        gap: 1rem !important;
    }

    .block-18 {
        padding: 1rem !important;
    }

    .block-18 .number {
        font-size: 2rem !important;
    }

    .block-18 .text span {
        font-size: 0.9rem !important;
    }
}

/* Welcome/About Section Mobile Optimization */
@media (max-width: 767.98px) {
    .ftco-section.ftco-no-pt.ftco-no-pb {
        padding: 3rem 0 !important;
    }

    .img.d-flex.align-items-center.justify-content-center {
        min-height: 400px !important;
        background-size: cover !important;
        background-position: center !important;
        position: relative !important;
    }

    .time-open-wrap {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
        padding: 2rem 1rem 1rem !important;
    }

    .desc {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 1rem !important;
        margin-bottom: 1rem !important;
        padding: 1.5rem !important;
    }

    .desc.bg-secondary {
        background: rgba(33, 54, 82, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 1rem !important;
    }

    .desc h2 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
        color: #213652 !important;
    }

    .desc.bg-secondary h2 {
        color: white !important;
    }

    .desc.bg-secondary h3 {
        color: white !important;
        font-size: 1.125rem !important;
    }

    .opening-hours h4 {
        font-size: 1rem !important;
        color: #213652 !important;
        margin-bottom: 0.5rem !important;
        font-weight: 600 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    .opening-hours p {
        font-size: 0.875rem !important;
        color: #64748b !important;
        line-height: 1.4 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        margin-bottom: 0.75rem !important;
    }

    .opening-hours p span {
        font-size: 0.875rem !important;
        color: #64748b !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        line-height: 1.5 !important;
        margin-bottom: 0.25rem !important;
    }

    .opening-hours p strong {
        color: #213652 !important;
        font-weight: 600 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .phone {
        font-size: 1rem !important;
        color: white !important;
    }

    /* Right side content */
    .col-md-6.pl-md-5.pt-md-5 {
        padding: 2rem 1rem !important;
    }

    .heading-section {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }

    .heading-section .subheading {
        font-size: 0.875rem !important;
        color: #f59e0b !important;
        margin-bottom: 0.5rem !important;
    }

    .heading-section h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        color: #213652 !important;
        margin-bottom: 1.5rem !important;
    }

    .heading-section p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        color: #64748b !important;
        text-align: left !important;
    }
}

/* Small phones adjustments for Welcome/About section */
@media (max-width: 576px) {
    .img.d-flex.align-items-center.justify-content-center {
        min-height: 300px !important;
    }

    .time-open-wrap {
        padding: 1.5rem 0.75rem 0.75rem !important;
    }

    .desc {
        padding: 1rem !important;
    }

    .desc h2 {
        font-size: 1.125rem !important;
    }

    .heading-section h2 {
        font-size: 1.5rem !important;
    }

    .heading-section p {
        font-size: 0.95rem !important;
    }
}

/* Top Banner (Above Navbar) Mobile Optimization - 2 Horizontal Rows Layout */
@media (max-width: 767.98px) {
    .wrap {
        background: linear-gradient(135deg, #213652 0%, #334e68 100%) !important;
        padding: 0.5rem 0.3rem !important;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        z-index: 1000 !important;
    }

    .wrap .container {
        padding: 0 0.75rem !important;
        max-width: 100% !important;
    }

    .wrap .row {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.4rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Row 1: Two phone numbers side by side */
    .wrap .col-12.col-md:first-child {
        display: flex !important;
        gap: 0.4rem !important;
        width: 100% !important;
        margin-bottom: 0.4rem !important;
    }

    .wrap .col-12.col-md:first-child::before {
        content: "+1 (754) 252 4629";
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        padding: 0.35rem 0.5rem !important;
        border-radius: 0.5rem !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        flex: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: 32px !important;
    }

    .wrap .col-12.col-md:first-child::after {
        content: "+1 (631) 640-5773";
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        padding: 0.35rem 0.5rem !important;
        border-radius: 0.5rem !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        flex: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: 32px !important;
    }

    /* Row 2: Email and Instagram side by side */
    .wrap .col-12.col-md:last-child {
        display: flex !important;
        gap: 0.4rem !important;
        width: 100% !important;
    }

    .wrap .col-12.col-md:last-child::before {
        content: "oniixcleaning@gmail.com";
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        padding: 0.35rem 0.5rem !important;
        border-radius: 0.5rem !important;
        font-size: 0.65rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        flex: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: 32px !important;
    }

    /* Instagram item */
    .social-media a {
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        padding: 0.35rem 0.5rem !important;
        border-radius: 0.5rem !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        min-height: 32px !important;
        flex: 1 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .social-media .fa {
        color: #e4405f !important;
        font-size: 1rem !important;
        transition: color 0.3s ease !important;
        flex-shrink: 0 !important;
    }

    /* Hide original content */
    .wrap .phone {
        display: none !important;
    }

    /* Hover effects */
    .wrap .col-12.col-md:first-child::before:hover,
    .wrap .col-12.col-md:first-child::after:hover,
    .wrap .col-12.col-md:last-child::before:hover,
    .social-media a:hover {
        background: rgba(255, 255, 255, 0.25) !important;
        transform: translateY(-1px) !important;
        color: #f59e0b !important;
    }

    .social-media a:hover .fa {
        color: #ff6b86 !important;
    }
}

/* Small phones - Adjust for smaller screens (2 Horizontal Rows) */
@media (max-width: 480px) {
    .wrap {
        padding: 0.4rem 0.25rem !important;
    }

    .wrap .container {
        padding: 0 0.5rem !important;
    }

    .wrap .row {
        gap: 0.3rem !important;
        flex-direction: column !important;
    }

    .wrap .col-12.col-md:first-child,
    .wrap .col-12.col-md:last-child {
        gap: 0.3rem !important;
    }

    .wrap .col-12.col-md:first-child::before,
    .wrap .col-12.col-md:first-child::after,
    .wrap .col-12.col-md:last-child::before,
    .social-media a {
        font-size: 0.6rem !important;
        padding: 0.3rem 0.4rem !important;
        min-height: 30px !important;
        border-radius: 0.4rem !important;
    }

    .social-media .fa {
        font-size: 0.9rem !important;
    }
}

/* Very small phones - Ultra Compact (2 Horizontal Rows) */
@media (max-width: 360px) {
    .wrap {
        padding: 0.35rem 0.2rem !important;
    }

    .wrap .container {
        padding: 0 0.4rem !important;
    }

    .wrap .row {
        gap: 0.25rem !important;
        flex-direction: column !important;
    }

    .wrap .col-12.col-md:first-child,
    .wrap .col-12.col-md:last-child {
        gap: 0.25rem !important;
    }

    .wrap .col-12.col-md:first-child::before,
    .wrap .col-12.col-md:first-child::after,
    .wrap .col-12.col-md:last-child::before,
    .social-media a {
        font-size: 0.55rem !important;
        padding: 0.25rem 0.35rem !important;
        min-height: 28px !important;
        border-radius: 0.35rem !important;
    }

    .social-media .fa {
        font-size: 0.8rem !important;
    }
}

/* Service Cards Mobile Optimization */
@media (max-width: 767.98px) {
    /* Hero Section Mobile Improvements */
    .hero-wrap-2 {
        min-height: 50vh;
        padding: 4rem 0;
    }

    .slider-text {
        align-items: center !important;
        text-align: center;
        padding: 0 1rem;
    }

    .breadcrumbs {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .bread {
        font-size: 2rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    /* Service Cards Grid Mobile */
    .ftco-section.bg-light .row {
        gap: 2rem;
    }

    .services {
        background: white;
        border-radius: 1rem;
        padding: 2rem 1.5rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .services:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

    /* Service Icon Mobile */
    .services .icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, #627d98 0%, #486581 100%);
        border-radius: 50%;
        margin: 0 auto 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: all 0.3s ease;
    }

    .services .icon span {
        font-size: 2rem;
        color: white;
        transition: all 0.3s ease;
    }

    .services:hover .icon {
        transform: scale(1.1);
        background: linear-gradient(135deg, #486581 0%, #334e68 100%);
    }

    /* Service Icon Animation */
    .services .icon::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        z-index: -1;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0% {
            transform: scale(1);
            opacity: 0.8;
        }
        50% {
            transform: scale(1.05);
            opacity: 0.4;
        }
        100% {
            transform: scale(1);
            opacity: 0.8;
        }
    }

    /* Service Content Mobile */
    .services .media-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        text-align: center;
    }

    .services h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        color: #334e68;
        font-weight: 600;
        line-height: 1.3;
    }

    .services p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #64748b;
        margin-bottom: 1rem;
        flex: 1;
    }

    /* Service Tags */
    .service-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        margin-top: 1rem;
    }

    .service-tag {
        background: #f1f5f9;
        color: #64748b;
        padding: 0.25rem 0.75rem;
        border-radius: 1rem;
        font-size: 0.75rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .service-tag:hover {
        background: #e2e8f0;
        color: #475569;
    }

    /* Add service tags to existing services */
    .services::after {
        content: '';
        display: block;
        height: 1px;
        background: #e2e8f0;
        margin: 1rem 0 0 0;
    }
}

/* Small Phones */
@media (max-width: 576px) {
    .hero-wrap-2 {
        min-height: 45vh;
        padding: 3rem 0;
    }

    .bread {
        font-size: 1.75rem;
    }

    .services {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .services .icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 1rem;
    }

    .services .icon span {
        font-size: 1.75rem;
    }

    .services h3 {
        font-size: 1.125rem;
    }

    .services p {
        font-size: 0.9rem;
    }
}

/* Tablet Improvements */
@media (min-width: 577px) and (max-width: 991.98px) {
    .ftco-section.bg-light .row {
        gap: 1.5rem;
    }

    .services {
        padding: 2rem 1.5rem;
    }

    .services .icon {
        width: 90px;
        height: 90px;
    }

    .services h3 {
        font-size: 1.375rem;
    }

    .services p {
        font-size: 1rem;
    }
}

/* Enhanced Service Cards Interactions */
@media (max-width: 767.98px) {
    .service-link {
        display: inline-flex;
        align-items: center;
        color: #627d98;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.875rem;
        margin-top: 0.5rem;
        transition: all 0.3s ease;
        gap: 0.5rem;
    }

    .service-link:hover {
        color: #486581;
        gap: 0.75rem;
    }

    .service-link::after {
        content: '→';
        transition: transform 0.3s ease;
    }

    .service-link:hover::after {
        transform: translateX(2px);
    }
}

/* Contact Section Mobile Improvements */
@media (max-width: 767.98px) {
    .ftco-section:last-child .row {
        gap: 2rem;
    }

    .contact-info {
        text-align: center;
        margin-bottom: 2rem;
        padding: 2rem !important;
    }

    .contact-info h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .contact-info p {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }

    .form-contact {
        padding: 2rem 1.5rem !important;
    }

    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
    }
}

/* Touch-friendly Improvements */
@media (max-width: 767.98px) {
    .services,
    .contact-info,
    .form-contact {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .services:active {
        transform: scale(0.98);
    }
}

/* Loading States for Service Cards */
.services.loading {
    opacity: 0.7;
    pointer-events: none;
}

.services.loading .icon {
    animation: spin 1s linear infinite;
}

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

/* Accessibility Improvements */
@media (max-width: 767.98px) {
    .services:focus-within {
        outline: 2px solid #627d98;
        outline-offset: 2px;
        border-radius: 1rem;
    }

    .service-link:focus {
        outline: 2px solid #627d98;
        outline-offset: 2px;
        border-radius: 0.25rem;
    }
}

/* Animation Classes - Fixed visibility issue */
@media (max-width: 767.98px) {
    .services-animate {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.6s ease;
    }

    .services-animate.animate-in {
        opacity: 1;
        transform: translateY(0);
    }

    /* Only apply animation when page is loaded and JavaScript is ready */
    .services-animate.initial-load {
        opacity: 0;
        transform: translateY(30px);
        animation: fadeInUp 0.6s ease forwards;
    }

    .services-animate.initial-load:nth-child(1) { animation-delay: 0.1s; }
    .services-animate.initial-load:nth-child(2) { animation-delay: 0.2s; }
    .services-animate.initial-load:nth-child(3) { animation-delay: 0.3s; }
    .services-animate.initial-load:nth-child(4) { animation-delay: 0.4s; }
    .services-animate.initial-load:nth-child(5) { animation-delay: 0.5s; }
    .services-animate.initial-load:nth-child(6) { animation-delay: 0.6s; }

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

/* Service Price Display (Optional) */
.service-price {
    display: inline-block;
    background: linear-gradient(135deg, #627d98, #486581);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Service Badge */
.service-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e53e3e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.services .service-badge {
    position: relative;
    top: auto;
    right: auto;
    margin: 1rem auto 0;
}

/* Popular Service Badge */
.popular-service {
    position: relative;
}

.popular-service::before {
    content: 'POPULAR';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}