/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #5BA4CF;
    --primary-gray: #7D8B99;
    --dark-blue: #2E5C7A;
    --light-gray: #F5F7FA;
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --white: #FFFFFF;
    --green: #4A9B4F;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Header y Navegación */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255,255,255,0.98);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.logo {
    height: 60px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.header-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.language-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--light-gray);
    padding: 0.3rem;
    border-radius: 20px;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--primary-blue);
    color: var(--white);
}

.lang-btn:hover:not(.active) {
    background: rgba(91,164,207,0.2);
}

.header-social {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-social a {
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.header-social a:hover {
    color: var(--primary-blue);
    background: rgba(91,164,207,0.1);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

.btn-portal {
    background: var(--primary-blue);
    color: var(--white) !important;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-portal:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91,164,207,0.3);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(46,92,122,0.7), rgba(91,164,207,0.7)), url('../img/vinedo-sunset.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 80px;
}

.hero-content {
    max-width: 900px;
    padding: 0 2rem;
    animation: fadeInUp 1s ease;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(91,164,207,0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-blue);
}

/* Secciones generales */
section {
    padding: 5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: var(--dark-blue);
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Sobre Nos */
#sobre {
    background: linear-gradient(135deg, #f8fcff 0%, #ffffff 100%);
}

.sobre-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.sobre-text h2 {
    font-size: 2.5rem;
    color: var(--green);
    margin-bottom: 1.5rem;
}

.sobre-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.sobre-text strong {
    color: var(--text-dark);
}

.sobre-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Valores */
.valores {
    background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), url('../img/riego-aspersion.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    color: var(--white);
}

.valores-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.valores-container {
    position: relative;
    z-index: 2;
}

.valores .section-title,
.valores .section-subtitle {
    color: var(--white);
}

.valores .section-title {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.valores-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2rem;
    margin-top: 3rem;
}

@media (max-width: 968px) {
    .valores-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .valores-grid-new {
        grid-template-columns: 1fr;
    }
}

.valor-item-new {
    text-align: left;
    padding: 0;
    border-left: 3px solid var(--primary-blue);
    padding-left: 1.5rem;
}

.valor-item-new h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 1rem;
    font-weight: 600;
}

.valor-item-new p {
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
    font-size: 1rem;
}

/* Servicios */
#servicos {
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 1200px) {
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .servicios-grid {
        grid-template-columns: 1fr;
    }
}

.servicio-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.servicio-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(91,164,207,0.1) 0%, transparent 100%);
    border-radius: 0 0 0 100%;
}

.servicio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-left-color: var(--green);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.servicio-numero {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.servicio-icon {
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
    background: white;
    width: 90px;
    height: 90px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.servicio-icon img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
}

.servicio-card h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 0.8rem;
}

/* Galería */
.galeria {
    background: var(--light-gray);
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.galeria-item:hover img {
    transform: scale(1.1);
}

.galeria-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1.5rem 1rem;
    color: var(--white);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.galeria-item:hover .galeria-overlay {
    transform: translateY(0);
}

/* Contacto */
.contacto-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contacto-info h3 {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.info-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
    min-width: 30px;
}

.info-text h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.info-text p {
    color: var(--text-light);
}

.contacto-form {
    background: var(--light-gray);
    padding: 2.5rem;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-submit:hover {
    background: var(--dark-blue);
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 3rem 5%;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    color: var(--white);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.social-link:hover {
    background: var(--primary-blue);
    transform: translateY(-3px);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-legal a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--primary-blue);
}

/* Botón Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-blue);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: 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-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .sobre-content,
    .contacto-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    section {
        padding: 3rem 5%;
    }
}

/* ===== RESPONSIVE MÓVIL MEJORADO ===== */
@media (max-width: 968px) {
    /* Logo con fondo para móvil */
    .logo {
        background: white;
        border-radius: 10px;
        padding: 5px;
    }

    /* Menú hamburguesa */
    .menu-toggle {
        display: flex;
    }

    /* Ocultar header-right en móvil */
    .header-right {
        display: none !important;
    }

    /* Menú móvil */
    .nav-links {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: left 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    /* Hero móvil CON imagen de fondo */
    .hero {
        min-height: 85vh;
        height: auto;
        background: linear-gradient(rgba(46,92,122,0.85), rgba(91,164,207,0.85)), url('../img/vinedo-sunset.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        background-attachment: scroll !important;
        padding: 120px 5% 60px;
        margin-top: 80px;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 1.1rem !important;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }

    /* Secciones */
    section {
        padding: 3rem 5%;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }
}

/* Añadir extras móviles (idioma + redes) al menú */
.mobile-extras {
    display: none; /* Oculto por defecto en desktop */
}

@media (max-width: 968px) {
    /* Mostrar mobile-extras solo en móvil */
    .mobile-extras {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 1.5rem 0;
        border-top: 1px solid var(--light-gray);
        margin-top: 1rem;
    }
}

.language-selector-mobile {
    display: flex;
    gap: 0.5rem;
    background: var(--light-gray);
    padding: 0.5rem;
    border-radius: 20px;
}

.header-social-mobile {
    display: flex;
    gap: 1.5rem;
}

.header-social-mobile a {
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== LIGHTBOX PARA GALERÍA ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 0 0 8px 8px;
}

.lightbox-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.lightbox-caption p {
    font-size: 1rem;
    color: rgba(255,255,255,0.95);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    cursor: pointer;
    background: rgba(0,0,0,0.8);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10001;
    border: 2px solid rgba(255,255,255,0.3);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-blue);
    transform: translateY(-50%) scale(1.1);
    border-color: var(--primary-blue);
}

.galeria-item {
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .lightbox-content img {
        max-height: 75vh;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 2rem;
        width: 45px;
        height: 45px;
        background: rgba(0,0,0,0.9);
        border: 2px solid rgba(255,255,255,0.5);
    }
    
    /* FLECHAS TAMAÑO ADECUADO PARA MÓVIL */
    .lightbox-prev,
    .lightbox-next {
        width: 50px !important;
        height: 50px !important;
        font-size: 2rem !important;
        background: rgba(0,0,0,0.85) !important;
        border: 2px solid rgba(255,255,255,0.5) !important;
        display: flex !important;
        z-index: 10002 !important;
    }
    
    .lightbox-prev {
        left: 10px !important;
    }
    
    .lightbox-next {
        right: 10px !important;
    }
    
    .lightbox-caption {
        padding: 1.5rem 1rem 1rem;
    }
    
    .lightbox-caption h3 {
        font-size: 1.1rem;
    }
    
    .lightbox-caption p {
        font-size: 0.9rem;
    }
}
