/* ============================================== */
/* HOME SOLUTIONS NC LLC - Custom Styles          */
/* styles.css                                      */
/* ============================================== */

/* ============================================== */
/* 1. BASE STYLES & RESETS                        */
/* ============================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    max-width: 100%;
}

/* Remove default margin/padding and set box-sizing */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body base styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    /* Match hero background so no white line shows at top */
    background-color: #303643;
}

/* Reset background to white after hero (main content area) */
main {
    background-color: #ffffff;
}

/* Remove default focus outline and add custom */
*:focus-visible {
    outline: 2px solid #50a8e5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Selection color */
::selection {
    background-color: #50a8e5;
    color: #ffffff;
}

::-moz-selection {
    background-color: #50a8e5;
    color: #ffffff;
}


/* ============================================== */
/* 2. NAVBAR STYLES                               */
/* ============================================== */

/* Navbar transparent state (initial) */
#navbar {
    background-color: transparent;
    transition: background-color 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}

/* Hamburger button: visible background so it never disappears */
#mobile-menu-btn {
    background-color: rgba(48, 54, 67, 0.6);
    border-radius: 8px;
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
    will-change: opacity;
}

/* Force paint on small mobile - CSS animation triggers GPU repaint */
@media (max-width: 480px) {
    #mobile-menu-btn {
        animation: forceRepaint 0.01s 0.1s both;
    }
}
@keyframes forceRepaint {
    from { opacity: 0.99; }
    to { opacity: 1; }
}

/* Navbar solid state (after scroll) */
#navbar.scrolled {
    background-color: #303643;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: background-color 0.5s ease-in-out, box-shadow 0.5s ease-in-out, backdrop-filter 0.5s ease-in-out;
}


/* Small mobile fixes (320px-480px) */
@media (max-width: 480px) {
    /* Navbar: reduce padding and logo size for tiny screens */
    #navbar nav {
        padding-left: 12px;
        padding-right: 12px;
    }
    #navbar .flex.items-center.justify-between {
        height: 56px;
    }
    /* WhatsApp: smaller button, safe position away from edges */
    #whatsapp-btn {
        width: 48px !important;
        height: 48px !important;
        bottom: 16px !important;
        right: 16px !important;
    }
    #whatsapp-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Active nav link indicator */
.nav-link.active {
    color: #c27647;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7);
}

/* Nav link hover shadow for readability */
.nav-link:hover {
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7);
}

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 600px;
    opacity: 1;
    display: block;
}

/* Mobile nav link hover effect */
.mobile-nav-link {
    position: relative;
    transition: padding-left 0.3s ease;
}

.mobile-nav-link:hover {
    padding-left: 8px;
}


/* ============================================== */
/* 3. HERO SECTION - VIDEO LINE FIX              */
/* ============================================== */

/* Hero - dark background fallback + eliminate all gaps */
#hero {
    background-color: #303643;
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 0;
    font-size: 0;
    /* Extend hero slightly to cover any subpixel gap at top/bottom */
    margin-top: -5px;
    padding-top: 5px;
    margin-bottom: -2px;
}

/* Reset font-size/line-height for hero content */
#hero > .relative {
    font-size: 1rem;
    line-height: 1.5;
}

/* Video element: block display + scale trick to cover subpixel gaps (iOS Safari) */
#hero video {
    display: block;
    width: calc(100% + 4px);
    height: calc(100% + 8px);
    object-fit: cover;
    margin: -2px -2px -6px -2px;
    padding: 0;
    border: 0;
    outline: 0;
    transform: scale(1.02);
    transform-origin: center center;
    box-shadow: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Dark overlay must also cover extra area */
#hero > .absolute.inset-0.bg-dark-1 {
    margin: -4px -4px -8px -4px;
}

/* Cover subpixel gap between hero and trust-bar */
#trust-bar {
    position: relative;
    z-index: 1;
    margin-top: -2px;
    padding-top: calc(2.5rem + 2px); /* compensate the negative margin */
}

#trust-bar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background-color: #F8F9FA;
    z-index: 2;
}

/* Scroll indicator - reset font-size since hero has font-size:0 */
#hero .absolute.bottom-8 {
    font-size: 0.75rem;
    line-height: 1.5;
}


/* Hero scroll indicator bounce animation */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

#hero .animate-bounce {
    animation: gentleBounce 2s infinite ease-in-out;
}


/* ============================================== */
/* 4. TRUST BAR                                   */
/* ============================================== */

/* Trust item hover effect */
.trust-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
}

.trust-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
}


/* ============================================== */
/* 5. SERVICE CARDS                               */
/* ============================================== */

/* Service card image overlay gradient on hover */
.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #50a8e5, #c27647);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
    border-radius: 0 0 1rem 1rem;
    z-index: 10;
}

.service-card:hover::after {
    transform: scaleX(1);
}

/* Service card image container - responsive aspect ratio */
.service-img-wrapper {
    aspect-ratio: 3 / 4;
}

.service-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Tablet+ (2-col and 4-col grid): switch to landscape ratio */
@media (min-width: 640px) {
    .service-img-wrapper {
        aspect-ratio: 4 / 3;
    }

    .service-img-wrapper img {
        object-position: center center;
    }
}


/* ============================================== */
/* 6. HOW IT WORKS                                */
/* ============================================== */

/* Step number circle pulse on hover */
.step-item:hover .w-14 {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Vertical connecting line for mobile */
@media (max-width: 1023px) {
    .step-item:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: -2rem;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 2rem;
        background-color: rgba(80, 168, 229, 0.2);
    }
}


/* ============================================== */
/* 7. ABOUT SECTION                               */
/* ============================================== */

/* Counter number animation smoothness */
.counter {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

/* About image decorative elements */
#about-image .relative::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(80, 168, 229, 0.1), rgba(194, 118, 71, 0.1)) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    z-index: 1;
    pointer-events: none;
}


/* ============================================== */
/* 8. GALLERY - Before/After Slider               */
/* ============================================== */

/* Slider container */
.before-after-slider {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Before image wrapper - clips to reveal */
.before-image-wrapper {
    pointer-events: none;
    border-right: none;
}

/* Before image must span full container width */
.before-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Override inline style - actual width matches container */
    min-width: 0 !important;
    max-width: none !important;
}

/* Slider drag handle line */
.slider-handle {
    transition: none;
    z-index: 20;
    pointer-events: none;
}

/* Slider handle circle */
.slider-handle > div {
    pointer-events: auto;
    cursor: ew-resize;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slider-handle > div:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Handle icon rotation for horizontal slider */
.slider-handle svg {
    transform: rotate(90deg);
}

/* Gallery labels */
.before-after-slider span {
    z-index: 15;
    pointer-events: none;
}


/* ============================================== */
/* 9. TESTIMONIALS                                */
/* ============================================== */

/* Testimonial card quote mark decoration */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 20px;
    right: 24px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 5rem;
    line-height: 1;
    color: rgba(80, 168, 229, 0.08);
    pointer-events: none;
    z-index: 0;
}

/* Testimonial card hover lift */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}


/* ============================================== */
/* 10. WHATSAPP FLOATING BUTTON                   */
/* ============================================== */

/* WhatsApp button pulse animation */
#whatsapp-btn {
    animation: whatsappPulse 3s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}


/* ============================================== */
/* 11. CONTACT FORM                               */
/* ============================================== */

/* Form input focus state */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    border-color: #50a8e5;
    box-shadow: 0 0 0 3px rgba(80, 168, 229, 0.15);
}

/* Select dropdown arrow custom style */
#contact-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393918A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Radio button custom accent */
#contact-form input[type="radio"] {
    accent-color: #50a8e5;
}

/* Placeholder text styling */
#contact-form ::placeholder {
    color: rgba(147, 145, 138, 0.5);
}

/* Submit button hover glow */
#contact-form button[type="submit"]:hover {
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}


/* ============================================== */
/* 12. FOOTER                                     */
/* ============================================== */

/* Footer link hover underline effect */
footer a {
    position: relative;
}

footer .text-white\/60:hover {
    color: #c27647;
}

/* Social media icon hover */
footer a[aria-label] svg {
    transition: transform 0.3s ease;
}

footer a[aria-label]:hover svg {
    transform: scale(1.1);
}


/* ============================================== */
/* 12. UTILITY CLASSES                            */
/* ============================================== */

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Section divider (optional decorative line) */
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #50a8e5, #c27647);
    border-radius: 2px;
    margin: 0 auto 2rem;
}

/* Animated gradient background for special elements */
.gradient-bg {
    background: linear-gradient(135deg, #50a8e5 0%, #4895cc 50%, #c27647 100%);
}

/* Image placeholder styling (shown while images load) */
img {
    background-color: #F8F9FA;
}

/* Loading skeleton animation */
.skeleton {
    background: linear-gradient(90deg, #F8F9FA 25%, #e9ecef 50%, #F8F9FA 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* ============================================== */
/* 13. SCROLLBAR - Hidden but functional          */
/* ============================================== */
html {
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge */
}

html::-webkit-scrollbar {
    display: none;                /* Chrome, Safari, Opera */
}


/* ============================================== */
/* 14. FAQ ACCORDION                              */
/* ============================================== */

.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-item .faq-toggle svg {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-toggle svg {
    transform: rotate(45deg);
}


/* ============================================== */
/* 15. SUB-PAGE HERO                              */
/* ============================================== */

.page-hero {
    background-color: #303643;
    padding-top: 7rem;
}

/* Services page hero with background image */
.services-hero {
    min-height: 50vh;
    background-color: #303643;
}

.services-hero img {
    object-position: center center;
}

/* Mobile grande (480px+) */
@media (min-width: 480px) {
    .services-hero {
        min-height: 60vh;
    }
}

@media (min-width: 480px) and (max-width: 639px) {
    .services-hero h1 {
        font-size: 1.875rem;
    }
}

/* Tablet vertical (600px+) */
@media (min-width: 600px) {
    .services-hero {
        min-height: 70vh;
    }
}

/* Tablet horizontal (768px+) */
@media (min-width: 768px) {
    .services-hero {
        min-height: 80vh;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .services-hero h1 {
        font-size: 2.625rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .services-hero {
        min-height: 100vh;
    }
    .services-hero img {
        object-position: center top;
    }
}

/* About page hero with background image */
.about-hero {
    min-height: 50vh;
    background-color: #303643;
}

.about-hero img {
    object-position: center 20%;
}

@media (min-width: 480px) {
    .about-hero {
        min-height: 60vh;
    }
}

@media (min-width: 600px) {
    .about-hero {
        min-height: 70vh;
    }
}

@media (min-width: 768px) {
    .about-hero {
        min-height: 80vh;
    }
}

@media (min-width: 1024px) {
    .about-hero {
        min-height: 100vh;
    }
}

/* Contact page hero with background image */
.contact-hero {
    min-height: 50vh;
    background-color: #303643;
}

.contact-hero img {
    object-position: center 20%;
}

@media (min-width: 480px) {
    .contact-hero {
        min-height: 60vh;
    }
}

@media (min-width: 600px) {
    .contact-hero {
        min-height: 70vh;
    }
}

@media (min-width: 768px) {
    .contact-hero {
        min-height: 80vh;
    }
}

@media (min-width: 1024px) {
    .contact-hero {
        min-height: 100vh;
    }
}


/* Sub-page service detail cards */
.service-detail-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-detail-card:hover {
    transform: translateY(-4px);
}


/* ============================================== */
/* 16. SERVICES PAGE - SERVICE SECTIONS LAYOUT    */
/* ============================================== */

/* --- Base / Mobile small (< 375px) --- */
.service-section {
    display: flex;
    flex-direction: column;
}

.service-section .service-img {
    order: -1;
    background-color: #f5f5f5;
}

.service-section .service-img img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    display: block;
}

.service-section .service-text {
    padding: 2rem 1rem;
    text-align: center;
}

.service-section .service-text h2 {
    font-size: 1.375rem;
}

.service-section .service-text ul {
    text-align: left;
}

.service-section .service-text li span {
    font-size: 0.875rem;
}

.service-section .service-text .service-cta {
    display: inline-flex;
    align-items: center;
    max-width: 90%;
}

/* --- Mobile standard (375px+) --- */
@media (min-width: 375px) {
    .service-section .service-img img {
        max-height: 400px;
    }

    .service-section .service-text {
        padding: 2rem 1.5rem;
    }
}

/* --- Mobile large (480px+) --- */
@media (min-width: 480px) {
    .service-section .service-img img {
        max-height: 450px;
    }

    .service-section .service-text h2 {
        font-size: 1.5rem;
    }
}

/* --- Tablet vertical (600px+) --- */
@media (min-width: 600px) {
    .service-section .service-img img {
        max-height: 500px;
    }

    .service-section .service-text {
        padding: 2.5rem 2rem;
    }

    .service-section .service-text h2 {
        font-size: 1.75rem;
    }

    .service-section .service-text li span {
        font-size: 1rem;
    }

    .service-section .service-text .service-cta {
        max-width: none;
    }
}

/* --- Tablet horizontal (768px+) --- */
@media (min-width: 768px) {
    .service-section {
        min-height: 80vh;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .service-section .service-img {
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        order: unset;
        padding: 0.75rem 0.25rem;
    }

    .service-section .service-img img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: calc(80vh - 1.5rem);
        object-fit: contain;
    }

    .service-section .service-text {
        display: flex;
        align-items: center;
        padding: 5rem 2.5rem 2.5rem; /* top padding clears fixed navbar */
        text-align: left;
    }

    .service-section .service-text > div {
        max-width: 36rem;
    }

    .service-section .service-text h2 {
        font-size: 1.875rem;
    }

    .service-section .service-text li span {
        font-size: 0.9375rem;
    }

    /* Alternating order */
    .service-section.img-right .service-text { order: 1; }
    .service-section.img-right .service-img { order: 2; }
    .service-section.img-left .service-text { order: 2; }
    .service-section.img-left .service-img { order: 1; }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
    .service-section {
        min-height: 100vh;
    }

    .service-section .service-img img {
        max-height: calc(100vh - 2rem);
    }

    .service-section .service-text {
        padding: 5rem 4rem 3rem; /* top padding clears fixed navbar */
    }

    .service-section .service-text h2 {
        font-size: 2.25rem;
    }

    .service-section .service-text li span {
        font-size: 1rem;
    }
}

/* --- Desktop large (1280px+) --- */
@media (min-width: 1280px) {
    .service-section .service-text {
        padding: 5rem 6rem 3rem;
    }

    .service-section .service-text h2 {
        font-size: 2.625rem;
    }
}


/* ============================================== */
/* 17. RESPONSIVE ADJUSTMENTS                     */
/* ============================================== */

/* Extra small screens (below 375px) */
@media (max-width: 374px) {
    #hero h1 {
        font-size: 1.75rem;
    }

    #hero p {
        font-size: 0.875rem;
    }

    .service-card .p-6,
    .service-card .p-5 {
        padding: 0.875rem;
    }

    /* Tighter section padding */
    section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Smaller step circles */
    .step-item .w-14 {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }

    /* Contact form adjustments */
    #contact-form {
        padding: 1rem;
    }

    #contact-form input,
    #contact-form select,
    #contact-form textarea {
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem;
    }

    /* Footer tighter spacing */
    footer {
        font-size: 0.8125rem;
    }

    /* Slider handle smaller on tiny screens */
    .slider-handle > div {
        width: 2rem;
        height: 2rem;
    }

    .slider-handle svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Small screens - phones (375px - 639px) */
@media (min-width: 375px) and (max-width: 639px) {
    #hero h1 {
        font-size: 2rem;
    }

    /* Contact info email break */
    .contact-email {
        word-break: break-all;
    }
}

/* Tablet adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
    /* Ensure 2-column service cards have equal height */
    .service-card {
        display: flex;
        flex-direction: column;
    }

    .service-card .p-6 {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .service-card .p-6 p {
        flex: 1;
    }
}

/* Desktop wide screens */
@media (min-width: 1280px) {
    /* Slightly larger hero text on wide screens */
    #hero h1 {
        font-size: 4.5rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .before-after-slider {
        cursor: default;
    }
}

/* Print styles */
@media print {
    #navbar,
    #hero video,
    .slider-handle,
    #mobile-menu-btn,
    footer .flex.items-center.space-x-4 {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}