/* ==========================================================================
   VARIABLES GLOBALES Y RESETEO
   ========================================================================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: white;
    text-align: center;
}

#contenido {
    margin-top: 50px;
    margin-bottom: 120px;
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN
   ========================================================================== */
header {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #222;
}

header h1 {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: block;
    margin: 10px auto;
    max-width: 140px;
    height: auto;
    border-radius: 15px;
}

nav {
    margin-left: 20px;
    margin-right: 50px;
    width: 100%;
    text-align: center;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
}

nav ul li a.active {
    color: #d4a373 !important;
    font-weight: bold;
}

/* ==========================================================================
   PÁGINA PRINCIPAL (INDEX)
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 30px;
    background: rgba(0, 0, 0, 0.05);
}

.cta-button {
    background-color: #d4af37;
    color: #fff;
    padding: 10px 22px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    background-color: #bfa030;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   PÁGINA DE CONTACTO Y RESERVAS
   ========================================================================== */
.contacto {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    color: white;
    align-items: center;
    justify-content: center;
    max-width: 80%;
    margin: auto;
    margin-bottom: 150px;
}

.contacto .direccion {
    flex: 1;
    text-align: left;
    font-size: 18px;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
}

.contacto iframe {
    flex: 1;
    max-width: 100%;
    height: 400px;
    border-radius: 10px;
    min-width: 300px;
}

/* Buscador de Citas y Tickets */
.buscador-citas {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #444;
    margin-bottom: 20px;
}

.card-cita {
    background: #222;
    padding: 15px;
    border-left: 4px solid #d4af37;
    margin-top: 10px;
    border-radius: 5px;
}

.aviso-sin-citas {
    background: #3b1616;
    color: #ff8080;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    border: 1px solid #631717;
}

.btn-buscar {
    background-color: #d4af37;
    color: black;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.ticket-proxima-cita {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #d4a373;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ticket-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #d4a373;
}

.ticket-header h4 {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticket-body p {
    margin: 5px 0;
    color: #444;
}

.ticket-nota {
    font-size: 0.85em;
    font-style: italic;
    color: #888 !important;
    margin-top: 10px !important;
}

/* Acciones Cita */
.cita-acciones {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.btn-modificar {
    background-color: #d4a373;
    color: #111111;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.btn-modificar:hover {
    background-color: #b58555;
    color: #fff;
}

.btn-eliminar {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-eliminar:hover {
    background-color: #a71d2a;
}

/* Formulario Reserva */
.reserva-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    max-width: 90%;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    color: #333;
}

.btn-reservar {
    background-color: #d4a373 !important;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 90%;
}

.tlfno {
    color: white;
}

/* ==========================================================================
   CALENDARIO DE CITAS
   ========================================================================== */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    max-width: 100%;
}

.dia-itv {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background-color: #2c2c2c;
    color: #fff;
}

.dia-nombre {
    display: block;
    font-size: 0.85em;
    text-transform: uppercase;
}

.dia-numero {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 5px;
}

.dia-itv.disponible { border-color: #28a745; background-color: rgba(40, 167, 69, 0.1); }
.dia-itv.disponible:hover { background-color: #28a745; color: #fff; }
.dia-itv.ocupado { border-color: #dc3545; background-color: rgba(220, 53, 69, 0.15); color: #888; cursor: not-allowed; opacity: 0.6; }
.dia-itv.active { background-color: #e0a800; border-color: #e0a800; color: #000; font-weight: bold; }

/* Cuadrícula de Horas */
.horas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.hora-btn {
    padding: 10px 5px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
    border: 1px solid #28a745;
    color: #fff;
    font-weight: bold;
    font-size: 0.95em;
}

.hora-btn:hover { background-color: rgba(40, 167, 69, 0.2); }
.hora-btn.active { background-color: #e0a800; border-color: #e0a800; color: #000; }

/* ==========================================================================
   LOGIN / PROMPT
   ========================================================================== */
.login-prompt {
    margin: 20px 0;
    text-align: center;
}

.login-prompt p {
    color: #ffffff;
    font-size: 1.1rem;
}

.btn-highlight {
    color: #ffcc00;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 10px;
    border-bottom: 2px solid #ffcc00;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-highlight:hover {
    color: #ffffff;
    background-color: #ffcc00;
    border-radius: 5px;
    transform: scale(1.1);
    box-shadow: 0px 4px 15px rgba(255, 204, 0, 0.4);
}

/* ==========================================================================
   PÁGINA SERVICIOS
   ========================================================================== */
.servicios-seccion {
    text-align: center;
    padding: 40px 20px;
}

.cuadro-precios {
    position: relative;
    width: 90%;
    max-width: 700px;
    margin: 40px auto 150px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background-image: url('../img/fondo2.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.overlay-precios {
    background: rgba(214, 204, 191, 0.85);
    padding: 40px;
    height: 100%;
}

.cuadro-precios h3 {
    font-size: 32px;
    font-family: 'Georgia', serif;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cuadro-precios .blanco { color: #ffffff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); }
.cuadro-precios .negro { color: #1a1a1a; }

.lista-servicios { list-style: none; padding: 0; margin: 0; }
.lista-servicios li {
    font-size: 1.2rem;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    color: #333;
}
.lista-servicios li:last-child { border-bottom: none; }

.servicio-nombre { font-weight: bold; text-align: left; }
.servicio-precio { font-weight: 800; background: rgba(0, 0, 0, 0.05); padding: 5px 12px; border-radius: 5px; }
.sin-servicios { font-style: italic; color: #666; }

/* ==========================================================================
   PÁGINA GALERÍA
   ========================================================================== */
.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    justify-items: center;
    margin-bottom: 150px;
}

.foto {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
}

.foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.paginacion { text-align: center; margin: 20px 0; }
.flecha {
    text-decoration: none;
    font-size: 18px;
    padding: 10px 15px;
    background: #8B4513;
    color: white;
    border-radius: 5px;
    margin: 0 10px;
}
.flecha:hover { background: #A0522D; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.imagen-ampliada { max-width: 80%; max-height: 80%; object-fit: contain; }
.cerrar { position: absolute; top: 10px; right: 10px; font-size: 30px; color: white; cursor: pointer; }

@media (min-width: 768px) {
    .modal.mostrar { display: flex; 
    }
}

/* Herramientas de Admin en Galería */
.admin-upload-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 2px dashed #8B4513;
    background-color: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
}
.admin-upload-section h3 { margin-top: 0; color: #f5a623; }

.admin-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.foto:hover .admin-controls-overlay,
.admin-controls-overlay:active {
    opacity: 1;
    pointer-events: auto;
}

.btn-borrar {
    align-self: flex-end;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.form-modificar { background: rgba(0, 0, 0, 0.7); padding: 5px; border-radius: 5px; display: flex; gap: 5px; align-items: center; }
.input-orden { width: 60px; padding: 4px; border-radius: 3px; border: 1px solid #8B4513; background: #222; color: white; }
.btn-modificar { background: #f5a623; color: black; border: none; padding: 4px 8px; border-radius: 3px; font-size: 12px; cursor: pointer; font-weight: bold; }

/* ==========================================================================
   MENSAJES Y ALERTAS (FLASH)
   ========================================================================== */
.flash-messages { color: white; }
.maximo { display: flex; justify-content: center; align-items: center; }
.flash-item { color: rgb(206, 174, 174); font-size: 35px; }

.alerta-confirmacion {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.alerta-contenido { font-size: 1.1em; line-height: 1.6; }
.icono-check { font-size: 2em; display: block; margin-bottom: 10px; }
.alerta-confirmacion strong { font-size: 1.3em; }

/* ==========================================================================
   FOOTER - PROFESIONAL Y FIJO
   ========================================================================== */
.main-footer {
    background-color: #1a1a1a; /* Forzamos el color oscuro */
    border-top: 1px solid #333;
    padding: 15px 0;
    text-align: center;
    
    /* Fijado abajo */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.footer-content p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.footer-enlaces {
    display: flex;
    align-items: center;
    gap: 15px;
}

.instagram-link, .enlace-valorar {
    color: #d4a373;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.instagram-link:hover, .enlace-valorar:hover {
    color: #ffffff;
}

.separador {
    color: #444;
}

/* ==========================================================================
   AJUSTES MÓVIL (MEDIA QUERY)
   ========================================================================== */
@media (max-width: 768px) {
    /* IMPORTANTE: Añadir padding al body para que el footer no tape el contenido */
    body {
        padding-bottom: 100px; 
    }

    .footer-content {
        flex-direction: column; /* Apila elementos */
        gap: 8px;
    }

    .footer-enlaces {
        gap: 5px;
    }

    .footer-content p {
        font-size: 0.75rem; /* Letra más chica */
    }

    .instagram-link, .enlace-valorar {
        font-size: 0.8rem; /* Letra más chica */
    }

    .separador {
        display: none; /* Quitamos la barra "|" en móvil */
    }
    .dia-itv{
        width: 24px;
        height: 40px;
        font-size: 12px;
    }
}


@media (max-width: 600px) {
    /* Servicios */
    .cuadro-precios { width: 100%; }
    .overlay-precios { padding: 20px; }
    .lista-servicios li { font-size: 1rem; }

    /* Footer */
    .main-footer { padding: 10px 0; }
    .footer-content { flex-direction: column; gap: 8px; }
    .footer-enlaces { font-size: 12px; gap: 8px; }
    .instagram-link, .enlace-valorar { padding: 4px 0; }
}