/* ============================================
   SECCIÓN OBRAS REALIZADAS - DISEÑO MEJORADO
   ============================================ */

.obras {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.obras::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #0ea5e9, transparent);
}

.section-header {
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
    border-radius: 2px;
}

.section-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin-top: 20px;
}

/* ============================================
   GRID DE OBRAS - DISEÑO COMPACTO
   ============================================ */

.obras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

/* TARJETA COMPACTA */
.obra-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: row;
    height: auto;
    min-height: 120px;
}

.obra-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.15);
    border-color: #0ea5e9;
}

/* IMAGEN PEQUEÑA A LA IZQUIERDA */
.obra-image {
    width: 120px;
    height: 120px;
    min-width: 120px;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.obra-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.obra-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 165, 233, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.obra-card:hover .obra-image::after {
    opacity: 1;
}

/* CONTENIDO A LA DERECHA */
.obra-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.obra-header {
    margin-bottom: 10px;
}

.obra-category {
    display: inline-block;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.obra-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.obra-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.obra-client {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.obra-client strong {
    color: #1e293b;
    font-weight: 600;
}

.obra-date {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.obra-date i {
    font-size: 0.75rem;
}

/* BOTÓN VER MÁS */
.obra-btn-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.obra-btn {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    flex-grow: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.obra-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, #06b6d4, #0284c7);
}

.obra-btn i {
    font-size: 0.75rem;
}

/* ============================================
   MODAL MEJORADO
   ============================================ */

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    border: none;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 700;
    font-size: 1.5rem;
}

.obra-modal-content {
    padding: 20px;
}

.obra-modal-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.obra-modal-info {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    margin-bottom: 20px;
}

.obra-modal-info p {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.obra-modal-info p:last-child {
    margin-bottom: 0;
}

.obra-modal-info strong {
    color: #1e293b;
    font-weight: 600;
}

.obra-modal-info span {
    color: #475569;
}

.obra-modal-descripcion {
    margin-top: 20px;
}

.obra-modal-descripcion h6 {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.obra-modal-descripcion p {
    color: #475569;
    line-height: 1.8;
    text-align: justify;
    font-size: 0.95rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
}

/* ============================================
   SECCIÓN ÚLTIMAS OBRAS (ACCORDION)
   ============================================ */

.obras-accordion-section {
    padding: 60px 0;
    background: white;
    position: relative;
}

.obras-accordion-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #0ea5e9, transparent);
}

.accordion-expand-btn {
    display: inline-block;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: 20px;
}

.accordion-expand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .obras {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .obras-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .obra-card {
        min-height: 100px;
    }

    .obra-image {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }

    .obra-body {
        padding: 12px;
    }

    .obra-title {
        font-size: 0.95rem;
    }

    .obra-client,
    .obra-date {
        font-size: 0.8rem;
    }

    .obra-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .modal-dialog {
        margin: 20px;
    }

    .modal-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .obras-grid {
        gap: 12px;
    }

    .obra-image {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    .obra-body {
        padding: 10px;
    }

    .obra-title {
        font-size: 0.9rem;
    }

    .obra-category {
        font-size: 0.6rem;
        padding: 2px 8px;
    }

    .obra-client,
    .obra-date {
        font-size: 0.75rem;
    }

    .obra-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}
