/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF8000;
    --secondary-color: #0E131F;
    --accent-color: #47C7FC;
    --text-dark: #0E131F;
    --text-light: #7f8c8d;
    --background-light: #F2F3E2;
    --white: #ffffff;
    --black: rgba(14, 19, 31, 0.8);
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #FF8000 0%, #47C7FC 100%);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Optimización de tipografía con Poppins */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.btn, button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Pesos específicos para elementos importantes */
.hero-title {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nav-link {
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    text-align: center;
}

.camera-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logo i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--gradient);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInUp 1s ease 0.5s both;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.7s both;
}

.cta-button {
    display: inline-block;
    padding: 15px 30px;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    animation: fadeInUp 1s ease 0.9s both;
}

.cta-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    position: relative;
}

.hero-main-image {
    width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease 1.1s both;
    transition: all 0.3s ease;
}

.hero-main-image:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styling */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* Gallery Section */
.gallery-section {
    padding: 100px 0;
    background: var(--background-light);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Category Cards Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    height: 280px;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.category-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover .category-card-image {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--white);
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: -0.01em;
    text-align: center;
}

/* Category Gallery Modal */
.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.category-modal.active {
    display: flex;
}

.modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1002;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}

.modal-header {
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
}

.modal-title {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0;
    text-align: center;
}

.modal-nav {
    display: none; /* Oculto por defecto en móvil */
}

.modal-nav.desktop {
    display: flex !important;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    pointer-events: none;
    z-index: 1004;
}

.modal-prev,
.modal-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    pointer-events: all;
    backdrop-filter: blur(10px);
    z-index: 1005;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.modal-gallery {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-image-container {
    max-height: 90%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    /* Optimizaciones para carga de imágenes */
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Loading spinner para modal */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1003;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.modal-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.modal-loading-text {
    font-size: 1rem;
    opacity: 0.9;
    text-align: center;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-image-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    backdrop-filter: blur(10px);
    text-align: center;
    width: 100%;
    transition: transform 0.3s ease;
    z-index: 1003;
}

.modal-image-info.hidden {
    transform: translateY(100%);
}

.modal-image-info h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin: 1rem 1.5rem 0.3rem 1.5rem;
}

.modal-image-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 0 1.5rem 1rem 1.5rem;
}

/* Touch/Swipe Indicator */
.swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    text-align: center;
    animation: fadeInOut 3s ease-in-out;
    pointer-events: none;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-card {
        height: 250px;
    }
    
    .category-title {
        font-size: 1.4rem;
    }
    
    .modal-header {
        padding: 0.5rem 0;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .modal-image {
        max-height: 70vh;
    }
}

/* About Section */
.about-section {
    padding: 100px 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
}

.stat h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-profile-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow);
    object-fit: cover;
}

.about-placeholder {
    width: 300px;
    height: 400px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--text-light);
}

.about-placeholder i {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.about-placeholder p {
    color: var(--text-light);
}

/* Contact Section */
.contact-section {
    padding: 100px 0;
    background: var(--background-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.contact-item i {
    width: 20px;
    color: var(--secondary-color);
    margin-right: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Contact Form */
.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    max-height: 90%;
}

.modal img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.close:hover {
    opacity: 0.7;
}

.modal-info {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

/* Responsive Design */

/* Tablet fixes */
@media (min-width: 769px) and (max-width: 900px) {
    .header {
        width: 100vw; /* Force full viewport width */
        left: 0;
        right: 0;
    }
    
    .nav-container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    /* Fix about section layout */
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .about-image {
        order: -1; /* Move image above text */
    }
    
    .about-placeholder {
        width: 250px;
        height: 320px;
        margin: 0 auto;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 6rem 20px 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-main-image {
        width: 300px;
        height: 300px;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero-main-image,
    .about-placeholder {
        width: 250px;
    }
    
    .hero-main-image {
        height: 250px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
