/* 
  Casa Oficia - Design System
  Colors: Deep Charcoal (#1a1a1a), Sage Green (#8a9a8a), Warm White (#fdfdfd), Gold/Brass (#c5a059)
*/

:root {
    --primary: #1a1a1a;
    --secondary: #8a9a8a;
    --accent: #c5a059;
    --bg-white: #fdfdfd;
    --text-dark: #222;
    --text-light: #666;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .heading-font {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 80px 0; /* Reduced padding for faster layout */
    content-visibility: auto;
    contain: content; /* Stronger hint to browser for independent rendering */
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(253, 253, 253, 0.98); /* Less transparency for better performance */
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
}

.logo img {
    height: 130px;
    margin-left: 50px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

/* Mobile Menu Logic */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.menu-toggle .bar {
    width: 28px;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('QUINCHO MV/mv (3).jpeg');
    background-color: #111;
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: white;
    margin-top: 160px; /* Adjusted margin to account for larger logo in fixed header */
    backface-visibility: hidden;
    transform: translateZ(0);
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpSimple 0.8s forwards 0.3s;
}

.hero-content p {
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpSimple 0.8s forwards 0.5s;
}

.hero-content p:first-child {
    margin-top: 4rem;
}

@keyframes fadeInUpSimple {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* About Section Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.quote-box {
    border-left: 4px solid var(--secondary);
    padding-left: 2rem;
    margin-top: 2rem;
    font-style: italic;
    color: var(--primary);
}

/* Services Grid */
.services-section {
    background-color: var(--primary);
    color: white;
}

.services-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.service-card {
    background: rgba(255,255,255,0.05);
    padding: 3rem;
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.service-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent);
    transform: translateY(-5px); /* Reduced movement for smoother render */
}

.service-card h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.service-list {
    list-style: none;
}

.service-list li {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.service-list li:hover {
    color: var(--accent);
    transform: translateX(10px);
}

.service-list li::before {
    content: '→';
    margin-right: 15px;
    color: var(--secondary);
}

/* Projects Gallery */
.projects-header {
    text-align: center;
    margin-bottom: 4rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-item {
    position: relative;
    overflow: hidden;
    height: 450px;
    cursor: pointer;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: rgba(0,0,0,0.7); /* Simplified background from gradient to solid transparency */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 1;
    transition: var(--transition);
}

.project-item:hover img {
    transform: scale(1.05);
}

.project-item:hover .project-overlay {
    height: 50%; /* Subtle expansion on hover */
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
}

.project-overlay h4 {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-overlay p {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Base styles for redesigned sections */
.about-header {
    text-align: center;
    margin-bottom: 5.5rem;
}

.about-header h2 {
    font-size: 3.5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    margin-bottom: 9rem;
}

.about-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.about-image img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

.quote-box {
    margin-top: 3rem;
    background: #f9f9f9;
    padding: 2.5rem;
    border-left: 5px solid var(--accent);
}

.team-placeholder {
    text-align: center;
    padding: 5rem 0;
}

.team-placeholder p {
    color: var(--text-light);
    letter-spacing: 2px;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 5rem;
}

.service-card {
    padding: 4rem;
}

.services-grid .service-card h3 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.projects-header {
    margin-bottom: 5rem;
}

.projects-header h2 {
    font-size: 3rem;
}

.projects-header p {
    color: var(--text-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Contact Section */
.contact-section {
    background: var(--bg-white);
    text-align: center;
    padding: 8rem 0;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2.5rem;
    border: 1px solid var(--primary);
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    transition: var(--transition);
    gap: 12px;
}

.btn-icon {
    height: 30px; 
    width: auto;
    filter: none; 
}

.contact-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.contact-btn.whatsapp {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.contact-btn.whatsapp:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Redesigned Premium Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: transparent; /* No box, just content */
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    position: relative;
    box-shadow: none;
    animation: none; /* Removed old animation */
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 450px;
    height: 100vh;
    width: 100vw;
}

.modal-body:has(.modal-image-container[style*="display: none"]) {
    grid-template-columns: 1fr;
}

.modal-image-container {
    padding: 2rem;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505; /* Blacker background for image */
    position: relative; /* Added for slider nav positioning */
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
    opacity: 0;
    transform: scale(0.98);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

.modal.active .modal-image-container img {
    opacity: 1;
    transform: scale(1);
}

.modal-info {
    padding: 6rem 4rem;
    background: #111; /* Dark background for info */
    color: white; /* White text */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Changed from center to allow scrolling from top */
    border-left: 1px solid rgba(255,255,255,0.05);
    overflow-y: auto; /* Enable vertical scrolling */
    max-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #111;
}

.modal-info::-webkit-scrollbar {
    width: 6px;
}

.modal-info::-webkit-scrollbar-track {
    background: #111;
}

.modal-info::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
}

.modal-info h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: white; /* White title */
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s;
}

.modal-info p {
    color: #ccc; /* Lighter text for secondary info */
    font-size: 1.2rem;
    line-height: 2;
    font-weight: 300;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
}

.modal.active .modal-info h3,
.modal.active .modal-info p {
    transform: translateY(0);
    opacity: 1;
}

.close-modal {
    position: fixed;
    top: 40px;
    right: 40px;
    color: white; /* White close button */
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 2002;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

/* Slider Navigation Styles */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4); /* Darker background for visibility */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.8rem; /* Slightly larger arrows */
    z-index: 2005; /* High z-index to stay above images */
    transition: var(--transition);
    border-radius: 50%; /* Circular buttons */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.slider-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.prev-slide { left: 20px; }
.next-slide { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2003;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

@media (max-width: 1100px) {
    .prev-slide { left: 20px; }
    .next-slide { right: 20px; }
    .slider-nav { width: 40px; height: 40px; font-size: 1.2rem; }
}

@media (max-width: 768px) {
    .slider-nav {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
        background: rgba(0, 0, 0, 0.6); /* Even darker on mobile */
    }
    .prev-slide { left: 15px; }
    .next-slide { right: 15px; }
    .slider-dots { bottom: 20px; }
}

/* Full Device Responsiveness */
@media (max-width: 1100px) {
    .modal {
        overflow-y: auto;
        display: none; /* Will be flex via JS */
        align-items: flex-start; /* Start from top to allow scroll */
        padding: 20px 0;
    }

    .modal-body {
        grid-template-columns: 1fr;
        height: auto;
        width: 100%;
    }

    .modal-content {
        height: auto;
    }

    .modal-image-container {
        height: auto;
        min-height: 300px;
        width: 100%;
        padding: 1rem;
        margin-top: 60px;
    }

    .modal-info {
        height: auto;
        padding: 3rem 2rem;
        border-left: none;
    }
    .modal-info h3 { font-size: 2rem; }
}

@media (max-width: 968px) {
    header { padding: 1rem 0; }
    
    .menu-toggle { display: flex; z-index: 1001; }
    
    .logo img { height: 80px; } /* Increased for mobile as well */

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: white;
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        justify-content: center;
        gap: 3rem;
    }

    .nav-links.active { left: 0; }

    .nav-links a { font-size: 1.2rem; }

    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-image img { height: 400px; }
    
    .services-grid { grid-template-columns: 1fr; }
    
    .hero-content h1 { font-size: 3rem; }
    
    .projects-grid { grid-template-columns: 1fr; }
    .project-item { height: 350px; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2.2rem; }
    .about-header h2 { font-size: 2.2rem; }
    .modal-info h3 { font-size: 1.8rem; }
    .contact-links { flex-direction: column; gap: 1rem; }
}

/* Hamburger Animation */
#mobile-menu.is-active .bar:nth-child(2) { opacity: 0; }
#mobile-menu.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#mobile-menu.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

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

/* Responsive Section Specific Adjustments */
@media (max-width: 1024px) {
    .about-grid {
        gap: 3rem;
        margin-bottom: 6rem !important;
    }
    
    .about-image img {
        height: 450px !important;
    }
    
    .service-card {
        padding: 2.5rem !important;
    }
}

@media (max-width: 768px) {
    .about-header h2 {
        font-size: 2.8rem !important;
        margin-bottom: 3.5rem !important;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem !important;
        margin-bottom: 5rem !important;
        direction: ltr !important; /* Reset direction for mobile */
    }
    
    .about-content h3 {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
    }
    
    .about-image img {
        height: 350px !important;
    }
    
    .services-section h2 {
        font-size: 2.3rem !important;
        margin-bottom: 3rem !important;
    }
    
    .service-card {
        padding: 2rem !important;
    }
    
    .service-card h3 {
        font-size: 1.6rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    .projects-header h2 {
        font-size: 2.3rem !important;
        margin-bottom: 3rem;
    }
    
    /* Reveal animation adjustment for mobile */
    .reveal {
        transform: translateY(20px);
    }
    
    .team-placeholder {
        padding: 3rem 0 !important;
    }
}

@media (max-width: 480px) {
    .about-header h2 {
        font-size: 2.2rem !important;
    }
    
    .quote-box {
        padding: 1.5rem !important;
        margin-top: 2rem !important;
    }
    
    .quote-box p:first-child {
        font-size: 1.2rem !important;
    }
    
    .service-card {
        padding: 1.5rem !important;
    }
}

/* Hero Tagline Responsive */
@media (max-width: 768px) {
    .hero-content p[style*=" Playfair Display"] {
        font-size: 1.2rem !important;
        letter-spacing: 1px !important;
    }
}

/* Responsive */
@media (max-width: 968px) {
    .about-grid, .services-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Internal Form Styles */
.denuncia-option {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.denuncia-option:hover {
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
    padding-left: 2rem;
}

.internal-form .form-group {
    margin-bottom: 0.8rem;
    text-align: left;
}

.internal-form label {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.internal-form input,
.internal-form textarea {
    width: 100%;
    padding: 0.6rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}

.internal-form input:focus,
.internal-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.1);
}

.internal-form textarea {
    resize: none;
    height: 80px;
}

.internal-form input:focus,
.internal-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

@media (max-width: 480px) {
    .denuncia-option {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .internal-form input,
    .internal-form textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}
