/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;800&family=Open+Sans:wght@400;600&display=swap');

:root {
    /* Color Palette - Jungle Adventure */
    --color-primary-yellow: #FFD700;
    --color-primary-orange: #FF8C00;
    --color-jungle-green: #228B22;
    --color-sky-blue: #87CEEB;
    --color-wood-brown: #8B4513;
    --color-light-cloud: #f0f8ff;
    --color-text-dark: #2c3e50;
    --color-white: #ffffff;

    /* Fonts */
    --font-heading: 'Baloo 2', cursive;
    --font-body: 'Open Sans', sans-serif;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --container-width: 1200px;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-light-cloud);
    color: var(--color-text-dark);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-wood-brown);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-primary-orange);
    color: var(--color-white);
    box-shadow: 0 4px 0 #cc7000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #ff9933;
    box-shadow: 0 6px 0 #cc7000;
}

.btn-secondary {
    background-color: var(--color-jungle-green);
    color: var(--color-white);
    box-shadow: 0 4px 0 #1b6e1b;
}

/* Header */
.site-header {
    background-color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 5px solid var(--color-primary-yellow);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo-img {
    height: 140px;
    /* Enlarged logo */
    width: auto;
    transition: transform 0.3s;
}

.logo-img:hover {
    transform: scale(1.05);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
    /* Vertically center menu items */
}

.main-nav a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--color-wood-brown);
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary-orange);
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('../img/hero-bg.jpg');
    /* Placeholder */
    background-size: cover;
    background-position: center;
    background-color: var(--color-sky-blue);
    /* Fallback */
    padding: 80px 0;
    text-align: left;
    color: var(--color-white);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
}

.hero-logo {
    max-width: 350px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    animation: bounceIn 1s ease-out;
}

.hero-text {
    flex: 1;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--color-white);
    text-shadow: 2px 2px 0 var(--color-wood-brown);
    margin-bottom: var(--spacing-md);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--color-jungle-green);
}

/* Cards (Products) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--color-primary-yellow);
    transition: transform 0.3s;
    color: var(--color-text-dark);
}

.card:hover {
    transform: translateY(-5px);
}

.card-img {
    height: 200px;
    background-color: #eee;
    background-size: cover;
    background-position: center;
}

.card-body {
    padding: 20px;
    text-align: center;
}

.card h3 {
    margin-bottom: 10px;
    color: var(--color-primary-orange);
}

/* Footer */
.site-footer {
    background-color: var(--color-wood-brown);
    color: #ffd;
    /* Cream */
    padding: 40px 0;
    margin-top: auto;
    border-top: 5px solid var(--color-jungle-green);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.footer-section h4 {
    color: var(--color-primary-yellow);
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .site-header {
        padding: 10px 0;
    }

    .logo-img {
        height: 60px;
        /* Smaller logo for mobile */
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eee;
    }

    .main-nav.active ul {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero {
        padding: 60px 0;
        text-align: center;
    }

    .hero-container {
        flex-direction: column;
        gap: 30px;
    }

    .hero-logo {
        max-width: 200px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        /* Allow 2 columns on mobile */
    }

    .gallery-item {
        height: 150px;
        /* Smaller height for mobile gallery */
    }

    .grid-cards {
        grid-template-columns: 1fr;
        /* Force single column for cards */
    }
}

/* Safety for all images */
img {
    max-width: 100%;
    height: auto;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    height: 250px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Publicist Style Enhancements --- */

/* 1. Animations */
@keyframes bounceIn {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 140, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0);
    }
}

.bounce-in {
    animation: bounceIn 1s ease-out;
}

.fade-in-up {
    animation: fadeInUp 1s ease-out 0.5s backwards;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 2. Candy Buttons */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(45deg, #FF8C00, #FFA500);
    border: 2px solid white;
}

.btn-secondary {
    background: linear-gradient(45deg, #228B22, #32CD32);
    border: 2px solid white;
}

/* 3. Wave Dividers (SVG Data URI) */
.wave-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" xmlns="http://www.w3.org/2000/svg"><path d="M0 0v46.29c47.79 22.2 103.59 32.17 158 28 70.36-5.37 136.33-33.31 206.8-37.5 73.84-4.36 147.54 16.88 218.2 35.26 69.27 18 138.3 24.88 209.4 13.08 36.15-6 69.85-17.84 104.45-29.34C989.49 25 1113-14.29 1200 52.47V0z" fill="%23f0f8ff" opacity=".5"/><path d="M0 0v64.81c19.16 23.36 111.94 118.06 295 10.74 153.3-89.85 240-51 405.8 48.63 103.7 62.24 195.9 45.47 282.8-23.76 56.63-45.16 117.8-38.39 216.4 13V0z" fill="%23f0f8ff" opacity=".8"/></svg>') repeat-x bottom;
    background-size: cover;
    pointer-events: none;
}

/* 4. Gallery Hover Tilt */
.tilt-hover {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tilt-hover:hover {
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s;
    text-align: center;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-primary-orange);
}

.gallery-caption p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--color-text-dark);
}

/* FIX: Mobile Image Framing & Sizing */
@media (max-width: 768px) {

    /* Cards: Add 'Recuadro' (Frame) effect */
    .card {
        padding: 15px !important;
        /* Forces whitespace around content acting as frame */
        background: #fff;
    }

    .card-img {
        width: 100%;
        height: 160px;
        /* Reduced height to prevent oversized look */
        border-radius: 10px;
        /* Smooth corners inside the frame */
        background-size: cover;
        background-position: center top;
        /* Focus on top/center of images */
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Hero: Adjust background to be less zoomed */
    .hero {
        background-position: center;
        background-attachment: scroll;
        /* Fix for mobile browsers */
    }

    .hero-logo {
        display: none;
        /* Hide logo on mobile as requested */
    }
}

/* Fix for Instalaciones Mobile Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        padding: 0 10px;
    }

    .gallery-item {
        height: auto !important;
        aspect-ratio: 1/1;
        /* Force Square */
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .gallery-img {
        height: 100%;
        object-fit: cover;
    }

    .gallery-caption {
        transform: translateY(0) !important;
        /* Always visible */
        background: rgba(255, 255, 255, 0.95);
        /* Almost solid white for contrast */
        padding: 5px;
        bottom: 0;
    }

    .gallery-caption h3 {
        font-size: 0.85rem;
        margin-bottom: 2px;
        color: var(--color-primary-orange) !important;
        font-weight: 800;
        text-shadow: none !important;
    }

    .gallery-caption p {
        font-size: 0.75rem;
        line-height: 1.1;
        color: #000 !important;
        /* Force Black */
        text-shadow: none !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Slide In Animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 1s ease-out;
}