/* ========================================
   PORTFOLIO TRABAJOS - CSS MINIMALISTA ELEGANTE
   Pulidos Sabando
   ======================================== */

/* Variables de Colores */
:root {
    --primary-color: #2d2d2d;
    --secondary-color: #4a4a4a;
    --accent-color: #1a1a1a;
    --text-light: #ffffff;
    --text-dark: #2d2d2d;
    --gray: #7a7a7a;
    --light-gray: #fafafa;
    --border-color: #e5e5e5;
    
    /* Colores de acento suaves para categorías */
    --color-residencial: #2d2d2d;
    --color-comercial: #3a3a3a;
    --color-industrial: #4a4a4a;
    --color-restauracion: #1a1a1a;
    
    /* Estados */
    --color-before: #2d2d2d;
    --color-during: #4a4a4a;
    --color-after: #1a1a1a;
}

/* ========================================
   RESET Y BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--text-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   PAGE HEADER
   ======================================== */

.page-header {
    background: var(--primary-color);
    padding: 100px 20px 80px;
    text-align: center;
    color: var(--text-light);
    position: relative;
}

.page-header-content {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}

/* ========================================
   FILTROS
   ======================================== */

.portfolio-filters {
    background: var(--text-light);
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    background: var(--text-light);
    border-radius: 2px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

/* ========================================
   STATS SECTION
   ======================================== */

.stats-section {
    background: var(--light-gray);
    padding: 60px 20px;
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
}

.stat-number {
    font-size: 42px;
    font-weight: 300;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   PROJECTS SECTION
   ======================================== */

.projects-section {
    padding: 80px 20px;
    background: var(--text-light);
}

/* ========================================
   PROJECT CARD
   ======================================== */

.project-card {
    background: var(--text-light);
    border: 1px solid var(--border-color);
    margin-bottom: 80px;
    transition: box-shadow 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* ========================================
   ENCABEZADO DEL PROYECTO
   ======================================== */

.project-card-header {
    background: var(--primary-color);
    padding: 60px 40px;
    text-align: center;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.project-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    background: transparent;
    color: var(--text-light);
}

.project-card-title {
    font-size: 36px;
    font-weight: 300;
    margin: 15px 0;
    letter-spacing: -0.5px;
}

.project-card-subtitle {
    font-size: 16px;
    font-weight: 300;
    opacity: 0.85;
}

/* ========================================
   INFORMACIÓN DEL CLIENTE
   ======================================== */

.client-info-box {
    background: var(--light-gray);
    padding: 40px;
    border-bottom: 1px solid var(--border-color);
}

.client-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.info-icon {
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-light);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

.info-value {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 400;
}

/* ========================================
   FASES DEL PROYECTO
   ======================================== */

.project-phase {
    padding: 60px 40px;
    border-bottom: 1px solid var(--border-color);
}

.project-phase:last-of-type {
    border-bottom: none;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.phase-badge {
    padding: 8px 18px;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.before-badge {
    background: var(--color-before);
    border-color: var(--color-before);
}

.during-badge {
    background: var(--color-during);
    border-color: var(--color-during);
}

.after-badge {
    background: var(--color-after);
    border-color: var(--color-after);
}

.phase-title {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.3px;
}

.phase-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-weight: 300;
}

/* ========================================
   LISTA DE PROBLEMAS
   ======================================== */

.problems-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.problem-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--light-gray);
    border-left: 2px solid var(--primary-color);
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 300;
}

.problem-icon {
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* ========================================
   TIMELINE DEL PROCESO
   ======================================== */

.process-timeline {
    margin-bottom: 40px;
}

.timeline-step {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    width: 1px;
    height: calc(100% - 10px);
    background: var(--border-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--text-light);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 300;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.step-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray);
    margin: 0;
    font-weight: 300;
}

/* ========================================
   RESULTADOS COMPACTOS
   ======================================== */

.results-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.result-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--light-gray);
    border-left: 2px solid var(--primary-color);
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 300;
}

.result-icon-check {
    font-size: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
    font-weight: 400;
}

/* ========================================
   GALERÍAS DE IMÁGENES
   ======================================== */

.phase-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.phase-gallery.large {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--light-gray);
    transition: transform 0.3s ease;
}

.gallery-image-wrapper:hover {
    transform: translateY(-2px);
}

.gallery-image-wrapper img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-image-wrapper:hover img {
    opacity: 0.95;
}

.phase-gallery.large .gallery-image-wrapper img {
    height: 360px;
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--text-light);
    padding: 20px 16px 12px;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* ========================================
   COMPARATIVA ANTES/DESPUÉS
   ======================================== */

.comparison-section {
    padding: 60px 40px;
    background: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

.comparison-title {
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 40px;
    letter-spacing: -0.3px;
}

.comparison-slider-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.comparison-images {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.comparison-side {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--text-light);
}

.comparison-side img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.comparison-label {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.before-label {
    background: var(--color-before);
    border-color: var(--color-before);
}

.after-label {
    background: var(--color-after);
    border-color: var(--color-after);
}

.comparison-divider {
    width: 2px;
    height: 400px;
    background: var(--border-color);
    position: relative;
}

.comparison-divider::before,
.comparison-divider::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
}

.comparison-divider::before {
    top: -4px;
}

.comparison-divider::after {
    bottom: -4px;
}

/* ========================================
   TESTIMONIO DEL CLIENTE
   ======================================== */

.client-testimonial {
    padding: 60px 40px;
    background: var(--primary-color);
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
}

.testimonial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-icon {
    font-size: 48px;
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.3;
}

.testimonial-stars {
    font-size: 16px;
    letter-spacing: 2px;
    opacity: 0.8;
}

.testimonial-text {
    font-size: 16px;
    line-height: 1.8;
    font-style: italic;
    margin: 0 0 30px 0;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 2px;
}

.author-title {
    font-size: 13px;
    opacity: 0.7;
    font-weight: 300;
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta-section {
    background: var(--light-gray);
    padding: 80px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.cta-content h2 {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 15px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.cta-content p {
    font-size: 16px;
    margin-bottom: 35px;
    color: var(--gray);
    font-weight: 300;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 36px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========================================
   ANIMACIONES
   ======================================== */

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .project-card-title {
        font-size: 32px;
    }

    .comparison-images {
        gap: 16px;
    }

    .comparison-side img,
    .comparison-divider {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 80px 20px 60px;
    }

    .page-header h1 {
        font-size: 36px;
    }

    .page-header p {
        font-size: 16px;
    }

    .portfolio-filters {
        padding: 20px;
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 12px;
    }

    .stats-section {
        padding: 50px 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-number {
        font-size: 36px;
    }

    .projects-section {
        padding: 60px 20px;
    }

    .project-card {
        margin-bottom: 60px;
    }

    .project-card-header {
        padding: 50px 30px;
    }

    .project-card-title {
        font-size: 28px;
    }

    .project-card-subtitle {
        font-size: 15px;
    }

    .client-info-box {
        padding: 30px 25px;
    }

    .client-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .project-phase {
        padding: 50px 30px;
    }

    .phase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .phase-title {
        font-size: 22px;
    }

    .timeline-step {
        gap: 16px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .timeline-step:not(:last-child)::after {
        left: 17px;
    }

    .problems-list,
    .results-grid-compact {
        grid-template-columns: 1fr;
    }

    .phase-gallery {
        grid-template-columns: 1fr;
    }

    .phase-gallery.large {
        grid-template-columns: 1fr;
    }

    .gallery-image-wrapper img {
        height: 240px;
    }

    .phase-gallery.large .gallery-image-wrapper img {
        height: 300px;
    }

    .comparison-section {
        padding: 50px 30px;
    }

    .comparison-title {
        font-size: 22px;
        margin-bottom: 30px;
    }

    .comparison-images {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .comparison-divider {
        width: 100%;
        height: 2px;
        justify-self: center;
    }

    .comparison-divider::before,
    .comparison-divider::after {
        width: 8px;
        height: 8px;
        left: auto;
        top: 50%;
        transform: translateY(-50%);
    }

    .comparison-divider::before {
        left: -4px;
        top: 50%;
    }

    .comparison-divider::after {
        right: -4px;
        left: auto;
        bottom: auto;
    }

    .comparison-side img {
        height: 300px;
    }

    .client-testimonial {
        padding: 50px 30px;
    }

    .testimonial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .testimonial-text {
        font-size: 15px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .cta-content h2 {
        font-size: 30px;
    }

    .cta-content p {
        font-size: 15px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-card-header {
        padding: 40px 20px;
    }

    .project-card-title {
        font-size: 24px;
    }

    .project-card-subtitle {
        font-size: 14px;
    }

    .client-info-box {
        padding: 25px 20px;
    }

    .client-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-phase {
        padding: 40px 20px;
    }

    .phase-title {
        font-size: 20px;
    }

    .phase-description {
        font-size: 14px;
    }

    .step-content h4 {
        font-size: 15px;
    }

    .step-content p {
        font-size: 13px;
    }

    .comparison-section {
        padding: 40px 20px;
    }

    .comparison-title {
        font-size: 20px;
    }

    .comparison-side img {
        height: 250px;
    }

    .client-testimonial {
        padding: 40px 20px;
    }

    .testimonial-text {
        font-size: 14px;
    }

    .author-avatar {
        width: 44px;
        height: 44px;
        font-size: 13px;
    }

    .author-name {
        font-size: 14px;
    }

    .author-title {
        font-size: 12px;
    }

    .cta-content h2 {
        font-size: 26px;
    }

    .cta-content p {
        font-size: 14px;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

.project-card.hidden {
    display: none;
}

.project-card.visible {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

.filter-btn:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .page-header,
    .portfolio-filters,
    .stats-section,
    .cta-section {
        display: none;
    }

    .project-card {
        page-break-inside: avoid;
        border: 1px solid var(--border-color);
        box-shadow: none;
    }
}