﻿:root {
    --primary: #1e3a8a;
    --secondary: #3730a3;
    --accent: #3b82f6;
    --light: #F8F9FA;
    --dark: #1e293b;
    --success: #16a34a;
}

/* CONTENEDOR PRINCIPAL EXPANDIDO - MODIFICADO */
.main-content-area.full-width {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    min-width: fit-content; /* Asegura que se expanda según el contenido */
    overflow-x: visible; /* Permite que el contenido se expanda */
}

/* CONTENEDOR EXPANDIDO - MODIFICADO */
.container {
    max-width: none;
    margin: 0;
    padding: 0 2rem; /* Padding lateral consistente */
    width: auto; /* Se expande según el contenido */
    min-width: min-content; /* Se adapta al contenido mínimo */
}

.page-title {
    text-align: center;
    margin: 0.3rem 0 0.8rem 0;
    color: var(--dark);
}

    .page-title h1 {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .page-title p {
        color: #64748b;
        font-size: 1rem;
    }

/* Grid con 3 COLUMNAS MÁS ANCHAS - MODIFICADO */
.services-grid.expanded {
    display: grid;
    grid-template-columns: repeat(3, minmax(320px, 1fr)); /* Columnas más anchas */
    gap: 1.8rem; /* Más espacio entre cards */
    margin-bottom: 1rem;
    justify-content: start; /* Alineación a la izquierda */
    align-items: stretch;
    width: 100%;
    min-width: min-content; /* Se adapta al contenido */
}

/* Service card MÁS ANCHA pero manteniendo 3 por fila */
.service-card.compact {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
    height: fit-content;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 300px; /* Ancho mínimo garantizado */
}

    .service-card.compact:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(30, 58, 138, 0.15);
    }

/* Header con mejor uso del espacio horizontal */
.service-header {
    padding: 1.2rem 1.2rem; /* Más padding para cards más anchas */
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

    .service-header h3 {
        font-size: 1.1rem; /* Texto más grande para cards anchas */
        margin-bottom: 0.3rem;
        line-height: 1.3;
        font-weight: 600;
        text-align: center;
    }

/* Body optimizado para más ancho */
.service-body {
    padding: 1.2rem 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-description {
    color: #64748b;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    font-size: 0.9rem; /* Texto más grande */
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Más líneas para aprovechar el ancho */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    text-align: justify;
}

/* Details con mejor distribución horizontal */
.service-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
    gap: 0.8rem; /* Más espacio entre detalles */
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.detail-label {
    font-size: 0.8rem; /* Texto más grande */
    color: #94a3b8;
    margin-bottom: 0.3rem;
    text-align: center;
}

.detail-value {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.9rem; /* Texto más grande */
    text-align: center;
}

/* Footer optimizado */
.service-footer {
    padding: 0 1.2rem 1.2rem;
    text-align: center;
    margin-top: auto;
}

.btn-appointment {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border: none;
    padding: 0.7rem 1.2rem; /* Botón más grande */
    border-radius: 8px;
    font-size: 0.9rem; /* Texto más grande */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

    .btn-appointment:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 12px rgba(59, 130, 246, 0.4);
    }

    .btn-appointment i {
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }

/* Professional info con mejor distribución */
.professional-info {
    display: flex;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #f1f5f9;
    justify-content: center;
}

.professional-avatar {
    width: 32px; /* Avatar más grande */
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 0.6rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.professional-name {
    font-weight: 500;
    color: #475569;
    font-size: 0.85rem; /* Texto más grande */
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Filter section */
.filter-section {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    max-width: 100%;
}

.filter-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-option {
    background: #f8fafc;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 500;
    font-size: 0.85rem;
}

    .filter-option:hover {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 3px 8px rgba(30, 58, 138, 0.25);
    }

    .filter-option.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        box-shadow: 0 3px 8px rgba(30, 58, 138, 0.3);
    }

    /* Mejoras de accesibilidad */
    .btn-appointment:focus,
    .filter-option:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

/* Efectos de carga */
.service-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* CONTENEDOR EXPANDIDO PARA PANTALLAS GRANDES - NUEVO */
@media (min-width: 1400px) {
    .container {
        padding: 0 3rem;
    }

    .services-grid.expanded {
        grid-template-columns: repeat(3, minmax(350px, 1fr));
        gap: 2rem;
    }

    .service-card.compact {
        min-height: 320px;
    }

    .service-header h3 {
        font-size: 1.2rem;
    }

    .service-description {
        font-size: 0.95rem;
        -webkit-line-clamp: 5;
    }
}

@media (min-width: 1600px) {
    .container {
        padding: 0 4rem;
    }

    .services-grid.expanded {
        grid-template-columns: repeat(3, minmax(380px, 1fr));
        gap: 2.5rem;
    }

    .service-card.compact {
        min-height: 340px;
    }

    .service-header {
        padding: 1.5rem 1.5rem;
    }

    .service-body {
        padding: 1.5rem 1.5rem;
    }
}

@media (min-width: 1920px) {
    .container {
        padding: 0 5rem;
    }

    .services-grid.expanded {
        grid-template-columns: repeat(3, minmax(420px, 1fr));
        gap: 3rem;
    }

    .service-card.compact {
        min-height: 360px;
    }

    .service-header h3 {
        font-size: 1.3rem;
    }

    .service-description {
        font-size: 1rem;
        -webkit-line-clamp: 6;
    }
}

/* Responsive para pantallas más pequeñas */
@media (max-width: 1200px) {
    .services-grid.expanded {
        grid-template-columns: repeat(3, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .main-content-area.full-width {
        margin: 0;
        width: 100%;
    }

    .services-grid.expanded {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .services-grid.expanded {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .page-title p {
        font-size: 0.85rem;
    }

    .service-card.compact {
        min-height: 280px;
    }
}

@media (max-width: 600px) {
    .services-grid.expanded {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .page-title {
        margin: 0.2rem 0 0.6rem 0;
    }

        .page-title h1 {
            font-size: 1.3rem;
        }

    .services-grid.expanded {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card.compact {
        min-height: 260px;
        min-width: 250px;
    }

    .service-header,
    .service-body,
    .service-footer {
        padding: 1rem;
    }
}

/* Animaciones para las cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeInUp 0.4s ease forwards;
}



/* ===== MEJORAS ESPECÍFICAS PARA MÓVILES - SERVICIOS ===== */
@media (max-width: 768px) {
    /* CONTENEDOR PRINCIPAL MÓVIL */
    .main-content-area.full-width {
        overflow-x: hidden; /* Prevenir scroll horizontal */
    }

    .container {
        padding: 0 0.8rem; /* Menor padding lateral */
    }

    /* TÍTULOS MÁS COMPACTOS */
    .page-title {
        margin: 0.2rem 0 0.6rem 0;
    }

        .page-title h1 {
            font-size: 1.3rem; /* Más pequeño */
            margin-bottom: 0.2rem;
        }

        .page-title p {
            font-size: 0.8rem; /* Más pequeño */
            line-height: 1.3;
        }

    /* FILTROS COMPACTOS */
    .filter-section {
        padding: 0.8rem; /* Más compacto */
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .filter-title {
        font-size: 0.9rem; /* Más pequeño */
        margin-bottom: 0.5rem;
    }

    .filter-options {
        gap: 0.3rem; /* Menor espacio */
    }

    .filter-option {
        padding: 0.4rem 0.8rem; /* Más compacto */
        font-size: 0.75rem; /* Más pequeño */
        border-radius: 15px;
    }

    /* GRID DE UNA SOLA COLUMNA */
    .services-grid.expanded {
        grid-template-columns: 1fr;
        gap: 0.8rem; /* Menor espacio entre cards */
        margin-bottom: 0.8rem;
    }

    /* CARDS MÁS COMPACTAS */
    .service-card.compact {
        min-height: 220px; /* Mucho más bajo */
        border-radius: 8px;
        min-width: auto; /* Quitar ancho mínimo fijo */
        width: 100%;
    }

    /* HEADER COMPACTO */
    .service-header {
        padding: 0.8rem; /* Más compacto */
    }

        .service-header h3 {
            font-size: 0.9rem; /* Más pequeño */
            margin-bottom: 0.2rem;
            line-height: 1.2;
        }

    /* BODY COMPACTO */
    .service-body {
        padding: 0.8rem; /* Más compacto */
    }

    .service-description {
        font-size: 0.75rem; /* Más pequeño */
        line-height: 1.3;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 2; /* Menos líneas en móvil */
        text-align: left; /* Alinear a la izquierda */
    }

    /* DETALLES MÁS COMPACTOS */
    .service-details {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        gap: 0.4rem; /* Menor espacio */
    }

    .detail-label {
        font-size: 0.7rem; /* Más pequeño */
        margin-bottom: 0.2rem;
    }

    .detail-value {
        font-size: 0.75rem; /* Más pequeño */
    }

    /* FOOTER COMPACTO */
    .service-footer {
        padding: 0 0.8rem 0.8rem;
    }

    .btn-appointment {
        padding: 0.5rem 0.8rem; /* Más compacto */
        font-size: 0.8rem; /* Más pequeño */
        border-radius: 6px;
        min-height: 36px; /* Altura mínima para toques */
    }

        .btn-appointment i {
            font-size: 0.8rem;
            margin-right: 0.3rem;
        }

    /* INFO PROFESIONAL COMPACTA */
    .professional-info {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .professional-avatar {
        width: 28px; /* Más pequeño */
        height: 28px;
        margin-right: 0.4rem;
        font-size: 0.7rem;
    }

    .professional-name {
        font-size: 0.75rem; /* Más pequeño */
    }
}

@media (max-width: 480px) {
    /* VERSIÓN AÚN MÁS COMPACTA */
    .container {
        padding: 0 0.5rem;
    }

    .page-title h1 {
        font-size: 1.1rem;
    }

    .page-title p {
        font-size: 0.75rem;
    }

    .filter-section {
        padding: 0.6rem;
        margin-bottom: 0.8rem;
    }

    .filter-title {
        font-size: 0.85rem;
    }

    .filter-option {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .services-grid.expanded {
        gap: 0.6rem;
    }

    .service-card.compact {
        min-height: 200px; /* Aún más compacto */
    }

    .service-header,
    .service-body {
        padding: 0.6rem;
    }

        .service-header h3 {
            font-size: 0.85rem;
        }

    .service-description {
        font-size: 0.7rem;
        -webkit-line-clamp: 2;
    }

    .service-details {
        gap: 0.3rem;
    }

    .detail-label {
        font-size: 0.65rem;
    }

    .detail-value {
        font-size: 0.7rem;
    }

    .service-footer {
        padding: 0 0.6rem 0.6rem;
    }

    .btn-appointment {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    .professional-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .professional-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    /* VERSIÓN MÍNIMA PARA MÓVILES PEQUEÑOS */
    .container {
        padding: 0 0.3rem;
    }

    .page-title h1 {
        font-size: 1rem;
    }

    .service-card.compact {
        min-height: 190px;
    }

    .service-header h3 {
        font-size: 0.8rem;
    }

    .service-description {
        font-size: 0.65rem;
    }

    .btn-appointment {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* MEJORAS ESPECÍFICAS PARA MÓVILES - USABILIDAD TÁCTIL */
@media (max-width: 768px) {
    /* Mejorar áreas táctiles */
    .btn-appointment,
    .filter-option {
        min-height: 36px; /* Altura mínima para toques */
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent; /* Eliminar highlight azul en iOS */
    }

        /* Estados táctiles */
        .btn-appointment:active,
        .filter-option:active {
            transform: scale(0.95);
            opacity: 0.8;
            transition: transform 0.1s ease, opacity 0.1s ease;
        }

    /* Optimizar texto para móviles */
    .service-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Mejorar contraste */
    .service-header h3 {
        font-weight: 600;
    }

    /* Eliminar efectos hover en móviles */
    .service-card.compact:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
    }

    .filter-option:hover {
        transform: none;
        background: #f8fafc;
        color: #475569;
    }

    .filter-option.active:hover {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
    }
}

/* PREVENIR ZOOM EN iOS */
@media (max-width: 768px) {
    .container {
        font-size: 16px; /* Tamaño mínimo para prevenir zoom */
    }
}

/* OPTIMIZACIONES DE RENDIMIENTO PARA MÓVILES */
@media (max-width: 768px) {
    .service-card.compact {
        will-change: transform;
        backface-visibility: hidden;
    }

    /* Animaciones más rápidas en móviles */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .service-card {
        animation: fadeInUp 0.3s ease forwards;
    }
}

/* MEJORAS DE ACCESIBILIDAD EN MÓVILES */
@media (max-width: 768px) {
    .btn-appointment:focus,
    .filter-option:focus {
        outline: 2px solid var(--accent);
        outline-offset: 1px;
    }

    /* Asegurar contraste adecuado */
    .detail-value {
        color: var(--primary);
        font-weight: 600;
    }
}