/* =============================================
   SERVICIOS PLANIFICADOS APULO - ESTILOS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #27AE60;      /* Verde Apulo */
    --primary-dark: #1E8449;
    --primary-light: #E9F7EF;
    --secondary: #F39C12;    /* Amarillo/Dorado Apulo */
    --secondary-hover: #D68910;
    --dark: #2C3E50;
    --text: #495057;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --border: #DEE2E6;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.12);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* === LOADER === */
.loader {
    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, visibility 0.5s;
}
.loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader__spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === NAVBAR === */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    padding: 0.8rem 5%;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}
.navbar__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark);
}
.navbar__logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}
.navbar.scrolled .navbar__logo img {
    height: 48px;
}
.navbar__menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}
.navbar__link {
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}
.navbar__link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary);
    transition: var(--transition);
}
.navbar__link:hover::after, .navbar__link.active::after {
    width: 100%;
}
.navbar__dropdown {
    position: relative;
}
.navbar__dropdown-content {
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    opacity: 0; visibility: hidden;
    transition: var(--transition);
    padding: 0.5rem 0;
}
.navbar__dropdown:hover .navbar__dropdown-content {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.navbar__dropdown-content a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: var(--text);
    font-size: 0.9rem;
}
.navbar__dropdown-content a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.navbar__hamburger {
    display: none;
    background: none; border: none; cursor: pointer;
    flex-direction: column; gap: 5px;
}
.navbar__hamburger span {
    display: block; width: 25px; height: 3px;
    background: var(--dark);
    transition: var(--transition);
}

@media (max-width: 992px) {
    .navbar__hamburger { display: flex; }
    .navbar__menu {
        position: fixed;
        top: 70px; left: -100%; width: 100%; height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition);
        overflow-y: auto;
    }
    .navbar__menu.active { left: 0; }
    .navbar__dropdown-content {
        position: static; transform: none; box-shadow: none;
        opacity: 1; visibility: visible; display: none;
        background: var(--light); border-radius: var(--radius-sm);
        margin-top: 0.5rem;
    }
    .navbar__dropdown.open .navbar__dropdown-content { display: block; }
}

/* === HERO SECTION === */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.9), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1542261623-2895690b21e8?q=80&w=1920&auto=format&fit=crop') center/cover;
    color: var(--white);
    padding: 0 5%;
    overflow: hidden;
}
.hero__content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}
.hero__logo {
    height: 100px;
    margin-bottom: 1.5rem;
    background: var(--white);
    padding: 10px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.hero__title span {
    color: var(--secondary);
}
.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0.9;
}
.hero__cta {
    display: inline-block;
    background: var(--secondary);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}
.hero__cta:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

#particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none;
}
.hero__particle {
    position: absolute;
    bottom: -20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

/* === GENERAL SECTIONS === */
.section {
    padding: 6rem 5%;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.section.visible {
    opacity: 1;
    transform: translateY(0);
}
.section:nth-child(even) {
    background: var(--white);
}
.section__header {
    text-align: center;
    margin-bottom: 4rem;
}
.section__title {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.section__subtitle {
    color: var(--text);
    font-size: 1.1rem;
}
.section__divider {
    width: 60px;
    height: 4px;
    background: var(--secondary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* === ABOUT (NOSOTROS) === */
.about__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}
.about__card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.about__card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: var(--primary);
}
.about__card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}
.about__card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: var(--primary-light);
    width: 80px; height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}
.about__card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* === MANTENIMIENTOS === */
.gallery-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.gallery-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border);
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.gallery-card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s;
}
.gallery-card:hover .gallery-card__img {
    transform: scale(1.05);
}
.gallery-card__info {
    padding: 1.5rem;
}
.gallery-card__title {
    color: var(--dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.gallery-card__count {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.2rem 0.8rem;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 500;
}
.gallery-card__arrow {
    position: absolute;
    bottom: 1.5rem; right: 1.5rem;
    background: var(--primary);
    color: var(--white);
    width: 30px; height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}
.gallery-card:hover .gallery-card__arrow {
    opacity: 1;
    transform: translateX(0);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: var(--transition);
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-item__overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(39, 174, 96, 0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition);
}
.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}
.gallery-item__overlay span {
    color: white; font-size: 2rem;
}

/* === NORMATIVIDAD === */
.norm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}
.norm-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
}
.norm-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.norm-card__icon {
    font-size: 3rem; margin-bottom: 1rem;
}
.norm-card__icon img {
    height: 60px; object-fit: contain;
}
.norm-card__title {
    color: var(--dark); font-size: 1.1rem; margin-bottom: 0.5rem;
}

/* === CONTACTO === */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}
.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--dark);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea {
    min-height: 120px; resize: vertical;
}
.btn-submit {
    background: var(--primary); color: var(--white);
    border: none; padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600; cursor: pointer; width: 100%;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-dark);
}

.contact-info {
    display: flex; flex-direction: column; gap: 1.5rem;
}
.contact-info__item {
    display: flex; gap: 1rem; align-items: flex-start;
    background: var(--white); padding: 1.5rem;
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.contact-info__icon {
    font-size: 1.5rem; background: var(--primary-light);
    width: 50px; height: 50px; line-height: 50px; text-align: center;
    border-radius: 50%; color: var(--primary);
}
.contact-info__text h4 {
    color: var(--dark); margin-bottom: 0.3rem;
}
.map-container {
    height: 300px; border-radius: var(--radius-md); overflow: hidden; margin-top: 1rem;
}
.map-container iframe {
    width: 100%; height: 100%; border: none;
}

/* === FOOTER === */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.8);
    padding: 4rem 5% 1rem;
}
.footer__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem; margin-bottom: 3rem;
}
.footer__brand img {
    height: 50px; margin-bottom: 1rem;
    background: white; padding: 5px; border-radius: 8px;
}
.footer__title {
    color: var(--white); font-size: 1.2rem; margin-bottom: 1.5rem;
}
.footer__links {
    list-style: none;
}
.footer__links li {
    margin-bottom: 0.8rem;
}
.footer__links a {
    color: rgba(255,255,255,0.8);
}
.footer__links a:hover {
    color: var(--secondary); padding-left: 5px;
}
.footer__entes {
    display: flex; flex-direction: column; gap: 1rem;
}
.footer__ente {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.1); padding: 10px;
    border-radius: var(--radius-sm); color: var(--white);
}
.footer__ente:hover {
    background: rgba(255,255,255,0.2); color: var(--white);
}
.footer__ente-img {
    height: 30px; object-fit: contain; background: white; padding: 2px; border-radius: 4px;
}
.footer__bottom {
    text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1);
}

/* === LIGHTBOX & MODALS === */
.lightbox, .pdf-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 10000;
    opacity: 0; visibility: hidden; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.lightbox.active, .pdf-modal.active {
    opacity: 1; visibility: visible;
}
.lightbox__img {
    max-width: 90%; max-height: 80vh; border-radius: 4px; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.lightbox__caption {
    position: absolute; bottom: 20px; color: white; text-align: center; width: 100%;
}
.lightbox__close, .pdf-modal__close {
    position: absolute; top: 20px; right: 30px;
    background: none; border: none; color: white; font-size: 2rem; cursor: pointer;
}
.lightbox__prev, .lightbox__next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.2); border: none; color: white;
    width: 50px; height: 50px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: 0.3s;
}
.lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,0.4); }
.lightbox__prev { left: 20px; } .lightbox__next { right: 20px; }

.pdf-modal__content {
    width: 90%; height: 90%; background: white; border-radius: var(--radius-md);
    display: flex; flex-direction: column; overflow: hidden;
}
.pdf-modal__header {
    padding: 1rem 2rem; background: var(--light); display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--border);
}
.pdf-modal__header h3 { margin: 0; color: var(--dark); }
.pdf-modal__header .pdf-modal__close {
    position: static; color: var(--dark); font-size: 1.5rem;
}
.pdf-modal__content iframe {
    width: 100%; flex: 1; border: none;
}

/* === TOAST === */
.toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    background: white; padding: 1rem 1.5rem; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
    animation: slideInRight 0.3s ease-out; font-weight: 500;
}
.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid #E74C3C; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === BACK TO TOP === */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--primary); color: white; border: none;
    width: 45px; height: 45px; border-radius: 50%; font-size: 1.2rem;
    cursor: pointer; box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transition: var(--transition); z-index: 999;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
