/* ===== RESET Y VARIABLES GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #000000;
    --primary-text: #ffffff;
    --secondary-bg: #1a1a1a;
    --accent-color: #ff6600;
    --secondary-accent: #a33cb3;
    --transition-speed: 0.5s;
}

body.light-mode {
    --primary-bg: #ffffff;
    --primary-text: #1a1a1a;
    --secondary-bg: #f0f0f0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* ===== COMPONENTES REUTILIZABLES ===== */
.bordered {
    border: 0.125rem solid var(--accent-color);
}

.hero-btn, .service-btn, .form-btn {
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.hero-btn:hover, .service-btn:hover, .form-btn:hover {
    transform: scale(1.1);
}

/* ===== ICONOS ===== */
.icon {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

body.light-mode .icon {
    filter: none;
}

.faq-icon, .value-icon {
    width: 3rem;
    height: 3rem;
    filter: brightness(0) saturate(100%) invert(28%) sepia(87%) saturate(2109%) hue-rotate(1deg) brightness(102%) contrast(102);
    animation: sparkleBoing 1.5s ease-in-out infinite;
}

body.light-mode .faq-icon,
body.light-mode .value-icon {
    filter: brightness(0) saturate(100%) invert(43%) sepia(92%) saturate(1352%) hue-rotate(2deg) brightness(103%) contrast(101);
}

.service-list-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    filter: brightness(0) saturate(100%) invert(40%) sepia(81%) saturate(4367%) hue-rotate(264deg) brightness(97%) contrast(101);
}

body.light-mode .service-list-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(68%) saturate(3759%) hue-rotate(261deg) brightness(94%) contrast(93);
}

.github-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.625rem;
    filter: brightness(0) invert(1);
}

body.light-mode .github-icon {
    filter: none;
}

/* ===== BOTÓN TEMA ===== */
.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--accent-color);
    color: var(--primary-text);
    border: none;
    padding: 0.625rem 0.9375rem;
    border-radius: 1.5625rem;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-speed) ease, background var(--transition-speed) ease;
}

.theme-toggle:hover {
    background: #e65c00;
}

.theme-toggle .icon {
    filter: brightness(0) invert(1);
}

body.light-mode .theme-toggle .icon {
    filter: none;
}

/* ===== HEADER Y HERO ===== */
.header {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ===== CARRUSEL ===== */
.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.carousel-item.active {
    opacity: 1;
    z-index: 2;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transform: scale(1.03);
    transition: transform 12s ease-out;
}

.carousel-item.active img {
    transform: scale(1);
}

.hero-content {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 102, 0, 0.2);
    padding: 2.5rem;
    border-radius: 0.9375rem;
    text-align: center;
    max-width: 80%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

body.light-mode .hero-content {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
}

.hero-title {
    font-size: clamp(2rem, 3vw, 3rem);
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1875rem;
    animation: slideIn 1s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin: 1.25rem 0;
    color: var(--primary-text);
    animation: fadeIn 1.5s ease-out;
}

.hero-btn {
    background: var(--accent-color);
    padding: 0.9375rem 1.875rem;
    font-size: 1.2rem;
    border-radius: 3.125rem;
    box-shadow: 0 0.3125rem 0.9375rem rgba(255, 102, 0, 0.5);
    animation: bounceIn 2s ease-out;
    text-decoration: none;
    color: var(--primary-text);
    display: inline-block;
}

/* ===== ANIMACIONES ===== */
@keyframes slideIn {
    from { transform: translateY(-3.125rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes sparkleBoing {
    0% { transform: scale(1); }
    50% { transform: scale(1.05) translateY(-0.2rem); }
    100% { transform: scale(1); }
}

/* ===== SECCIONES GENERALES ===== */
main section {
    padding: 6.25rem 1.25rem;
    opacity: 0;
    transform: translateY(3.125rem);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

main section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2.8rem;
    color: var(--primary-text);
    text-transform: uppercase;
    letter-spacing: 0.125rem;
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.625rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6.25rem;
    height: 0.1875rem;
    background: var(--primary-text);
    border-radius: 0.125rem;
}

/* ===== SERVICIOS ===== */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
    gap: 1.875rem;
    padding: 0 1.25rem;
}

.service-item {
    background: var(--secondary-bg);
    padding: 1.875rem;
    border-radius: 0.9375rem;
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-item:hover {
    transform: translateY(-0.625rem);
    box-shadow: 0 0.625rem 1.25rem rgba(149, 51, 164, 0.5);
}

.service-img {
    width: 12.5rem;
    height: 12.5rem;
    object-fit: cover;
    border-radius: 0.625rem;
    margin-bottom: 1.25rem;
}

.service-title {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.service-description {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 1rem;
}

body.light-mode .service-description {
    color: #4a4a4a;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    text-align: left;
}

.service-list li {
    font-size: 0.95rem;
    color: #b0b0b0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

body.light-mode .service-list li {
    color: #4a4a4a;
}

.service-btn {
    margin-top: 0.9375rem;
    background: var(--accent-color);
    padding: 0.9375rem 1.875rem;
    font-size: 1.2rem;
    border-radius: 3.125rem;
    color: var(--primary-text);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.service-btn:hover {
    transform: scale(1.1);
}

.tech-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.tech-icons img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

/* ===== POR QUÉ ELEGIRNOS ===== */
.values-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
    gap: 1.875rem;
}

.value-item {
    background: var(--secondary-bg);
    padding: 1.875rem;
    border-radius: 0.9375rem;
    text-align: center;
    border-left: 0.3125rem solid var(--secondary-accent);
}

.value-title {
    font-size: 1.5rem;
    color: var(--primary-text);
    margin-bottom: 0.625rem;
}

.value-description {
    font-size: 1rem;
    color: #b0b0b0;
}

body.light-mode .value-description {
    color: #4a4a4a;
}

/* ===== FAQ ===== */
.faq-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(15.625rem, 1fr));
    gap: 1.25rem;
    max-width: 90%;
    margin: 0 auto;
}

.faq-item {
    background: var(--secondary-bg);
    padding: 1.25rem;
    border-radius: 0.625rem;
    border-left: 0.3125rem solid var(--secondary-accent);
    text-align: center;
}

.faq-text {
    font-size: 1rem;
    color: #b0b0b0;
}

body.light-mode .faq-text {
    color: #4a4a4a;
}

.faq-container article:nth-child(n+4) {
    grid-column: span 1.5;
}

/* ===== CONTACTO ===== */
.contact-form {
    background: var(--secondary-bg);
    padding: 2.5rem;
    border-radius: 0.9375rem;
    max-width: 37.5rem;
    margin: 0 auto 1.875rem;
    position: relative;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.9375rem;
    margin-bottom: 0.9375rem;
    border: 0.125rem solid var(--accent-color);
    border-radius: 0.5rem;
    background: #0a0a0a;
    color: #e0e0e0;
}

body.light-mode .form-input,
body.light-mode .form-textarea {
    background: #ffffff;
    color: var(--primary-text);
}

.form-btn {
    width: 100%;
    padding: 0.9375rem;
    background: var(--accent-color);
    color: var(--primary-text);
    border: none;
    border-radius: 3.125rem;
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.form-message {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.3125rem;
    display: none;
    font-size: 1rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.form-message.error {
    background: #ff4d4d;
    color: black;
    display: block;
}

.form-message.success {
    background: #4dff4d;
    color: black;
    display: block;
}

/* ===== WHATSAPP ===== */
.whatsapp-btn {
    text-align: center;
    margin-top: 0.3125rem;
}

.whatsapp-btn a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    color: var(--primary-text);
    padding: 0.625rem 1.25rem;
    border-radius: 3.125rem;
    font-size: 1rem;
    text-decoration: none;
    transition: transform var(--transition-speed) ease;
}

.whatsapp-btn a:hover {
    transform: scale(1.1);
}

.whatsapp-btn .icon {
    margin-right: 0.5rem;
    filter: brightness(0) invert(1);
}

body.light-mode .whatsapp-btn .icon {
    filter: none;
}

/* ===== MAPA ===== */
.map-container {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.map-box {
    background: var(--secondary-bg);
    padding: 1.875rem;
    border-radius: 0.9375rem;
    border-left: 0.3125rem solid var(--secondary-accent);
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

body.light-mode .map-box {
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.1);
}

.map-box:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.9375rem 1.875rem rgba(0, 0, 0, 0.4);
}

body.light-mode .map-box:hover {
    box-shadow: 0 0.9375rem 1.875rem rgba(0, 0, 0, 0.2);
}

.map-box iframe {
    width: 100%;
    height: 25rem;
    border: none;
    border-radius: 0.625rem;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--secondary-bg);
    padding: 1.5rem;
    text-align: center;
    max-width: 95%;
    margin: 0 auto;
    border-radius: 0.9375rem;
    margin-top: 3.125rem;
    margin-bottom: 1.25rem;
}

.footer-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.contact-info {
    background: #393939;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    max-width: 60%;
}

body.light-mode .contact-info {
    background: #333;
}

.footer-logo {
    height: 200px;
    margin-right: 1.5rem;
    vertical-align: top;
}

.contact-details {
    flex: 1;
    text-align: left;
    max-width: 70%;
    padding-top: 3.8rem;
}

.contact-info p {
    color: var(--accent-color);
    margin: 0.75rem 0;
}

.contact-info .email-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.contact-info .email-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-text {
    color: var(--primary-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.social-icons {
    margin-top: 1.25rem;
}

.social-link {
    font-size: 1.8rem;
    margin: 0 0.9375rem;
    color: #e0e0e0;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

body.light-mode .social-link {
    color: #000000;
}

.social-link:hover {
    color: var(--secondary-accent);
    text-decoration: none;
}

body.light-mode .social-link:hover {
    color: var(--secondary-accent);
}

.social-link .icon {
    width: 1.5rem;
    height: 1.5rem;
    filter: brightness(0) invert(1);
    transition: filter var(--transition-speed) ease;
}

body.light-mode .social-link .icon {
    filter: none;
}

.social-link:hover .icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(81%) saturate(4367%) hue-rotate(264deg) brightness(97%) contrast(101);
}

body.light-mode .social-link:hover .icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(68%) saturate(3759%) hue-rotate(261deg) brightness(94%) contrast(93);
}










/* ===== PROYECTOS ===== */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 0 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-item {
    background: var(--secondary-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 102, 0, 0.1);
}

.project-item:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 1rem 2rem rgba(149, 51, 164, 0.3);
    border-color: var(--accent-color);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    background: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
}

.project-link.github {
    background: transparent;
    border-color: white;
}

.project-link:hover {
    background: white;
    color: var(--accent-color);
    transform: scale(1.05);
}

.project-link.github:hover {
    background: white;
    color: #333;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.project-description {
    color: #b0b0b0;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

body.light-mode .project-description {
    color: #666;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(255, 102, 0, 0.1);
    color: var(--accent-color);
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-text);
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ===== MEDIA QUERIES ===== */

/* Móviles (hasta 767px) */
@media (max-width: 767px) {
    .hero-title {
        font-size: clamp(1.5rem, 2.5vw, 2rem);
    }

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

    .hero-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    main section {
        padding: 3rem 1rem;
    }

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

    .services-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .service-item {
        padding: 1.25rem;
    }

    .service-img {
        width: 10rem;
        height: 10rem;
    }

    .service-title {
        font-size: 1.5rem;
    }

    .service-description {
        font-size: 0.9rem;
    }

    .service-list {
        list-style: disc inside;
    }

    .service-list li {
        font-size: 0.85rem;
    }

    .service-list-icon {
        width: 1.2rem;
        height: 1.2rem;
    }

    .service-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .tech-icons {
        gap: 0.75rem;
    }

    .tech-icons img {
        width: 1.75rem;
        height: 1.75rem;
    }

    .values-container {
        grid-template-columns: 1fr;
    }

    .value-item {
        padding: 1.25rem;
    }

    .value-icon {
        width: 2rem;
        height: 2rem;
    }

    .value-title {
        font-size: 1.3rem;
    }

    .faq-container {
        grid-template-columns: 1fr;
    }

    .faq-container article:nth-child(n+4) {
        grid-column: span 1;
    }

    .faq-item {
        padding: 1rem;
    }

    .faq-icon {
        width: 2rem;
        height: 2rem;
    }

    .contact-form {
        padding: 1.5rem;
        max-width: 100%;
    }

    .form-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .map-box {
        padding: 1.25rem;
    }

    .map-box iframe {
        height: 15rem;
    }

    .footer {
        padding: 1rem;
    }

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

    .contact-info {
        max-width: 90%;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-logo {
        height: 150px;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .contact-details {
        padding-top: 0;
        max-width: 100%;
    }

    .social-link .icon {
        width: 1.2rem;
        height: 1.2rem;
    }

    .projects-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .project-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
        /* REGLAS ESPECÍFICAS PARA PROYECTOS EN MÓVIL */
    #proyectos {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }
    
    #proyectos .project-item {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
        animation: none !important;
    }
    
    /* Asegurar que los proyectos se muestren correctamente */
    .projects-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
    }
    
    .project-item {
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto 2rem !important;
    }
    
    /* Deshabilitar todas las animaciones de entrada en móvil */
    main section {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }
}

/* Tablets/iPads (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-title {
        font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-btn {
        padding: 0.85rem 1.65rem;
        font-size: 1.1rem;
    }

    main section {
        padding: 4rem 1.5rem;
    }

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

    .services-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-item {
        padding: 1.5rem;
    }

    .service-img {
        width: 11rem;
        height: 11rem;
    }

    .service-description {
        font-size: 0.95rem;
    }

    .service-list li {
        font-size: 0.9rem;
    }

    .service-list-icon {
        width: 1.3rem;
        height: 1.3rem;
    }

    .tech-icons {
        gap: 0.9rem;
    }

    .tech-icons img {
        width: 2rem;
        height: 2rem;
    }

    .values-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .value-item {
        padding: 1.5rem;
    }

    .value-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .faq-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-container article:nth-child(n+4) {
        grid-column: span 1;
    }

    .faq-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .contact-form {
        padding: 2rem;
        max-width: 90%;
    }

    .map-box {
        padding: 1.5rem;
    }

    .map-box iframe {
        height: 20rem;
    }

    .contact-info {
        max-width: 80%;
    }

    .footer-logo {
        height: 180px;
    }

    .social-link .icon {
        width: 1.3rem;
        height: 1.3rem;
    }

    .projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
}