/* Importar fuente */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6;
    line-height: 1.6;
}

/* NAVBAR */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

body > nav {
    background: rgba(255, 255, 255, 0.95);
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body > nav {
    position: sticky;
}

header nav {
    position: relative;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: #0077be;
    text-decoration: none;
    order: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    order: 2;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #0077be;
}

/* HERO SECTION */
header {
    background: linear-gradient(rgba(0,20,40,0.6), rgba(0,20,40,0.6)),
                url('images/paisaje\ 1.jpg');
    background-size: cover;
    background-position: center;
    height: 40vh;
    display: flex;
    flex-direction: column;
    color: white;
    text-align: center;
}

/* Imagen específica para la página de Quién Soy */
#header-sobre-mi {
    background: linear-gradient(rgba(0,20,40,0.6), rgba(0,20,40,0.6)),
                url('images/buceo\ loco.jpg');
                 background-size: cover;
    background-position: center;
    height: 40vh;
    display: flex;
    flex-direction: column;
    color: white;
    text-align: center;
}

header nav {
    background: transparent;
    height: auto;
    padding: 20px 5%;
    position: relative;
    top: 0;
    box-shadow: none;
    margin-bottom: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header nav .logo {
    color: white;
    order: 1;
}

header nav .nav-links {
    order: 2;
}

header nav .nav-links a {
    color: white;
}

header nav .nav-links a:hover {
    color: #0077be;
}

header > h1,
header > p {
    margin-bottom: auto;
    margin-top: auto;
}

/* Contenedor principal para alinear tarjetas */
.contenedor-proyectos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    padding: 30px 1.5%;
    max-width: 100vw;
}

/* La Tarjeta */
.tarjeta {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column; /* Foto arriba, texto abajo */
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tarjeta:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.tarjeta img {
    width: 100%;
    height: auto;
    display: block;
}

/* Sección de contenido */
section {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

section p {
    text-align: justify;
    line-height: 1.6;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .contenedor-proyectos {
        gap: 20px;
        padding: 30px 3%;
    }
    .tarjeta {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .contenedor-proyectos {
        gap: 15px;
    }
    .texto-box {
        padding: 18px;
    }
}

/* Control de Imágenes */
.imagen-box {
    float: left;
    width: 53%;
    margin: 0 25px 25px 0;
}

.imagen-box:nth-child(even) {
    float: right;
    margin: 0 0 25px 25px;
}

.imagen-box img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.imagen-box img:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

/* Control de Textos */
.texto-box {
    padding: 25px;
}

.texto-box p {
    color: #555;
    line-height: 1.8;
    text-align: justify; /* Aquí tienes el justificado */
    hyphens: auto;       /* Evita huecos grandes al justificar */
    margin-bottom: 20px;
}

.texto-box h3 {
    margin-top: 0;
    color: #004d40;
}



.punto-buceo {
    display: flex;
    align-items: stretch; /* Esto hace que ambos lados tengan la misma altura */
    gap: 20px;            /* Espacio entre la foto y el texto */
    margin-bottom: 30px;
    max-width: 800px;     /* O el ancho que prefieras para tu web */
}

.foto-buceo {
    flex: 1;              /* Ajusta el ancho de la foto */
    min-width: 200px;
}

.foto-buceo img {
    width: 100%;
    height: 100%;
    object-fit: cover;    /* Clave: hace que la foto rellene el hueco sin deformarse */
    border-radius: 8px;   /* Opcional: para suavizar las esquinas */
}

.texto-buceo {
    flex: 2;              /* El texto ocupa un poco más de espacio que la foto */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra el texto verticalmente si hay poco contenido */
}

.texto-buceo h3 {
    margin-top: 0;        /* Quita el espacio extra arriba del título */
}



/* Contenedor de cada bloque de zona de buceo */
.zona-buceo {
    max-width: 600px;
    margin: 20px auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.zona-header {
    background-color: #00509d;
    color: white;
    padding: 15px;
    text-align: center;
}

.zona-header h2 { margin: 0; font-size: 20px; }
.zona-header p { margin: 5px 0 0; font-size: 14px; opacity: 0.9; }

.lista-precios { padding: 15px; }

/* Fila de precio */
.item-precio {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.item-precio:last-child { border-bottom: none; }

.precio-valor {
    font-weight: bold;
    color: #00509d;
}

/* Colores por tipo de salida */
.playa { border-top: 8px solid #2B3571; }
.barco { border-top: 8px solid #FFADAD; }

.tabla-precios {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tabla-precios th {
    background-color: #f8f9fa;
    font-size: 0.8rem;
    color: #666;
    padding: 10px;
    text-align: right;
}

.tabla-precios td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: right;
    font-size: 0.9rem;
}

/* Alinea el texto del servicio a la izquierda */
.tabla-precios td:first-child, 
.tabla-precios th:first-child {
    text-align: left;
    font-weight: 500;
}

.precio { font-weight: bold; color: #00509d; }

/* RESPONSIVE MÓVIL */
@media (max-width: 600px) {
    /* Navbar responsive */
    nav {
        padding: 0 3%;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: 10px;
        font-size: 0.85rem;
    }

    /* Contenedor proyectos vertical en móvil */
    .contenedor-proyectos {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 20px 5%;
    }

    .tarjeta {
        width: 100%;
        max-width: none;
    }

    /* Tablas responsive VERTICAL en móvil */
    .tabla-precios {
        display: block;
        width: 100%;
        border: none;
    }

    .tabla-precios thead {
        display: none;
    }

    .tabla-precios tbody {
        display: block;
    }

    .tabla-precios tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background-color: #f9f9f9;
    }

    .tabla-precios td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .tabla-precios td:last-child {
        border-bottom: none;
    }

    .tabla-precios td:first-child {
        font-weight: bold;
        color: #333;
        margin-bottom: 5px;
    }

    .tabla-precios td.precio {
        color: #00509d;
        font-weight: bold;
    }

    /* Zona buceo */
    .zona-buceo {
        margin: 15px auto;
    }

    .zona-header h2 {
        font-size: 16px;
    }

    .zona-header p {
        font-size: 12px;
    }

    /* Imagen float */
    .imagen-box {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }

    .imagen-box:nth-child(even) {
        float: none;
        margin: 0 0 20px 0;
    }

    /* Punto de buceo */
    .punto-buceo {
        flex-direction: column;
        gap: 10px;
    }

    .foto-buceo {
        min-width: auto;
        height: 250px;
    }

    /* Header responsivo */
    header {
        height: 30vh;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    /* Botón responsivo */
    a[style*="background-color: #ffadad"] {
        padding: 12px 25px;
        font-size: 0.85rem;
    }

    /* Sección principal */
    section {
        padding: 20px 10px;
    }
}
