/* responsive.css - Estilos responsivos adicionales y optimizaciones */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.preloader-content {
    text-align: center;
    color: white;
}

.preloader-logo {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

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

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--accent), var(--warm));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #d63753, #e67e51);
}

/* Focus states para accesibilidad */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Skip to content para accesibilidad */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error states */
.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fcc;
    margin: 1rem 0;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.success-message {
    background: #efe;
    color: #363;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #cfc;
    margin: 1rem 0;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #f8f9fa;
        --secondary: #6c757d;
        --accent: #ff6b8a;
        --warm: #ff8c6b;
        --light: #ffd23f;
        --white: #2d3142;
        --gray-light: #1a1d29;
        --gray-dark: #e9ecef;
    }
    
    body {
        background: var(--white);
        color: var(--primary);
    }
    
    nav {
        background: rgba(26, 29, 41, 0.95);
    }
    
    .gallery-item,
    .offer-card,
    .testimonial,
    .info-card,
    .value-card {
        background: var(--gray-light);
        color: var(--primary);
    }
}

/* Print styles */
@media print {
    nav,
    .cookie-banner,
    .cta-buttons,
    .social-links,
    .hamburger {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }
    
    .hero-title {
        font-size: 24pt;
    }
    
    h2 {
        font-size: 18pt;
    }
    
    h3 {
        font-size: 14pt;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #000;
        --secondary: #666;
        --accent: #000;
        --warm: #000;
        --light: #ffff00;
        --white: #fff;
        --gray-light: #f0f0f0;
        --gray-dark: #333;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shapes,
    .testimonial,
    .shape {
        animation: none !important;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .container,
    .nav-container,
    .hero-content,
    .story-container,
    .contact-container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 5.5rem;
    }
    
    .section-header h2 {
        font-size: 3.5rem;
    }
}

/* Small tablets Portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .horizontal-gallery {
        padding: 1rem;
    }
    
    .gallery-item {
        min-width: 200px;
        height: 280px;
    }
    
    .testimonials-container {
        padding: 1rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-year {
        width: 60px;
        height: 60px;
        font-size: 0.9rem;
        margin-left: 0;
        margin-right: 1rem;
    }
}

/* Large tablets landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .story-container {
        gap: 2rem;
    }
    
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .offer-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .amount {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .contact-form-section,
    .info-card {
        padding: 1rem;
    }
}

/* Hover effects para dispositivos con hover */
@media (hover: hover) {
    .nav-menu a:hover::after,
    .gallery-item:hover .overlay,
    .btn-primary:hover,
    .btn-secondary:hover,
    .value-card:hover,
    .team-member:hover .member-image img,
    .mood-item:hover img,
    .video-item:hover .video-placeholder img {
        /* Los efectos hover ya están definidos en el CSS principal */
    }
}

/* Touch devices optimizations */
@media (hover: none) {
    .gallery-item:active,
    .video-item:active,
    .mood-item:active {
        transform: scale(0.98);
    }
    
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.95);
    }
    
    /* Aumentar áreas táctiles */
    .nav-menu a,
    .social-link,
    .play-button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Landscape phone orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .page-hero {
        height: auto;
        min-height: 50vh;
        padding: 4rem 0 2rem;
    }
    
    nav {
        padding: 0.5rem 5%;
    }
    
    .nav-menu {
        top: 60px;
    }
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Lazy loading placeholders */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Contenido que se mantiene visible durante las animaciones */
.preserve-3d {
    transform-style: preserve-3d;
}