:root {
    --primary-color: #8B0000; /* Rojo Vino más oscuro */
    --primary-color-light: #B22222; /* Un tono más claro para hover */
    --secondary-color: #f9f9f9; /* Gris claro más brillante */
    --text-dark: #2c2c2c;
    --text-light: #fff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

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

html {
    scroll-padding-top: 80px; /* Ajuste para el header fijo */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.8;
    color: var(--text-dark);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 0 2rem;
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    padding: 0.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 0.25rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

header .logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    height: 60px;
    width: auto;
    transition: height 0.3s ease;
}

header.scrolled .logo {
    height: 50px;
}

header nav ul {
    list-style: none;
    display: flex;
}

header nav ul li {
    margin-left: 25px;
}

header nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    padding-bottom: 5px;
    position: relative;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color-light);
    transition: width 0.3s ease;
}

header nav a:hover::after {
    width: 100%;
}

header nav a:hover {
    color: var(--primary-color-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
}

main {
    padding-top: 80px; /* Ajuste para el header fijo */
}

section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 3rem;
    font-family: var(--font-heading);
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: #666;
}

.hero {
    height: 100vh;
    position: relative;
    color: #fff;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-image.active {
    opacity: 1;
}

.hero-text {
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero h2 {
    font-size: 4rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--text-light);
}

.hero p {
    font-size: 1.5rem;
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .grid-3 {
       grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    header nav.active {
        display: block;
    }
    
    header nav ul {
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
    }

    header nav ul li {
        margin: 1rem 0;
    }

    .nav-toggle {
        display: block;
    }
    
    .nav-toggle.active i::before {
        content: '\f00d'; /* Font Awesome close icon */
    }

    .section-title {
        font-size: 2.5rem;
    }

    .hero h2 {
        font-size: 2.8rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 1rem;
}

.card h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.bg-light {
    background: var(--secondary-color);
}

.bg-dark {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 80px 0;
}

.bg-dark .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 768px) {
    .bg-dark .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-info {
        text-align: center;
    }

    .bg-dark .section-title, .bg-dark p {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    position: relative; /* Added for overlay positioning */
}

.map-container iframe {
    width: 100%;
    height: 350px;
    display: block;
    pointer-events: none; /* Make iframe unclickable */
}

.map-link {
    display: block;
    position: relative;
    cursor: pointer;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.2rem;
    text-align: center;
}

.map-overlay i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.map-link:hover .map-overlay,
.map-link:focus .map-overlay {
    opacity: 1;
}

.social-links {
    margin-top: 20px;
    display: flex;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: var(--text-light);
    color: var(--primary-color);
    border-radius: 50%;
    margin-right: 15px;
    text-decoration: none;
    font-size: 20px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    background: var(--secondary-color);
    color: var(--primary-color-light);
    transform: translateY(-3px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-item {
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-grid img:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

footer {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 2rem 0;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Changed from auto */
    background-color: rgba(0,0,0,0.9);
    display: none; /* Duplicated property, but keeping for safety */
    align-items: center; /* Added */
    justify-content: center; /* Added */
}

.lightbox.block-display {
    display: block; /* We'll use JS to set display to flex to center */
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    animation-name: zoom;
    animation-duration: 0.6s;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.lightbox-image-container.zoomed .lightbox-content {
    transform: none; /* Reset transform to handle panning */
    max-width: none;
    max-height: none;
    width: 300%;
    height: 300%;
    object-fit: cover;
    cursor: grab;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Lightbox navigation buttons */
.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.4s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Call to Action Button */
.btn {
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-color-light);
    border-color: var(--primary-color-light);
    transform: translateY(-2px);
}

.btn-light {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid #fff;
}

.btn-light:hover {
    background: transparent;
    color: #fff;
}

/* Animations on scroll */
.anim-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.anim-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}