/* ==================================================
   NOSOTROS PAGE - ENHANCED UX & RESPONSIVE DESIGN
   ================================================== */

/* Variables para consistencia */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1a2947;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-heavy: 0 20px 40px rgba(0,0,0,0.15);
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}


/* ==================================================
   LOADING STATES & SKELETON LOADERS
   ================================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 20px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

@keyframes loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================================================
   ICONS GRID - MEJORAS RESPONSIVE Y ACCESIBILIDAD
   ================================================== */
.icons {
    background: var(--light-bg);
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.title-icons {
    width: 90%;
    max-width: 800px;
    text-align: center;
    font-family: "Poppins", sans-serif;
    font-weight: bold;
    margin: 0 auto 40px auto;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.3;
    color: var(--text-color);
    animation: fadeInUp 0.8s ease-out;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 30px;
    justify-content: center;
    justify-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.icon {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    background: var(--white);
    box-shadow: var(--shadow-light);
    height: 200px;
    width: 100%;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.icon:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    background: rgba(44, 90, 160, 0.05);
}

.icon:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.icon img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    object-position: center;
    margin-bottom: 15px;
    transition: var(--transition);
    border: 3px solid transparent;
    flex-shrink: 0;
}

.icon:hover img {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.icon p {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.icon.active {
    background: var(--gradient-primary);
    color: var(--white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.icon.active p {
    color: var(--white);
}

.icon.active img {
    border-color: var(--white);
    filter: brightness(1.1);
}

/* Indicador visual para elemento activo */
.icon.active::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--white);
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: var(--shadow-medium);
    z-index: 2;
}

/* ==================================================
   SELECTER - CARRUSEL MEJORADO
   ================================================== */
.selecter {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.select {
    display: none;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    background: var(--white);
    box-shadow: var(--shadow-medium);
    animation: fadeIn 0.5s ease-out;
    min-height: 400px;
    max-height: 500px;
}

.select.active {
    display: flex;
    align-items: stretch;
    height: 500px;
    max-height: 500px;
    overflow: hidden;
}

.select-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 400px;
    min-width: 45%;
    max-width: 55%;
    background: linear-gradient(135deg, var(--white) 0%, var(--light-bg) 100%);
}

.select-title {
    font-family: "Poppins", sans-serif;
    font-weight: bold;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 20px;
    text-align: left;
    color: var(--text-color);
    line-height: 1.2;
}

.select-text {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: left;
    color: #666;
    max-width: 500px;
}

.boton {
    text-decoration: none;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    background: var(--gradient-primary);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-light);
    align-self: flex-start;
    position: relative;
    overflow: hidden;
}

.boton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.boton:hover::before {
    left: 100%;
}

.boton:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.boton:focus {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

.boton::after {
    content: '→';
    transition: var(--transition);
}

.boton:hover::after {
    transform: translateX(5px);
}

.select-img {
    flex: 1;
    min-height: 400px;
    max-height: 500px;
    min-width: 45%;
    max-width: 55%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    padding: 15px;
    border-radius: var(--border-radius);
}

.select-img img {
    max-width: calc(100% - 30px);
    max-height: calc(100% - 30px);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: var(--transition-slow);
    border-radius: var(--border-radius);
    display: block;
    box-shadow: var(--shadow-light);
}

.select:hover .select-img img {
    transform: scale(1.05);
}

/* ==================================================
   CONTROLES DEL CARRUSEL MEJORADOS
   ================================================== */
.btn-selecter {
    text-align: center;
    margin: 40px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.carousel-btn {
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: var(--shadow-light);
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-selecter .checkbox {
    width: 16px;
    height: 16px;
    margin: 0 8px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    background: var(--white);
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-light);
    outline: none;
}

.btn-selecter .checkbox:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-medium);
}

.btn-selecter .checkbox.checked {
    background: var(--primary-color);
    transform: scale(1.2);
}

.btn-selecter .checkbox.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
}

.btn-selecter .checkbox:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Indicador de progreso */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ==================================================
   CONTENT SECTIONS - MISIÓN Y VALORES
   ================================================== */
.content-center {
    text-align: center;
    margin: 60px auto;
    max-width: 900px;
    padding: 0 20px;
}

.content-center h1 {
    font-family: "Poppins", sans-serif;
    font-weight: bold;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 30px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 20px;
}

.content-center h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.content-center p {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 400;
    line-height: 1.8;
    color: #666;
    text-align: justify;
    max-width: 700px;
    margin: 0 auto;
}

/* ==================================================
   SUSTAINABILITY BANNER MEJORADO
   ================================================== */
.banner {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    margin: 40px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(44, 90, 160, 0.3));
    z-index: 1;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.banner:hover img {
    transform: scale(1.05);
}

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white);
    font-family: "Poppins", sans-serif;
    padding: 40px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
    max-width: 90%;
    animation: fadeInUp 1s ease-out;
}

.banner-text h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.banner-text p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 10px rgba(0,0,0,0.3);
        --shadow-medium: 0 10px 30px rgba(0,0,0,0.4);
        --shadow-heavy: 0 20px 40px rgba(0,0,0,0.5);
    }
    
    .icon {
        border: 2px solid var(--text-color);
    }
    
    .select {
        border: 2px solid var(--text-color);
    }
}

/* ==================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ================================================== */


/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .icons-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 25px;
        padding: 0 15px;
        max-width: 700px;
    }
    
    .icon {
        height: 180px;
        max-width: 200px;
    }
    
    .icon img {
        width: 70px;
        height: 70px;
    }
    
    .select {
        min-height: 500px;
        max-height: none;
    }
    
    .select.active {
        height: auto;
        min-height: 500px;
        max-height: none;
        flex-direction: column;
    }
    
    .select-content {
        padding: 30px;
        text-align: center;
        min-height: 250px;
        max-width: 100%;
        min-width: 100%;
        order: 2;
        flex: 1;
    }
    
    .boton {
        align-self: center;
    }
    
    .select-img {
        min-height: 250px;
        max-height: none;
        max-width: 100%;
        min-width: 100%;
        order: 1;
        padding: 15px;
        flex: 0 0 auto;
        overflow: visible !important;
        background: var(--light-bg);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .select-img img {
        max-width: calc(100% - 30px);
        max-height: calc(100% - 30px);
        object-fit: contain !important;
        width: auto !important;
        height: auto !important;
    }
    
    .banner {
        height: 50vh;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .icons {
        padding: 30px 15px;
    }
    
    .icons-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 20px;
        max-width: 500px;
        padding: 0 10px;
    }
    
    .icon {
        padding: 15px;
        height: 160px;
        max-width: 220px;
    }
    
    .icon img {
        width: 60px;
        height: 60px;
    }
    
    .selecter {
        padding: 30px 15px;
    }
    
    .select {
        min-height: 450px;
        max-height: none;
    }
    
    .select.active {
        height: auto;
        min-height: 450px;
        max-height: none;
        flex-direction: column;
    }
    
    .select-content {
        padding: 25px;
        min-height: 220px;
        order: 2;
        flex: 1;
    }
    
    .select-img {
        min-height: 230px;
        max-height: none;
        order: 1;
        padding: 10px;
        flex: 0 0 auto;
        overflow: visible !important;
        background: var(--light-bg);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .select-img img {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        object-fit: contain !important;
        width: auto !important;
        height: auto !important;
    }
    
    .carousel-controls {
        gap: 15px;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .banner {
        height: 40vh;
        border-radius: 0;
    }
    
    .banner-text {
        padding: 30px 20px;
    }
    
    .content-center {
        margin: 40px auto;
        max-width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .icons {
        padding: 20px 10px;
        margin-top: 70px;
    }
    
    .icons-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 15px;
        max-width: 350px;
        padding: 0 5px;
    }
    
    .icon {
        padding: 10px;
        height: 140px;
        max-width: 160px;
    }
    
    .icon img {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }
    
    .icon p {
        font-size: 0.8rem;
    }
    
    .selecter {
        padding: 20px 10px;
    }
    
    .select {
        min-height: 400px;
        max-height: none;
    }
    
    .select.active {
        height: auto;
        min-height: 400px;
        max-height: none;
        flex-direction: column;
    }
    
    .select-content {
        padding: 20px;
        order: 2;
        min-height: 200px;
        flex: 1;
    }
    
    .select-img {
        min-height: 200px;
        max-height: none;
        order: 1;
        padding: 8px;
        flex: 0 0 auto;
        overflow: visible !important;
        background: var(--light-bg);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .select-img img {
        max-width: calc(100% - 16px);
        max-height: calc(100% - 16px);
        object-fit: contain !important;
        width: auto !important;
        height: auto !important;
    }
    
    .boton {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .btn-selecter {
        margin: 30px auto 0;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .btn-selecter .checkbox {
        width: 12px;
        height: 12px;
        margin: 0 5px;
    }
    
    .banner {
        height: 35vh;
        min-height: 300px;
    }
    
    .banner-text {
        padding: 20px 15px;
    }
    
    .content-center {
        margin: 30px auto;
        padding: 0 15px;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .icons-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 280px;
    }
    
    .icon {
        padding: 8px;
        height: 120px;
        width: 100%;
        max-width: 200px;
    }
    
    .icon img {
        width: 40px;
        height: 40px;
    }
    
    .icon p {
        font-size: 0.7rem;
    }
    
    .select {
        min-height: 350px;
        max-height: none;
    }
    
    .select.active {
        height: auto;
        min-height: 350px;
        max-height: none;
        flex-direction: column;
    }
    
    .select-content {
        padding: 15px;
        order: 2;
        min-height: 180px;
        flex: 1;
    }
    
    .select-img {
        min-height: 170px;
        max-height: none;
        order: 1;
        padding: 5px;
        flex: 0 0 auto;
        overflow: visible !important;
        background: var(--light-bg);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .select-img img {
        max-width: calc(100% - 10px);
        max-height: calc(100% - 10px);
        object-fit: contain !important;
        width: auto !important;
        height: auto !important;
    }
    
    .banner {
        height: 30vh;
        min-height: 250px;
    }
    
    .banner-text {
        padding: 15px 10px;
    }
}

/* ==================================================
   ANIMATIONS AND TRANSITIONS
   ================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==================================================
   TOUCH FRIENDLY IMPROVEMENTS
   ================================================== */
@media (hover: none) and (pointer: coarse) {
    .icon,
    .boton,
    .carousel-btn,
    .btn-selecter .checkbox {
        min-height: 44px;
        min-width: 44px;
    }
    
    .boton {
        padding: 15px 30px;
    }
    
    .icon:hover,
    .select:hover .select-img img,
    .banner:hover img {
        transform: none;
    }
    
    .icon:active {
        transform: scale(0.95);
    }
    
    .boton:active {
        transform: scale(0.98);
    }
}

/* ==================================================
   PRINT STYLES
   ================================================== */
@media print {
    .btn-selecter,
    .carousel-controls,
    .boton {
        display: none;
    }
    
    .select.active {
        display: block;
    }
    
    .select-content {
        padding: 20px 0;
    }
    
    .banner-text {
        position: static;
        transform: none;
        color: var(--text-color);
        background: none;
        backdrop-filter: none;
        border: none;
    }
    
    .icons,
    .selecter {
        break-inside: avoid;
    }
}
