/* --- ESTILOS COMPLETOS Y DEFINITIVOS PARA CARPINTERÍA TORNAY --- */

/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #2c3e50; /* Azul oscuro */
    --secondary-color: #34495e; /* Azul más claro */
    --accent-color: #c0392b;   /* Rojo/Terracota */
    --text-color: #333;
    --light-bg-color: #f4f4f4;
    --white-color: #ffffff;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Ajuste para el menú fijo */
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    margin: 0;
    color: var(--text-color);
    background-color: var(--white-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2 {
    font-family: 'Merriweather', serif;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

/* --- Cabecera y Navegación --- */
.main-header {
    background-color: var(--white-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-height: 60px;
}

.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-menu li a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    padding: 10px 20px;
    transition: color 0.3s;
}

.main-menu li a:hover {
    color: var(--accent-color);
}

.mobile-menu-button {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Sección Hero (Solo para index.html) --- */
.hero {
    color: var(--white-color);
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin: 0;
}

.button {
    background-color: var(--accent-color);
    color: var(--white-color);
    padding: 12px 25px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    margin-top: 20px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.button:hover {
    background-color: #a5281b;
}

/* --- Secciones Generales de Contenido --- */
section {
    padding: 80px 0;
}
section:nth-child(even) {
    background-color: var(--light-bg-color);
}

/* --- TARJETAS DE SERVICIOS (INDEX.HTML) --- */
.services-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.service-card {
    display: flex;
    align-items: flex-end;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    color: var(--white-color);
    background-size: cover;
    background-position: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.service-card-overlay {
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
}

.service-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
    color: var(--white-color);
}

.service-card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

/* --- GALERÍA DE IMÁGENES Y LIGHTBOX --- */
.gallery-section {
    background-color: var(--light-bg-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-color: #f8f8f8;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
}

@keyframes zoomIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

.prev-lightbox,
.next-lightbox {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -30px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next-lightbox {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev-lightbox {
    left: 0;
}

.prev-lightbox:hover,
.next-lightbox:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* --- Pie de Página (Footer) --- */
footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-align: center;
    padding: 50px 20px;
}
footer h2 {
    color: var(--white-color);
}
footer a {
    color: var(--white-color);
    font-weight: bold;
}
.social-links {
    margin: 20px 0;
}
.social-icon img {
    width: 30px;
    height: 30px;
    transition: opacity 0.3s;
}
.social-icon img:hover {
    opacity: 0.8;
}
.copyright {
    font-size: 0.9em;
    color: #bdc3c7;
    margin-top: 30px;
}

/* --- PÁGINAS DE CONTENIDO (Historia, Clientes, etc.) --- */
.page-header {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 30px 0;
    text-align: center;
    margin-bottom: 0;
}

.page-header h1 {
    margin: 0;
    font-size: 2.8rem;
    color: var(--white-color);
}

.page-content {
    padding: 30px 20px;
    margin-top: 0;
}

.text-container {
    max-width: 800px;
    margin: 0 auto;
}

.text-container p {
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    color: #444;
}

.centered-text {
    text-align: center;
}

/* --- PÁGINA DE OFERTAS --- */
.offer-featured {
    text-align: center;
    background-color: var(--light-bg-color);
    padding: 40px 20px;
    border-radius: 8px;
    margin-bottom: 60px;
}
.offer-featured h2 {
    margin-top: 0;
    color: var(--accent-color);
}
.door-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}
.door-gallery figure {
    margin: 0;
    text-align: center;
}
.door-gallery img {
    max-width: 115px;
    height: auto;
    border: 3px solid var(--white-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.door-gallery figcaption {
    margin-top: 10px;
    font-weight: bold;
}
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.offer-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    min-height: 400px;
}
.offer-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f8f8;
}
.offer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.offer-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.offer-title {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.offer-description {
    flex-grow: 1;
    margin-bottom: 20px;
}
.offer-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: right;
    margin-top: auto;
}

/* --- PÁGINA DE CONTACTO (FORMULARIO) --- */
.contact-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}
.contact-details {
    flex: 1 1 400px;
}
.contact-details h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
}
.contact-details address {
    font-style: normal;
    line-height: 1.8;
}
.contact-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin-top: 20px;
    border-radius: 8px;
}
.contact-form-container {
    flex: 1 1 400px;
}
.contact-form .form-group {
    margin-bottom: 20px;
}
.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--primary-color);
}
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(44, 62, 80, 0.2);
}
.contact-form button {
    width: 100%;
    border: none;
    cursor: pointer;
}

/* --- PÁGINA DE REPARACIÓN --- */
.two-column-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}
.two-column-layout .column {
    flex: 1 1 300px;
}
.content-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.service-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2em;
}
.service-list li {
    padding-left: 1.5em;
    position: relative;
    margin-bottom: 0.5em;
}
.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* --- PÁGINA DE DECORACIÓN / RESTAURACIÓN --- */
.project-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 30px;
}
.project-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 60px auto;
    max-width: 200px;
}

/* --- PÁGINA DE PRESUPUESTO (CONFIGURADOR AVANZADO) --- */
.form-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 60px 0;
}
.configurador-armario {
    margin-top: 40px;
}
.lienzo-diseno {
    border: 2px dashed var(--accent-color);
    border-radius: 8px;
    min-height: 350px;
    padding: 15px;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 5px;
    background-color: #fff;
    overflow-x: auto;
    margin-bottom: 30px;
}
.lienzo-diseno p {
    margin: auto;
    color: #aaa;
    font-size: 1.2rem;
}
.lienzo-diseno img {
    height: 95%;
    width: auto;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
}
.lienzo-diseno.drag-over {
    background-color: #f0fff0;
    border-style: solid;
}
.paleta-modulos {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.paleta-modulos h4 {
    width: 100%;
    margin-top: 0;
    text-align: center;
    margin-bottom: 10px;
}
.paleta-modulos img {
    height: 160px;
    width: auto;
    cursor: grab;
    border: 1px solid #eee;
    background-color: white;
    border-radius: 4px;
}
.configurador-acciones {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 20px;
}
.button-secundario {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 12px 25px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
.button-secundario:hover {
    background-color: var(--primary-color);
}

/* --- PÁGINA DE PUERTAS (CATÁLOGOS) --- */
.catalogues-section {
    padding: 60px 0;
    background-color: var(--light-bg-color);
}
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}
.catalogue-card {
    display: block;
    background-color: var(--white-color);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.catalogue-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.catalogue-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-family: 'Merriweather', serif;
}
.catalogue-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: bold;
}

/* --- ESTILOS PARA CHECKBOX Y VALIDACIÓN DE FORMULARIO --- */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.form-group-checkbox label {
    margin-bottom: 0;
    font-weight: normal;
}
.form-group-checkbox label a {
    color: var(--accent-color);
    text-decoration: underline;
}
.form-submitted .form-group input:invalid,
.form-submitted .form-group textarea:invalid,
.form-submitted .form-group select:invalid {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(192, 57, 43, 0.5);
}


/* --- DISEÑO ADAPTABLE (Responsive) --- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .main-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 80px;
        left: 0;
        background-color: var(--white-color);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .main-menu.active {
        display: flex;
    }

    .main-menu li {
        width: 100%;
        text-align: center;
    }

    .main-menu li a {
        padding: 15px;
        border-bottom: 1px solid #eee;
    }

    .mobile-menu-button {
        display: block;
    }
}
/* --- ESTILOS PARA EL BANNER DE COOKIES --- */

.cookie-banner {
    display: none; /* Oculto por defecto, JS lo mostrará */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px 20px;
    z-index: 3000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner p {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.cookie-banner a {
    color: var(--white-color);
    text-decoration: underline;
    font-weight: bold;
}

.cookie-banner .button {
    margin: 0;
    padding: 8px 20px;
    flex-shrink: 0;
}