/* ========================================
   CASIOPEA DESIGN - EXTENSIONS
   Estilos para nuevas secciones
   ======================================== */

/* Prevent scrolling during preloader */
body {
    overflow: hidden;
}

body.loaded {
    overflow: auto;
}

/* ========== Preloader ========== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.preloader-img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #F5F0E6;
    border-top: 4px solid #064E3B;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Scroll Progress Bar ========== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #064E3B 0%, #C9A87C 100%);
    z-index: 9998;
    transition: width 0.1s ease;
}

/* ========== Sticky Navigation ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 254, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(6, 78, 59, 0.1);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateY(0);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #064E3B;
}

.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #2D2D2D;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #064E3B 0%, #C9A87C 100%);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #064E3B;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    background: linear-gradient(135deg, #064E3B 0%, #0D6B52 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 78, 59, 0.3);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #064E3B;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ========== Gallery Section ========== */
.gallery-section {
    padding: 6rem 0;
    background: #F5F0E6;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 4rem 0;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid #064E3B;
    color: #064E3B;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.active,
.filter-btn:hover {
    background: #064E3B;
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.hidden {
    display: none;
}

.gallery-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.placeholder-text {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.7;
    line-height: 1.4;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-item:hover .gallery-placeholder {
    transform: scale(1.05);
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gallery-description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.gallery-view-btn {
    background: white;
    color: #064E3B;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-view-btn:hover {
    background: #C9A87C;
    color: white;
}

/* ========== Lightbox Modal ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-image-wrapper {
    margin-bottom: 2rem;
}

.lightbox-placeholder {
    max-width: 80vw;
    max-height: 70vh;
    aspect-ratio: 4/3;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-info {
    text-align: center;
    color: white;
}

.lightbox-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lightbox-description {
    font-size: 1.2rem;
    opacity: 0.8;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-close:hover {
    background: white;
    color: #2D2D2D;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-nav:hover {
    background: white;
    color: #2D2D2D;
}

/* ========== Testimonials Section ========== */
.testimonials-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, #FFFEF9 0%, #F5F0E6 100%);
}

.testimonials-carousel {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.testimonial-card {
    min-width: 100%;
    padding: 4rem;
    text-align: center;
}

.testimonial-rating {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.testimonial-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2D2D2D;
    font-style: italic;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #064E3B 0%, #C9A87C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.author-info {
    text-align: left;
}

.author-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #064E3B;
    margin-bottom: 0.25rem;
}

.author-role {
    font-size: 0.95rem;
    color: #6B7280;
}

.testimonials-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 4rem;
}

.testimonial-btn {
    background: #064E3B;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.25rem;
}

.testimonial-btn:hover {
    background: #0D6B52;
    transform: scale(1.1);
}

.testimonials-dots {
    display: flex;
    gap: 0.5rem;
}

.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6B7280;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-dot.active {
    background: #064E3B;
    width: 32px;
    border-radius: 6px;
}

/* ========== FAQ Section ========== */
.faq-section {
    padding: 6rem 0;
    background: #FFFEF9;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(6, 78, 59, 0.05);
    border: 1px solid rgba(201, 168, 124, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:hover {
    box-shadow: 0 10px 30px rgba(6, 78, 59, 0.12);
    border-color: rgba(201, 168, 124, 0.5);
    transform: translateX(8px);
}

.faq-item.active {
    background: rgba(255, 255, 255, 0.98);
    border-left: 6px solid #064E3B;
    box-shadow: 0 20px 50px rgba(6, 78, 59, 0.18),
        0 0 30px rgba(201, 168, 124, 0.25);
    transform: scale(1.02);
    z-index: 10;
}

.faq-question {
    width: 100%;
    padding: 1.75rem 2rem;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #064E3B;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    /* Ensure on top */
    pointer-events: auto !important;
    /* Force Clickable */
}

.faq-question:hover {
    color: #0D6B52;
    background: rgba(6, 78, 59, 0.03);
}

.faq-item.active .faq-question {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.05), transparent);
}

.faq-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 1rem;
    color: #C9A87C;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: #064E3B;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
    padding: 0 2rem;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 2rem 2rem;
    opacity: 1;
}

.faq-answer p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #2D2D2D;
}

.faq-answer ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #6B7280;
}

.faq-cta {
    text-align: center;
    margin-top: 4rem;
    padding: 4rem;
}

.faq-cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #2D2D2D;
}

/* ========== Responsive Enhancements ========== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 254, 249, 0.98);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 8px 24px rgba(6, 78, 59, 0.1);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link::after {
        display: none;
    }

    .nav-cta {
        width: 100%;
        text-align: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-placeholder {
        max-width: 90vw;
        max-height: 60vh;
    }

    .lightbox-title {
        font-size: 1.5rem;
    }

    .lightbox-description {
        font-size: 1rem;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .testimonial-text {
        font-size: 1.05rem;
    }

    .faq-question {
        font-size: 1rem;
    }

    .testimonial-card {
        padding: 2rem 1rem;
    }

    /* Mobile settings adjustment */
    .nav-settings {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        justify-content: flex-start;
        padding-left: 0;
    }
}

/* ========== Settings Controls (Theme & Lang) ========== */
.nav-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    list-style: none;
    /* Ensure no bullet */
}

.icon-btn,
.text-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #064E3B;
    /* Hardcoded jungle-deep for safety if vars fail, or use var if consistent */
}

.icon-btn:hover,
.text-btn:hover {
    background: rgba(6, 78, 59, 0.1);
}

.icon-btn:hover {
    transform: rotate(15deg);
}

.text-btn {
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    border: 1px solid transparent;
    width: auto;
    height: auto;
}

.text-btn:hover {
    border-color: #064E3B;
}

/* Theme Toggle Icons Logic */
.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

/* Dark Mode State for Buttons */
body.dark-mode .sun-icon {
    display: block;
    color: #fbbf24;
    /* Golden sun */
}

body.dark-mode .moon-icon {
    display: none;
}

body.dark-mode .icon-btn,
body.dark-mode .text-btn {
    color: #f8fafc;
    /* light text */
}

body.dark-mode .icon-btn:hover,
body.dark-mode .text-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .text-btn:hover {
    border-color: #f8fafc;
}