#intro-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000; /* Above everything, even preloader */
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.5s ease-in-out;
}

#intro-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(90%);
}
#intro-frame.fade-out {
  opacity: 0;
  pointer-events: none;
}

/*====================================================================
  GLOBAL & BACKGROUND STYLES
======================================================================*/

body {
    background-image: url('../images/Full-entrance-1.jpg');
    /* KEY FIX 1: Ensures the image covers the entire viewport, even on resize */
    background-size: cover;
    background-color: #000000;
    background-position: center;

    /* KEY FIX 2: Prevents the background image from scrolling with the content. */
    background-attachment: fixed;

    background-repeat: no-repeat;

    scroll-behavior: smooth;

    display: flex;
    flex-direction: column;
    /* KEY FIX 3: Prevents horizontal scroll on the body itself */
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    box-sizing: border-box;
}

.first {
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Dark overlay to match the moody lighting in the reference image (KEEP THIS BLOCK) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.301);
    /* This is the darkening layer */
    z-index: -1;
}

/*====================================================================
  SECOND SECTION INTRO TEXT
======================================================================*/

.section-intro {
    width: 100%;
    margin: 0 auto 30px auto;
    /* Adjust padding on the left to align with max-width content */
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.section-intro p {
    color: #333333;
    /* Dark gray/black text on the white background */
    font-family: 'Times New Roman', Times, serif;
    font-size: 2.0em;
    /* Adjust size as needed */
    font-style: italic;
    font-weight: bold;
    max-width: 900px;
    /* Center the text block within the container */
    margin: 0 auto;
    text-align: left;
}

.isometrica-highlight {
  position: relative;
  width: 100%;
  height: 80vh; /* buena proporción */
  overflow: hidden;
  margin: 0;
}

/* === CONTENEDOR DE IMAGEN === */
.isometrica-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* === IMAGEN PRINCIPAL === */
.isometrica-container img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ antes: cover — ahora muestra la imagen completa */
  filter: brightness(75%) blur(0.3px);
  transition: transform 4s ease-in-out, filter 1s ease;
}

/* === EFECTO HOVER === */
.isometrica-container:hover img {
  transform: scale(0.94); /* ✅ se aleja un poco */
  filter: brightness(95%);
}

/* === TEXTO SUPERPUESTO === */
.isometrica-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  padding: 30px 50px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: opacity 0.8s ease; /* ✅ para el fade-out */
}

/* === OCULTAR TEXTO AL PASAR EL MOUSE === */
.isometrica-container:hover .isometrica-overlay {
  opacity: 0;
  visibility: hidden;
}

/* === TITULO === */
.isometrica-overlay h2 {
  font-family: 'Georgia', serif;
  font-size: 2.5em;
  color: #e0b060;
  margin-bottom: 15px;
}

/* === PÁRRAFO === */
.isometrica-overlay p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.2em;
  color: #fff;
}

/*====================================================================
  SECOND SECTION (Image Gallery)
======================================================================*/

.second {
    background-color: #ffffff;
    padding: 60px 20px;
    width: 100%;
}

.image-grid {
    /* KEY FIX 4: Use a max-width and center it for better control */
    max-width: 1200px;
    margin: 100px auto;

    /* KEY: Define the grid layout */
    display: grid;

    /* Set 2 columns of equal width (1 fraction unit each) */
    grid-template-columns: 1fr 1fr;

    /* Spacing between the images */
    gap: 20px;
    padding: 0 20px;
    /* Add horizontal padding to prevent edge touching on mobile */
}

.image-box {
    position: relative;
    width: 100%;

    /* KEY: Defines the height to be equal to the calculated width of the column */
    aspect-ratio: 1 / 1;

    overflow: hidden;
    cursor: default;

    border: 1px solid #ccc;
    border-radius: 5px;
}

.image-box img {
    /* Ensures the image fills the entire square box, cropping as needed */
    width: 100%;
    height: 100%;
    object-fit: cover;

    display: block;
    /* REMOVE all panning related styles */
    transform: none;
    transition: none;
}

/* Media Query to switch to 1 image per line on small screens */
@media (max-width: 600px) {
    .image-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }
}

/*====================================================================
  "MORE IMAGES" BUTTON
======================================================================*/

.button-container {
    /* Center the button container horizontally */
    width: 100%;
    text-align: center;

    /* Add top margin to separate it from the image grid */
    margin-top: 40px;
    margin-bottom: 20px;
}

.more-images-button {
    /* Styling to match a bold, dark, colonial feel */
    display: inline-block;
    padding: 12px 30px;

    /* Colors */
    background-color: #333333;
    /* Dark gray/black background */
    color: #ffffff;
    /* White text */

    /* Typography */
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;

    /* Shape and Transition */
    border-radius: 5px;
    border: 2px solid #333333;
    /* Solid border for definition */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.more-images-button:hover {
    /* Hover effect: reverse the colors for interaction */
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
}

/*====================================================================
  HEADER & NAVIGATION (Top Bar)
======================================================================*/

.navigation-bar {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.spacer {
    display: none;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.main-logo {
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 100%;
}

.Logo-text {
    font-family: 'Times New Roman', Times, serif;
    color: white;
    font-size: 1.5em;
    margin: 0;
    padding: 0;
    font-weight: 500;
}

.principal-menu {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.principal-menu li a {
    color: #ffffff;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 0.9em;
    padding: 8px 12px;
    transition: color 0.3s ease;
}

.principal-menu li:last-child a {
    background-color: white;
    color: black;
    padding: 8px 15px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

/*====================================================================
  MAIN HERO CONTENT (Sizing for full screen)
======================================================================*/

main {
    height: 20%;
    /* Keep your desired 20% height */

    /* ADD VERTICAL PADDING to create more space above and below the content */
    padding-top: 50px;
    padding-bottom: 50px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    flex-grow: 0;
    padding-left: 20px;
    /* Keep horizontal padding */
    padding-right: 20px;
    /* Keep horizontal padding */

    text-align: center;
    width: 100%;
}

/* Responsive Typography using Viewport Units (vw) */
h1 {
    color: white;
    font-family: Georgia, 'Times New Roman', Times, serif;
    /* Remove fixed pixel font size for better responsiveness */
    font-size: min(5.5vw, 90px);
    /* Fluid scaling for large text */
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.1em;
    line-height: 1.1;
    max-width: 1000px;
}

.secondary-title {
    color: white;
    font-family: 'Times New Roman', Times, serif;
    /* Use a combination of vw and px for better control */
    font-size: min(1.8vw, 24px);
    font-weight: normal;
    text-align: center;
    margin-bottom: 30px;

    background-color: transparent !important;
    padding: 0;
    border-radius: 0;
    width: auto !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.main-text {
    color: white;
    font-family: 'Times New Roman', Times, serif;
    font-size: min(1.2vw, 20px);
    line-height: 1.4;
    text-align: center;

    backdrop-filter: none;
    background-color: transparent !important;
    box-shadow: none !important;
    width: 80%;
    max-width: 600px;
    margin: 0 auto 50px auto;
    padding: 0;
}

/* Centered navigation links */
.navigation-links {
    /* KEY FIX 5: Use max-width for PC/Desktop and increase it */
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
    background-color: rgba(206, 201, 201, 0.226);
    border-radius: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    box-shadow: 10 10 10px rgba(0, 0, 0, 0.3);

    position: relative;

    backdrop-filter: blur(5px);
    box-shadow: 10 10 10px rgba(0, 0, 0, 0.3);
}

.navigation-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* KEY CHANGE: Default layout is horizontal (PC/Desktop) */
    flex-direction: row;
    justify-content: center;
    align-items: center;
    /* Reduce gap for horizontal layout */
    gap: 20px;
}

.navigation-links li a {
    display: block;
    /* Makes the link take up full width of the list item */
    width: auto;
    text-align: center;
    /* Center the text */
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    font-size: 18px;
    /* Use fixed size for stability */
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navigation-links li a:hover {
    background-color: rgba(255, 255, 255, 0.589);
    color: black;
}

@media (max-width: 768px) {

    /* Make the navigation container wider on mobile to use more screen space */
    .navigation-links {
        width: 80%;
    }

    /* KEY CHANGE: Force vertical stacking for mobile screens */
    .navigation-links ul {
        flex-direction: column;
        gap: 10px;
        /* Tighter spacing for mobile list */
    }

    /* Force list items to span the full width of the container on mobile */
    .navigation-links li {
        width: 100%;
    }
}

/*====================================================================
  VIDEO SECTION 
======================================================================*/

.video-section {
    /* KEY FIX 6: Use a responsive max-width, and a smaller width for mobile */
    max-width: 800px;
    width: 80%;

    margin: 0 auto 40px auto;

    border: 10px solid rgb(44, 41, 41);
    /* Dark border */
    border-radius: 20px;
    /* Rounded corners */

    padding: 0;
    overflow: hidden;
    height: auto;

    min-height: 300px;
}

.full-width-video {
    width: 100%;
    height: 100%;
    display: block;
}

/*====================================================================
  MEDIA QUERIES (Mobile Adjustments)
======================================================================*/

@media (max-width: 768px) {

    /* --- NAVIGATION BAR --- */
    .navigation-bar {
        /* Stack header items vertically */
        position: relative;
        flex-direction: column;
        padding: 15px 10px;
    }

    .principal-menu {
        /* Reduce menu gap and space them out */
        gap: 15px;
        justify-content: center;
        margin-top: 10px;
    }

    /* --- HERO CONTENT SCALING --- */
    h1 {
        /* Increase fluid scaling for smaller screens */
        font-size: 10vw;
    }

    .secondary-title {
        font-size: 3vw;
    }

    .main-text {
        font-size: 3.5vw;
        max-width: 90%;
    }

    /* --- VIDEO SECTION --- */
    .video-section {
        margin: 20px auto 40px auto;
        width: 95%;
    }

    .navigation-links {
        width: 90%;
    }

    .navigation-links li a {
        font-size: 2.5vw;
    }
}

/*====================================================================
  TERCERO SECTION (Creative History Grid)
======================================================================*/

.tercero {
    color: #f0f0f0;
    /* KEY FIX 7: Use consistent horizontal padding and max-width */
    padding: 100px 20px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

/* --- INTRO TEXT STYLING AND SPACING --- */
.history-grid-container {
    width: 100%;
    margin: 0;
    /* KEY FIX 8: Add an inner max-width to control the text width */
    max-width: 1200px;
}

.history-intro {
    width: 100%;
    /* Increased spacing below the introduction */
    margin: 0 0 70px 0;
    text-align: left;
    /* Ensure text is left-aligned */
    color: #e0b060;
}

.history-intro h2 {
    font-family: Georgia, serif;
    font-size: 2.5em;
    font-weight: 300;
    color: #e0b060;
    text-align: left;
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 10px;
}

.history-intro p {
    text-align: left;
}

/* --- THE CORE GRID LAYOUT (6 BOXES) --- */
.history-boxes {
    /* KEY FIX 9: Center the column layout and set an inner max-width */
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;

    column-count: 2;
    column-gap: 20px;
}


/* --- INDIVIDUAL BOX STYLING --- */
.history-box {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;

    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: auto;
    box-sizing: border-box;
    border: 1px solid rgb(0, 0, 0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

    background-color: rgba(0, 0, 0, 0.774);
    padding: 25px;
    border-radius: 5%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.history-box.appear {
    opacity: 1;
    transform: translateY(0);
}

.history-box img {
    width: 100%;
    /* Let the image determine its height based on its aspect ratio */
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border-radius: 5%;
    /* Reduced margin below image to control spacing */
    margin-bottom: 10px;
    display: block;
}

/* Ensure text is on top of the blurred background */
.box-text {
    position: relative;
    z-index: 2;
    color: #f0f0f0;

    /* KEY FIX: Remove any default browser padding/margin conflicts here */
    padding: 0;
    margin: 0;
}

.box-text h3 {
    font-size: 1.2em;
    font-weight: bold;
    color: #e0b060;
    /* KEY FIX: Strict margins to ensure no default spacing pushes the title down */
    margin: 10px 0;
}

.box-text p {
    font-size: 0.9em;
    line-height: 1.4;
    /* KEY FIX: Strict margins to ensure no default spacing pushes the paragraph down */
    margin: 0;
}

/* --- MEDIA QUERY for Mobile --- */
@media (max-width: 768px) {
    .history-boxes {
        column-count: 1;
    }

    /* Reset height spans on mobile to ensure all boxes are uniform height */
    .tall-box,
    .medium-box,
    .short-box {
        grid-row-end: span 1;
    }

    .tercero {
        padding: 40px 20px;
        /* Reduce padding on mobile */
    }
}

/* --- HEIGHT VARIATIONS (Staggered Effect) --- */
/* The span is relevant only in a grid layout (not column-count), but keeping the classes for structure */
.tall-box {
    grid-row-end: span 4;
}

.medium-box {
    grid-row-end: span 3;
}

.short-box {
    grid-row-end: span 2.5;
}

.shortest-box {
    grid-row-end: span 2;
}

/*====================================================================
  REVIEWS SECTION (Luxury Style)
======================================================================*/

/*==========================================================
  REVIEWS CAROUSEL — Match White Text and Dark Luxury
===========================================================*/

.fourth {
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    padding-top: 10%;
    padding-bottom: 10%;
    text-align: center;
    /* KEY FIX 10: Ensures no internal element causes overflow */
    overflow-x: hidden;
}

.review-text {
    max-width: 800px;
    margin: 0 auto;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Image Styling */
.carousel-item img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border: 3px solid #e0b060;
    /* golden tone */
    box-shadow: 0 0 25px rgba(224, 176, 96, 0.3);
    margin: 0 auto 30px;
    border-radius: 50%;
}

/* Arrows */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(224, 176, 96, 0.7);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    background-size: 50%, 50%;
    box-shadow: 0 0 10px rgba(224, 176, 96, 0.4);
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(255, 215, 140, 0.9);
    box-shadow: 0 0 15px rgba(255, 215, 140, 0.8);
}

.carousel-control-prev,
.carousel-control-next {
    opacity: 1;
}

/*==========================================================
  REVIEWS INTRO SECTION — Luxury White-on-Black Style
===========================================================*/

.reviews-intro {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    text-align: center;
    padding: 120px 40px 100px 40px;
}

.reviews-intro .section-title {
    font-family: 'Georgia', serif;
    font-size: 3em;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 35px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.reviews-intro p {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.7em;
    font-style: italic;
    line-height: 1.8;
    color: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.6);
    /* translucent black box */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.reviews-intro,
.reviews-intro h2,
.reviews-intro p,
.review-text {
    color: #ffffff !important;
    text-shadow: none !important;
    font-weight: 400 !important;
}

/* ===== Fifth Section: Localization (MAP FIX) ===== */
.fifth {
    background-color: #111;
    /* same dark tone as other sections */
    color: #ffffff;
    padding: 100px 20px;
    font-family: 'Times New Roman', Times, serif;
}

.fifth .section-title {
    font-size: 3em;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.fifth p {
    font-size: 1.2em;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

iframe {
    width: 100%;
    height: 400px;
}

footer {
    font-size: 16px;
    line-height: 1.6;
    background-color: #111;
    color: white;
}

footer a:hover {
    text-decoration: underline;
    color: #ddd;
}