:root {
    --primary-dark: #0077b6;
    --primary-light: #90e0ef;
    --accent: #00b4d8;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-dark: #333;
    --text-light: #f1f1f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f8ff;
    color: var(--text-dark);
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Glassmorphism Utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border-radius: 15px;
}

/* Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.highlight {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 600;
    transition: color 0.3s;
}

.btn-nav {
    background: var(--primary-dark);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
}

.burger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* IMAGEN DE PORTADA: Asegúrate de guardar tu imagen como 'fondo.jpg' en img/portada/ */
    background: url('img/portada/fondo.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    transition: background-image 1.5s ease-in-out;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark overlay for better text contrast on landscape images */
    background: rgba(0, 0, 0, 0.2); 
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 800px;
    padding: 2rem;
}

.gradient-text {
    font-size: 5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    color: #0033cc; /* Strong blue */
    background: none; /* Remove previous gradient */
    -webkit-text-fill-color: #0033cc;
    /* Thick white border effect with rounded feel */
    text-shadow: 
        4px 4px 0 #fff,
        -4px 4px 0 #fff,
        -4px -4px 0 #fff,
        4px -4px 0 #fff,
        4px 0px 0 #fff,
        0px 4px 0 #fff,
        -4px 0px 0 #fff,
        0px -4px 0 #fff,
        /* Extra layers for rounding corners */
        2px 2px 0 #fff, -2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff,
        0 6px 15px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    letter-spacing: -6px; /* Tighter spacing */
    line-height: 0.85;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #f0f8ff;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

#hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
}

/* Logo Carousel (New) */
.logo-carousel-container {
    background: white;
    padding: 2rem 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.logo-carousel {
    display: flex;
    width: 100%;
}

.logo-track {
    display: flex;
    width: calc(200px * 14); /* 200px per slide * 14 slides */
    animation: scroll 30s linear infinite;
}

.slide {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #aaa;
    gap: 10px;
    font-weight: 600;
}

.slide i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 7)); } /* Move half the track */
}

/* Features Section */
#features {
    padding: 4rem 5%;
    background-color: #f0f8ff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

#features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-card {
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

/* Products Section */
#products {
    padding: 4rem 5%;
    background: linear-gradient(180deg, #f0f8ff 0%, #ffffff 100%);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from cover to show full product */
    padding: 10px; /* Add breathing room around product */
    transition: transform 0.5s ease;
}

.product-card:hover .card-img img {
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.price {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-card {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.btn-card:hover {
    background: var(--accent);
}

/* Gallery Section (New) */
#gallery {
    padding: 4rem 5%;
    background: #f9fcff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 250px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 119, 182, 0.8);
    color: white;
    padding: 10px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Order Section */
#order {
    padding: 4rem 5%;
    /* Use same background image as hero */
    background: url('img/portada/fondo.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    position: relative; /* For overlay */
}

/* Dark overlay for Order section to match Hero readability */
#order::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.order-container {
    position: relative; /* Bring above overlay */
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 3rem;
    width: 100%;
    max-width: 1000px;
}

.order-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.order-text h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.contact-info p {
    margin: 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input, 
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    color: #333;
    border: none;
    border-bottom: 2px solid #ccc;
    background: transparent;
    outline: none;
    transition: border-color 0.3s;
}

.input-group select {
    padding: 10px 5px;
    cursor: pointer;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: #666;
    pointer-events: none;
    transition: 0.3s ease all;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--primary-dark);
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--primary-dark);
}

.btn-submit {
    background: linear-gradient(45deg, var(--primary-dark), var(--accent));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.4);
    transition: transform 0.3s;
    width: 100%;
}

.btn-submit:hover {
    transform: scale(1.05);
}

/* Footer */
footer {
    /* Glassmorphism over Fixed Background to match theme */
    background: url('img/portada/fondo.webp') fixed center center / cover;
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark blurred overlay for readability and glass effect */
    background: rgba(0, 20, 40, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: -1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.social-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-link:hover {
    color: var(--accent);
}

.resolution {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.btn-whatsapp-contact {
    display: inline-block;
    background-color: #25d366;
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-contact:hover {
    background-color: #128c7e;
    transform: translateY(-3px);
}

.btn-whatsapp-contact i {
    margin-right: 8px;
    font-size: 1.2rem;
}

.visit-counter-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .nav-links {
        display: none; /* Add JS toggle later if needed */
    }
    
    .gradient-text {
        font-size: 2.5rem;
    }
    
    .order-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .logo-track {
        /* Speed up on mobile if needed, or keep same */
    }
}

/* Chat Widget Styles */
#chat-widget {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 2000;
    font-family: 'Poppins', sans-serif;
}

.whatsapp-float {
    /* Reuse existing float button styles but ensure cursor pointer for button */
    border: none;
    cursor: pointer;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
}

#chat-window {
    position: absolute;
    bottom: 40px;
    right: 80px; /* Moves window to the left of the button */
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

#chat-window.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-header {
    background: var(--primary-dark);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chat Footer Adjustment */
.chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
}

.chat-footer.hidden {
    display: none;
}

.chat-input-field {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
}

.phone-prefix {
    padding: 0 12px;
    font-weight: 700;
    color: #333;
    border-right: 1px solid #eee;
    height: 100%;
    display: flex;
    align-items: center;
}

.phone-prefix.is-hidden {
    display: none;
}

.chat-input-field input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
}

.chat-footer button {
    background: var(--primary-dark);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-footer button:hover {
    background: var(--accent);
}

/* Chat Messages */
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    background: #e9e9eb;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message.user {
    background: var(--primary-dark);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.option-btn {
    background: white;
    border: 1px solid var(--primary-dark);
    color: var(--primary-dark);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--primary-dark);
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 480px) {
    #chat-window {
        width: 300px;
        height: 450px;
        right: -20px; /* Adjust alignment for small screens */
    }
}
