/* ===== ESTILOS OPTIMIZADOS PARA REDUCIR CLS ===== */

/* Cookie Banner optimizado para mínimo CLS */
.cookie-banner {
    contain: layout style paint;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.cookie-banner.show {
    animation: slideUpSmooth 0.4s ease-out forwards;
}

@keyframes slideUpSmooth {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hero Section - estilos adicionales */
.hero__subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-align: justify;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.hero__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn--hero-consult {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn--hero-consult:hover {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn--full {
    width: 100%;
}

.btn--secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Services Section */
.services {
    background: var(--bg-light);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-card__icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.service-card__icon svg {
    width: 30px;
    height: 30px;
}

.service-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.service-card__description {
    color: var(--text-light);
    line-height: 1.6;
}

/* About Section */
.about__content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about__text {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.about__intro h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.about__description {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 1.05rem;
}

.about__features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about__feature h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.about__feature p {
    color: var(--text-light);
    line-height: 1.6;
}

.about__image {
    position: relative;
}

.about__img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.about__img:hover {
    transform: scale(1.02);
}

/* Advantages Section */
.advantages__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.advantage-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.advantage-card:hover {
    background: var(--bg-color);
    box-shadow: var(--shadow);
}

.advantage-card__icon {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.advantage-card__icon svg {
    width: 24px;
    height: 24px;
}

.advantage-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.advantage-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Objectives Section */
.objectives__content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: stretch;
    max-width: 1000px;
    margin: 0 auto;
}

.objectives__image {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.objectives__img {
    width: 100%;
    max-width: 450px;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.objectives__img:hover {
    transform: scale(1.02);
}

.objectives__list {
    max-width: 100%;
}

.objective {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.objective__checkmark {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

.objective h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.objective p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    background: var(--bg-light);
}

.contact__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.contact__info {
    max-width: none;
    text-align: left;
}

.contact__description {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact__item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.contact__item strong {
    color: var(--primary-dark);
}

/* Form */
.contact__form {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(30 64 175 / 0.1);
}

/* Privacy Checkbox */
.privacy-checkbox {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label:hover .checkmark {
    background-color: #fff;
    border: 3px solid #1e40af;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #1e40af;
    border-color: #1e40af;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: underline;
}

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

.checkbox-text {
    flex: 1;
    line-height: 1.4;
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer__brand {
    max-width: 400px;
}

.footer__logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.footer__description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer__contact h4,
.footer__legal h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer__contact p,
.footer__legal a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 1.6;
}

.footer__legal a:hover {
    color: white;
}

.footer__legal-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Contact links en header */
.nav__contact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.nav__contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav__contact-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.nav__contact-icon {
    width: 18px;
    height: 18px;
    transition: var(--transition);
}

/* Responsive Design adicional */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    section {
        padding: 60px 0;
    }

    .hero {
        padding: 100px 0 60px;
        min-height: 60vh;
    }

    .hero__subtitle {
        font-size: 0.9rem;
    }

    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }

    .services__grid {
        grid-template-columns: 1fr;
    }

    .about__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .objectives__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .advantages__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about__text {
        order: 1;
    }

    .about__image {
        order: 2;
    }

    .objectives__image {
        order: 1;
    }

    .objectives__list {
        order: 2;
    }

    .contact__info {
        order: 1;
        text-align: center;
    }

    .contact__form {
        order: 2;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .footer__content {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav__brand {
        gap: 0.5rem;
    }

    .nav__title {
        font-size: 1.25rem;
    }

    .hero {
        min-height: 50vh;
    }

    .hero__title {
        font-size: 1.75rem;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .about__content {
        gap: 1.5rem;
    }

    .objectives__content {
        gap: 1.5rem;
    }

    .contact__content {
        gap: 1.5rem;
    }
}

/* Text Justification */
.text-justify {
    text-align: justify;
}

p {
    text-align: justify;
    line-height: 1.6;
}

.service-card__description,
.advantage-card p,
.about__description,
.about__feature p,
.contact__description,
.footer__description,
.cookie-banner__text p {
    text-align: justify;
    line-height: 1.6;
}

/* Títulos centrados */
.section__title,
.section__subtitle,
.hero__title,
.hero__subtitle,
.hero__description {
    text-align: center;
}

.service-card__title,
.advantage-card h3,
.about__intro h3,
.about__feature h4,
.contact__item,
.footer__contact p {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.whatsapp-float svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.whatsapp-float span {
    position: absolute;
    right: 70px;
    background: #25d366;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 5px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-float:hover span {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* Cookie Banner optimizado para PC y móvil */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    color: #000000;
    padding: 1.5rem;
    z-index: 1001;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #1e40af;
    transition: all 0.3s ease;
    transform: translateY(100%);
    opacity: 0;
    /* Containment para mejor rendimiento */
    contain: layout style paint;
    will-change: transform, opacity;
}

.cookie-banner.show {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
}

.cookie-banner.minimized {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
}

.cookie-banner__content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    gap: 2rem;
    transition: all 0.3s ease;
}

.cookie-banner.minimized .cookie-banner__content {
    display: none;
}

.cookie-banner__minimized {
    display: none;
    align-items: center;
    justify-content: flex-start;
    max-width: 1600px;
    margin: 0 auto;
    gap: 1rem;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: auto;
    min-width: 120px;
}

.cookie-banner.minimized .cookie-banner__minimized {
    display: flex;
}

.cookie-banner__minimized span {
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: lowercase;
}

.cookie-banner__minimized .cookie-banner__close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.cookie-banner__minimized .cookie-banner__close:hover {
    background: #f3f4f6;
    color: #374151;
}

.cookie-banner__text {
    flex: 1;
    max-width: 1000px;
}

.cookie-banner__text h3 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.cookie-banner__text p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #374151;
}

.cookie-banner__text strong {
    color: #1e40af;
    font-weight: 600;
}

.cookie-banner__text a {
    color: #1e40af;
    text-decoration: underline;
}

.cookie-banner__text a:hover {
    color: #1e3a8a;
}

.cookie-banner__buttons {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    min-width: 250px;
    flex-wrap: wrap;
}

.cookie-banner__buttons button {
    padding: 0.75rem 1rem;
    border: 2px solid #1e40af;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn--cookie-accept {
    background: #1e40af;
    color: white;
}

.btn--cookie-accept:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

.btn--cookie-reject {
    background: white;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.btn--cookie-deny {
    background: #dc2626;
    color: white;
    border: 2px solid #dc2626;
}

.btn--cookie-deny:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Notification System */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1002;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification--success {
    background: #ffffff;
    color: #10b981;
    border: 2px solid #10b981;
}

.notification--error {
    background: #ffffff;
    color: #ef4444;
    border: 2px solid #ef4444;
}

.notification__close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-banner__content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .cookie-banner__buttons {
        justify-content: center;
        min-width: auto;
        gap: 0.5rem;
    }

    .cookie-banner__buttons button {
        flex: 1;
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    .cookie-banner__text {
        max-width: none;
    }

    .cookie-banner__text h3 {
        font-size: 1.1rem;
    }

    .cookie-banner__text p {
        font-size: 0.85rem;
    }

    .cookie-banner__minimized {
        bottom: 80px;
        left: 10px;
        right: 10px;
        width: auto;
        justify-content: center;
        padding: 0.6rem 1rem;
    }
}
