/* ============================================
   PROYECTOS - ESTILOS LIMPIOS (VERSIÓN ÚNICA)
   Basado en HTML actual + script original
   ============================================ */

/* ========== VARIABLES (heredan de style.css, pero las definimos por si acaso) ========== */
:root {
    --oro: #a69177;
    --oro-oscuro: #8e7955
    ;
    --fondo: #0a0a0a;
    --gris: #1a1a1a;
    --borde: #2a2a2a;
    --blanco: #ffffff;
    --texto-gris: #b0b0b0;
    --transition: all 0.3s ease;
}

/* ========== FILTROS ========== */
.filters-section {
    padding: 80px 5% 40px;
    text-align: center;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid var(--borde);
    color: var(--blanco);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--oro);
    color: var(--fondo);
    border-color: var(--oro);
}

/* ========== GRID DE PROYECTOS ========== */
.projects-gallery {
    padding: 40px 5%;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== TARJETA DE PROYECTO (clases del script) ========== */
.project-item {
    background: var(--gris);
    border: 1px solid var(--borde);
    border-radius: 1px;      /* Valor agudo, casi sin redondeo */
    overflow: hidden;
    transition: var(--transition);
}

.project-item:hover {
    transform: translateY(-5px);
    border-color: var(--oro);
    box-shadow: 0 10px 30px rgba(197, 160, 89, 0.1);
}

.project-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-image:hover .project-overlay {
    opacity: 1;
}

.btn-view {
    padding: 0.8rem 1.5rem;
    background: var(--oro);
    border: none;
    color: var(--fondo);
    cursor: pointer;
    font-weight: 600;
    border-radius: 30px;
    transition: var(--transition);
}

.btn-view:hover {
    background: var(--oro-oscuro);
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    text-align: center;
}

.project-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--oro);
}

.project-info p {
    color: var(--texto-gris);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Contenedor del botón */
.load-more-container {
    display: flex;
    justify-content: center;  /* Centra horizontalmente */
    align-items: center;
    margin-top: 3rem;        /* Separación superior respecto a las cards */
    margin-bottom: 2rem;     /* Separación inferior si es necesario */
    width: 100%;
}

/* El botón en sí (si quieres darle un ancho máximo o ajustar padding) */
#btn-cargar-mas {
    display: inline-block;
    margin: 0 auto;          /* Centrado adicional por si acaso */
    padding: 0.8rem 2rem;    /* Ajusta según tu diseño */
    /* Si quieres que no ocupe todo el ancho, añade: */
    width: auto;
    min-width: 200px;
}
/* ========== MODAL DE PROYECTO ========== */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.project-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--gris);
    padding: 2rem;
    border-radius: 1px;
    border: 1px solid var(--oro);
}

/* Personalización de la barra de scroll para los modales */
.project-modal-content::-webkit-scrollbar,
.modal-proyecto-content::-webkit-scrollbar {
    width: 8px;               /* Grosor de la barra vertical */
}

.project-modal-content::-webkit-scrollbar-track,
.modal-proyecto-content::-webkit-scrollbar-track {
    background: #2a2a2a;      /* Color del fondo del carril */
    border-radius: 10px;
}

.project-modal-content::-webkit-scrollbar-thumb,
.modal-proyecto-content::-webkit-scrollbar-thumb {
    background: #a69177;      /* Color del mango (dorado) */
    border-radius: 10px;
}

.project-modal-content::-webkit-scrollbar-thumb:hover,
.modal-proyecto-content::-webkit-scrollbar-thumb:hover {
    background: #8e7955;      /* Color al pasar el ratón */
}

/* 3. Botón de cierre sticky (siempre visible) - Versión mejorada */
.project-modal-close,
.close-proyecto-modal {
    position: sticky;
    top: 1px;           /* Antes 10px, ahora más arriba */
    right: 5px;        /* Nuevo: lo desplaza a la derecha */
    float: right;       /* Se mantiene para que el texto fluya, pero con right se ajusta */
    background: rgba(0, 0, 0, 0.7);
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    margin-bottom: 0;
    margin-right: 30px;  /* Pequeño margen adicional a la derecha */
    transition: all 0.2s ease;
    color: #fff;
}
.project-modal-close:hover,
.close-proyecto-modal:hover {
    background: var(--oro, #c5a059);
    transform: scale(1.05);
}

/* Galería dentro del modal (script usa .project-gallery y .gallery-item) */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 1px;
    aspect-ratio: 1 / 1;
}

.gallery-item img,
.gallery-item picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Títulos y textos dentro del modal (script genera h2 y p sin clases) */
#project-modal-body h2 {
    font-family: 'Playfair Display', serif;
    color: var(--oro);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#project-modal-body p {
    color: var(--texto-gris);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Ubicación (script genera inline style con color oro, lo forzamos) */
#project-modal-body p[style*="color"] {
    color: var(--oro) !important;
}

/* 2. Botón solicitar proyecto similar más pequeño y centrado */
.open-quote {
    width: auto !important;
    min-width: 200px;
    max-width: 305px;
    margin: 1rem auto 0 !important;
    display: block;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 40px;
}

.open-quote:hover {
    background: var(--oro-oscuro);
    transform: translateY(-2px);
}

/* ========== TARJETA DE RESEÑA (modal-review-card) ========== */
.modal-review-card {
    background: rgba(197, 160, 89, 0.1);
    border-left: 3px solid var(--oro);
    padding: 1.2rem;
    margin: 1rem 0;
    border-radius: 1px;
}

.review-stars {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.review-text {
    font-style: italic;
    color: var(--blanco);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: var(--oro);
    margin-bottom: 0.2rem;
}

.review-date {
    font-size: 0.7rem;
    color: var(--texto-gris);
}

/* ========== TARJETA DE DATOS TÉCNICOS (modal-tech-card) ========== */
.modal-tech-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--borde);
    padding: 1.2rem;
    margin: 1rem 0;
    border-radius: 1px;
}

.modal-tech-card h4 {
    color: var(--oro);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.tech-grid div {
    font-size: 0.85rem;
    color: var(--texto-gris);
}

.tech-note {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--borde);
}

/* ========== MODAL DE COTIZACIÓN (proyecto similar) ========== */
.modal-proyecto-cotizacion {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10002;
    align-items: center;
    justify-content: center;
}

.modal-proyecto-content {
    position: relative;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--gris);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--oro);
}

.close-proyecto-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--texto-gris);
    transition: var(--transition);
    z-index: 10;
}

.close-proyecto-modal:hover {
    color: var(--oro);
}

.proyecto-preview-box {
    text-align: center;
    margin-bottom: 1.5rem;
}

.proyecto-preview-box img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.proyecto-preview-box p {
    color: var(--oro);
    font-weight: 600;
}

.form-row-flex {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field-flex {
    flex: 1;
}

.form-field-full {
    margin-bottom: 1rem;
}

.modal-proyecto-content input,
.modal-proyecto-content textarea,
.modal-proyecto-content .input-file-custom {
    width: 100%;
    padding: 0.8rem;
    background: var(--fondo);
    border: 1px solid var(--borde);
    color: var(--blanco);
    border-radius: 8px;
    font-family: inherit;
}

.modal-proyecto-content input:focus,
.modal-proyecto-content textarea:focus {
    outline: none;
    border-color: var(--oro);
}

.file-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--texto-gris);
}

.btn-submit-full {
    background: var(--oro);
    color: var(--fondo);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 0.5rem;
}

.btn-submit-full:hover {
    background: var(--oro-oscuro);
    transform: translateY(-2px);
}

/* ========== LIGHTBOX ========== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10003;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2.5rem;
    color: var(--oro);
    cursor: pointer;
}

.lightbox-close:hover {
    color: #fff;
}

/* ========== CTA SECTION ========== */
.cta-section {
    padding: 80px 5%;
    background: linear-gradient(135deg, var(--gris) 0%, var(--fondo) 100%);
    text-align: center;
}

.cta-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--blanco);
}

.cta-content .btn-primary {
    background: var(--oro);
    color: var(--fondo);
    padding: 0.8rem 2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.cta-content .btn-primary:hover {
    background: var(--oro-oscuro);
    transform: translateY(-2px);
}

/* ========== LOADING ========== */
.projects-loading {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.projects-loading i {
    font-size: 2rem;
    color: var(--oro);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .filters-section {
        padding: 60px 5% 30px;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-modal-content {
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    #project-modal-body h2 {
        font-size: 1.4rem;
    }
    
    .project-gallery {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.8rem;
    }
    
    .modal-proyecto-content {
        padding: 1.5rem;
    }
    
    .form-row-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .lightbox-close {
        top: -35px;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .project-info h3 {
        font-size: 1rem;
    }
    
    .project-gallery {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
}