/* =========================================
   VARIABLES Y RESET
   ========================================= */
:root {
    --bg-main: #0a0a0a;
    --bg-alt: #121212;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #d4af37;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 150px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: 'Cinzel', serif;
    font-weight: 400;
    color: var(--accent);
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
}

/* =========================================
   CABECERA GLASSMORPHISM (COMPACTA)
   ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.logo {
    max-height: 75px;
    width: auto;
    filter: invert(100%);
    mix-blend-mode: screen;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, var(--bg-main) 100%);
    padding: 0 20px;
}

.hero-content h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: 5px;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--accent);
    border: 1px solid var(--accent);
    color: #000000;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
}

/* =========================================
   GALERÍAS
   ========================================= */
.portfolio-section {
    padding: 100px 0;
}

.bg-darker {
    background-color: var(--bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.divider {
    width: 50px;
    height: 2px;
    background-color: var(--accent);
    margin: 0 auto;
}

.grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: grayscale(30%);
}

.gallery-card:hover img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.card-overlay i {
    font-size: 2rem;
    color: #fff;
    transform: scale(0.5);
    transition: var(--transition);
}

.gallery-card:hover .card-overlay {
    opacity: 1;
}

.gallery-card:hover .card-overlay i {
    transform: scale(1);
}

/* =========================================
   BUSCADOR Y FILTROS CON GLOBITO EN VIVO
   ========================================= */
.search-container {
    text-align: center;
    margin: 0 auto 25px auto;
    position: relative;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 120px;
    border-radius: 30px;
    border: 1px solid var(--accent);
    background: rgba(10, 10, 10, 0.7);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.search-badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

.hidden-item {
    display: none;
}

.filtered-out {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 15px 35px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(212, 175, 55, 0.05);
}

/* =========================================
   LIGHTBOX (Visor con Arrastre fluido)
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.lightbox-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 85vh;
}

.lightbox-content {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease-out;
    cursor: zoom-in;
}

.lightbox-content.zoomed {
    cursor: grab;
}

.lightbox-content.zoomed:active {
    cursor: grabbing;
}

.lightbox-content.dragging {
    transition: none !important;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10001;
}

.close-lightbox:hover {
    color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    padding: 15px;
    transition: var(--transition);
    z-index: 10001;
    user-select: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--accent);
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

#caption {
    margin-top: 15px;
    color: var(--accent);
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 1.5px;
    text-align: center;
    max-width: 700px;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .lightbox {
        padding: 10px;
    }

    .lightbox-container {
        max-width: 100%;
        width: 100%;
    }

    .lightbox-content {
        max-height: 66vh;
    }

    .lightbox-prev,
    .lightbox-next {
        top: 45%;
        width: 45px;
        height: 45px;
        font-size: 22px;
        padding: 0;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .close-lightbox {
        top: 15px;
        right: 15px;
        font-size: 30px;
    }

    #caption {
        font-size: 0.85rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* =========================================
   FORMULARIO DE CONTACTO
   ========================================= */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-alt);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: var(--text-main);
    padding: 15px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #222;
}

.form-group input[type="file"] {
    background-color: transparent;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input[type="file"]::file-selector-button {
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    margin-right: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.form-group input[type="file"]::file-selector-button:hover {
    background-color: #e5c158;
}

.error-msg {
    color: #ff4c4c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--accent);
}

.form-checkbox label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   BANNER DE COOKIES Y FOOTER
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    border-top: 1px solid var(--accent);
    color: var(--text-main);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10002;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-right: 20px;
}

.modern-footer {
    background-color: #050505;
    padding: 40px 0 20px 0;
    border-top: 1px solid #1a1a1a;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 30px;
    align-items: center;
}

.footer-logo {
    max-height: 65px;
    width: auto;
    filter: invert(100%);
    mix-blend-mode: screen;
    margin-bottom: 15px;
    opacity: 0.5;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 380px;
    font-weight: 300;
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
}

.footer-social h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent);
    text-align: center;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.1rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    color: #555;
    font-size: 0.8rem;
}

/* =========================================
   ANIMACIONES Y RESPONSIVE
   ========================================= */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 8px;
        padding: 8px 0;
    }

    .logo {
        max-height: 65px;
        width: auto;
    }

    .nav-links {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .grid-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .portfolio-section {
        padding: 60px 0;
    }

    .search-input {
        max-width: 100%;
        padding-right: 90px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-container {
        padding: 20px;
    }

    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .cookie-banner p {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    .footer-social {
        justify-self: center;
    }
}

/* =========================================
   PRELOADER
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.pulse-logo {
    width: 120px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 15px var(--accent));
    }

    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}