html,
body {
    width: 100%;
    overflow-x: hidden;
}

:root {
    --primary-color: #d92332;
    /* Rojo */
    --secondary-color: #1a6fc9;
    /* Azul */
    --dark-color: #121212;
    /* Negro */
    --light-color: #f8f9fa;
    /* Blanco */
}

body {
    font-family: 'Roboto', sans-serif;
    color: #333;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 0;
    font-size: 2rem;
    color: var(--secondary-color);
    width: 100%; /* Ensure it doesn't overflow */
}

.title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #fa0101, #06060a);
    margin: 0 15px;
    max-width: 30%; /* Prevent lines from becoming too wide */
}

.title-text {
    padding: 0 15px;
    text-align: center;
}

.navbar {
    background: linear-gradient(90deg, #fe0202, #07070b) !important;
    padding: 15px 0;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    height: 60px;
    transition: all 0.3s;
}

.nav-link {
    color: white !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #b51d2a;
    border-color: #b51d2a;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/img/logo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 150px 0;
    text-align: center;
    position: relative;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

.hero-section p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease;
}

.hero-logo {
    max-width: 100px;
    border-radius: 45%;
    margin-bottom: 30px;
    animation: bounceIn 1s ease;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background-color: white;
}

.about-img {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.about-img:hover {
    transform: scale(1.02);
}

.value-item {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.value-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.value-item i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    transition: color 0.3s ease;
    /* Transición suave para el color del ícono */
}

.value-item:hover i {
    color: white;
}

/* Services Section */
.services-section {
    padding: 100px 0;
    background-color: #f8f9fa;
}

.service-card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
    background-color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    /* !important no es necesario aquí */
}

.img-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.service-card .card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    border: none;
    border-radius: 0.3rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    width: fit-content;
    align-self: center;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(18, 140, 126, 0.3);
}

.service-card:hover .btn-whatsapp {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.service-card .carousel-item img {
    height: 200px;
    object-fit: cover;
}

.service-card .carousel-control-prev-icon,
.service-card .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.service-card .carousel-control-prev,
.service-card .carousel-control-next {
    width: 15%;
}

/* Contact Section */
.contact-section {
    padding: 100px 0;
    background-color: white;
}

.contact-form {
    background-color: #f8f9fa;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-info {
    padding: 40px;
}

.contact-info-item {
    margin-bottom: 30px;
}

.contact-info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
}

/* Footer */
.footer {
    background: linear-gradient(90deg, #fa0101, #040407);
    color: white;
    padding: 50px 0 20px;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
    transition: all 0.3s;
}

.social-icons a:hover {
    color: var(--dark-color);
    transform: translateY(-3px);
}

.footer-links h5 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 30px;
}

/* Scroll Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 90px; /* Adjusted to be above WhatsApp button */
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    line-height: 50px;
    cursor: pointer;
    display: none; /* Oculto por defecto */
    z-index: 1050;
    transition: all 0.3s ease;
}

.scroll-top-btn:hover {
    background-color: #b51d2a;
    transform: translateY(-5px);
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px; /* Adjusted to be below scroll-top button */
    right: 20px;
    background: linear-gradient(135deg, #ff2d3d 0%, #000000 100%);
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(255,45,61,0.45), 0 2px 8px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,45,61,0.35);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.whatsapp-float:hover {
    filter: brightness(1.08);
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(255,45,61,0.55), 0 4px 12px rgba(0,0,0,0.4);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Gallery Section */
.gallery-section {
    padding: 150px 0 100px;
    /* Más padding superior para compensar el navbar fijo */
    background-color: white;
}

.carousel-item img {
    height: 70vh;
    object-fit: cover;
    border-radius: 0.5rem;
}

.carousel-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1rem 1.5rem;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.gallery-grid {
    margin-top: 60px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    /* Espacio entre items */
}

.gallery-item img {
    transition: transform 0.4s ease;
    width: 100%;
    height: 280px;
    /* Altura fija para las imágenes de la grilla */
    object-fit: cover;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .navbar-brand img {
        height: 40px;
    }

    .about-img {
        margin-bottom: 30px;
    }

    .hero-section {
        /* Mejora el rendimiento en móviles al desactivar el efecto parallax */
        background-attachment: scroll;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 80px 0;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }

    .scroll-top-btn {
        bottom: 90px; /* Adjusted to be above WhatsApp button on mobiles */
    }
}

/* Image Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10000; /* Sit on top */
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 700px;
    max-height: 90vh; /* Limit height to viewport height */
    object-fit: contain; /* Ensure the image fits within the bounds */
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content, #caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive adjustments for modal */
@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}

@keyframes wave {
    0% { transform: rotate(0.0deg) }
   10% { transform: rotate(14.0deg) }
   20% { transform: rotate(-8.0deg) }
   30% { transform: rotate(14.0deg) }
   40% { transform: rotate(-4.0deg) }
   50% { transform: rotate(10.0deg) }
   60% { transform: rotate(0.0deg) }
  100% { transform: rotate(0.0deg) }
}

.wave {
  animation-name: wave;
  animation-duration: 2.5s;
  animation-iteration-count: infinite;
  transform-origin: 70% 70%;
  display: inline-block;
}