/* Sticky Header */
.header.fixed {
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Mobile Menu Toggle (Script-free) */
.nav-toggle-checkbox {
    display: none;
}

/* Navigation Dropdowns (Script-free) */
.nav ul li {
    position: relative;
}
.nav ul li ul.sub-menu {
    display: none;
    position: absolute;
    top: 45px;
    left: 0;
    width: 200px;
    background: #2d1f1d;
    box-shadow: 5px 5px 5px #1e1e1e;
    z-index: 1000;
    text-align: left;
}
.nav ul li:hover > ul.sub-menu {
    display: block;
}
.nav ul li ul.sub-menu li {
    display: block;
    width: 100%;
}
.nav ul li ul.sub-menu li a {
    padding-top: 5% !important;
    height: 25px;
    color: #fff !important;
    display: block;
    padding-left: 20px;
    transition: color 0.2s;
}
.nav ul li ul.sub-menu li a:hover {
    color: #c6d33c !important;
}

@media screen and (max-width: 939px) {
    .toggleMenu {
        display: block;
        cursor: pointer;
        padding: 10px;
        background: #93665a;
        color: #fff;
        text-align: center;
    }
    .nav {
        display: none;
    }
    .nav-toggle-checkbox:checked ~ .nav {
        display: block !important;
    }
    .nav ul {
        display: block !important;
    }
    /* Mobile dropdowns */
    .nav ul li ul.sub-menu {
        position: static;
        display: none;
        width: 100%;
        background: rgba(0,0,0,0.1);
    }
    .nav ul li:focus-within > ul.sub-menu,
    .nav ul li:active > ul.sub-menu {
        display: block;
    }
}

/* CSS Slider Framework Base */
.slider-main {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Homepage Vanilla JS Slider */
#homepage-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.slide-item {
    display: none;
    width: 100%;
    position: relative;
}
.slide-item.active {
    display: block;
    animation: fadeEffect 1s ease-in-out;
}
.slide-item img {
    width: 100%;
    display: block;
}
@keyframes fadeEffect {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Arrows */
.prev-arrow, .next-arrow {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    z-index: 10;
}
.next-arrow {
    right: 0;
}
.prev-arrow:hover, .next-arrow:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 10;
}
.slider-dots .dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 4px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}
.slider-dots .dot.active, .slider-dots .dot:hover {
    background-color: #c6d33c;
}

/* Captions for CSS Slider */
.css-caption.top-bar {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    padding: 0;
    text-align: center;
    width: 80%;
    max-width: 900px;
    box-sizing: border-box;
    pointer-events: none;
}
.css-caption h2 {
    margin: 0 0 10px 0;
    color: #c6d33c !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    font-size: 40px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
}
.css-caption p {
    margin: 0 0 10px 0;
    color: #fff !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,1);
    font-size: 22px;
    line-height: 1.6;
}

/* Visibility for elements previously animated by JS */
.services, .message-thumb, .message-desc, .blogposts, .team-desc, .team-div {
    visibility: visible !important;
}

/* Modals (Script-free using :target) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.modal-overlay:target {
    display: flex;
}
.modal-content {
    background: #fff;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    text-align: center;
}
.modal-content h2 {
    color: #513d3d !important;
    font-size: 24px;
    margin-bottom: 15px;
}
.modal-content p {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin: 0;
}
.modal-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    text-align: justify;
    margin-top: 20px;
}
.modal-body img {
    flex-shrink: 0;
    max-width: 140px;
}
@media screen and (max-width: 600px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 40px;
    line-height: 1;
    font-weight: bold;
    text-decoration: none;
    color: #333 !important;
    z-index: 10001;
    display: block;
}
.modal-close:hover {
    color: #000 !important;
}

/* Service Boxes Hover Fixes - Ensure modal images stay visible */
#servicio1:hover { background: url(../images/img_serv1.png) no-repeat left top !important; }
#servicio2:hover { background: url(../images/img_serv2.png) no-repeat left top !important; }
#servicio3:hover { background: url(../images/img_serv3.png) no-repeat left top !important; }
#servicio4:hover { background: url(../images/img_serv4.png) no-repeat left top !important; }
#servicio5:hover { background: url(../images/img_serv5.png) no-repeat center top !important; }
#servicio6:hover { background: url(../images/img_serv6.png) no-repeat left center !important; }
#services-box:hover img { visibility: hidden; }
.modal-overlay img { visibility: visible !important; }
#services-box:hover .modal-overlay img { visibility: visible !important; }

/* Testimonials Carousel (Script-free) */
.testimonials-slider {
    overflow: hidden;
    background: linear-gradient(to right, #dae292, #b5c754);
    padding: 20px 0;
    margin-top: 30px;
    clear: both;
}
.testimonials-css-track {
    display: flex;
    width: 400%;
    animation: testimonial-slide 16s infinite;
}
.testimonials-css-track .slide {
    width: 25%;
    padding: 0 40px;
    text-align: center;
}
.testimonials-carousel-content p {
    font-style: italic;
    font-size: 18px;
    color: #4a3e3d;
    margin: 0;
}
@keyframes testimonial-slide {
    0% { transform: translateX(0); }
    25% { transform: translateX(0); }
    33.33% { transform: translateX(-25%); }
    58.33% { transform: translateX(-25%); }
    66.66% { transform: translateX(-50%); }
    91.66% { transform: translateX(-50%); }
    100% { transform: translateX(-75%); }
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #93665a;
    color: #fff;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    text-decoration: none;
    z-index: 999;
    font-size: 24px;
}

/* Visibility for hidden elements */
.fancybox-hidden, .su-spoiler-closed .su-spoiler-content {
    display: block !important;
}

/* Accordion (Script-free) */
.su-spoiler {
    margin-bottom: 15px;
    border: none;
}
.su-spoiler-title {
    padding: 15px 0;
    background: transparent;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    font-weight: 400;
    font-family: 'Roboto Condensed', sans-serif;
    position: relative;
    user-select: none;
    text-transform: uppercase;
    color: #573f3d;
    font-size: 22px;
    border-bottom: 1px solid #e1e1e1;
    transition: color 0.3s;
}
.su-spoiler-title:hover {
    color: #8c7371;
}
.su-spoiler-toggle {
    display: none;
}
.su-spoiler-title::before {
    content: '+';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid #573f3d;
    border-radius: 50%;
    margin-right: 15px;
    color: #573f3d;
    font-weight: normal;
    font-size: 18px;
    line-height: 1;
}
.su-spoiler-toggle:checked ~ .su-spoiler-title::before {
    content: '-';
}
.su-spoiler-content {
    max-height: 0;
    overflow: hidden !important;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, visibility 0.4s ease-out;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    opacity: 0;
    visibility: hidden;
}
.su-spoiler-toggle:checked ~ .su-spoiler-content {
    max-height: 2500px;
    padding: 20px 0 !important;
    opacity: 1;
    visibility: visible;
}

/* Ensure images are visible */
img {
    max-width: 100%;
    height: auto;
}
