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

:root {
    --primary: #007bff;
    --secondary: #FFD700;
    --light-bg: #f8fafc; 
    --dark-bg: #121212;
    --light-text: #333;
    --dark-text: #eee;
    --dark-primary: #007bff20;
}

html, body {
    overflow-x: clip; 
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--light-text);
    scroll-behavior: smooth;
    transition: background-color 0.5s, color 0.5s;
}

h1, h2, h3, h4, .h2, .p, .need-title {
    font-family: 'Poppins', sans-serif;
}

.primary-bg { background-color: var(--primary); color: #fff; }
.secondary-bg { background-color: var(--secondary); color: #000; }
.section-padding { padding: 80px 0; }

.parallax {
    background: url('https://images.unsplash.com/photo-1604335399108-e7a3e31b7f09?auto=format&fit=crop&w=1500&q=80') no-repeat center center / cover fixed;
    padding: 150px 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-primary, .btn-secondary {
    border: none;
    transition: transform 0.3s, background-color 0.3s;
}

.btn-primary { background-color: var(--primary); }
.btn-primary:hover { background-color: #0056b3; transform: scale(1.05); }

.btn-secondary { background-color: var(--secondary); }
.btn-secondary:hover { background-color: #e0a800; transform: scale(1.05); }

/* =========================================================
   TARJETAS GENÉRICAS
========================================================= */
.card, .hover-effect {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card p { transition: color 0.3s; }
.card:hover p { color: var(--primary); }

.hover-effect { border-radius: 8px; }
.hover-effect:hover { transform: scale(1.2); }

/* =========================================================
   NAVBAR Y MODO OSCURO
========================================================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: 0.4s;
}

nav.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: 0.4s;
}

.dark-mode {
    background-color: var(--dark-bg) !important;
    color: var(--dark-text) !important;
}

.dark-mode nav.navbar { background-color: #222 !important; }
.dark-mode .primary-bg { background-color: #0056b3 !important; }
.dark-mode .secondary-bg { background-color: #ff9800 !important; }

/* =========================================================
   HERO CAROUSEL
========================================================= */
#heroCarousel .carousel-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    #heroCarousel .carousel-item img { max-height: 70vh; }
    #heroCarousel .carousel-item { height: auto; }
}

/* =========================================================
   NEED CARDS (Por qué elegirnos)
========================================================= */
.need-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.need-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.need-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.need-text {
    color: #555;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Reglas compartidas entre iconos */
.icon-circle, .icon-wrapper {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto; /* Asegura el centrado */
    color: #000;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.icon-circle { background-color: var(--dark-primary); }
.icon-wrapper { background-color: var(--secondary); }

.icon-circle:hover { background-color: #007bff40; }
.need-card:hover .icon-wrapper { transform: scale(1.1) rotate(1deg); }

.custom-icon, .custom-icon_negro {
    width: 80%;
    height: auto;
    object-fit: contain;
    max-width: 100%; 
}

/* =========================================================
   SLIDER DE CATEGORÍAS (Nativo)
========================================================= */
.categoria-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.scrollbar-hidden::-webkit-scrollbar { display: none; }
.scrollbar-hidden { -ms-overflow-style: none; scrollbar-width: none; }

.categoria-card {
    flex: 0 0 350px;
    width: 250px;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    scroll-snap-align: start;
    box-shadow: 0 5px 15px rgba(235, 235, 235, 0.15);
    background-color: var(--bs-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.categoria-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.categoria-img {
    height: 60%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.categoria-desc {
    height: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Flechas de navegación del Slider Nativo */
.categoria-carousel-control-prev,
.categoria-carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.categoria-carousel-control-prev:hover,
.categoria-carousel-control-next:hover { opacity: 1; }

.categoria-carousel-control-prev { left: 0; margin-left: -20px; }
.categoria-carousel-control-next { right: 0; margin-right: -20px; }

.categoria-carousel-control-prev .carousel-control-prev-icon,
.categoria-carousel-control-next .carousel-control-next-icon {
    filter: invert(0) grayscale(100%);
}

@media (max-width: 768px) {
    .categoria-card {
        width: 200px;
        height: 280px;
    }
    .categoria-carousel-control-prev,
    .categoria-carousel-control-next { display: none; }
}

@media (min-width: 1024px) {
    .categoria-slider {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
        overflow-x: hidden;
        scroll-snap-type: none;
        padding-bottom: 0;
    }
    .categoria-card {
        flex: unset !important;
        scroll-snap-align: unset;
        height: auto;
        display: grid;
        grid-template-rows: auto 1fr;
    }
    .categoria-img { height: 300px; }
    .categoria-desc { height: auto; padding: 1rem; }
}

/* =========================================================
   SWIPER DE CATEGORÍAS (Librería Externa)
========================================================= */
.categorias-swiper-container { padding: 40px 0; }
.categorias-swiper { width: 100%; padding: 20px 50px; }

.categoria-card-swiper {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
}

.categoria-card-swiper:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.categoria-img-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.categoria-img-swiper {
    width: 346px;
    height: 320px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.categoria-card-swiper:hover .categoria-img-swiper { transform: scale(1.05); }

.categoria-desc-swiper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background-color: #ffffff;
}

/* Controles Swiper */
.categorias-swiper-button-prev,
.categorias-swiper-button-next {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.categorias-swiper-button-prev:hover,
.categorias-swiper-button-next:hover {
    background-color: var(--primary);
    transform: scale(1.1);
}

.categorias-swiper-button-prev:after,
.categorias-swiper-button-next:after {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.categorias-swiper-button-prev:hover:after,
.categorias-swiper-button-next:hover:after { color: #fff; }

.categorias-swiper-pagination { bottom: 0 !important; }

.categorias-swiper-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    opacity: 1;
    transition: all 0.3s ease;
}

.categorias-swiper-pagination .swiper-pagination-bullet-active {
    background-color: var(--primary);
    width: 30px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .categorias-swiper { padding: 20px 10px; }
    .categorias-swiper-button-prev, .categorias-swiper-button-next { width: 40px; height: 40px; }
    .categorias-swiper-button-prev:after, .categorias-swiper-button-next:after { font-size: 16px; }
    .categoria-img-wrapper { height: 300px; }
}

@media (max-width: 576px) {
    .categorias-swiper-button-prev, .categorias-swiper-button-next { display: none; }
    .categoria-img-wrapper { height: 320px; }
}

/* AVISO COOKIES */
.aviso-cookies {
    display: none;
    background: #fff;
    padding: 20px;
    width: calc(100% - 40px);
    max-width: 300px;
    line-height: 150%;
    border-radius: 10px;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    padding-top: 60px;
    box-shadow: 0px 2px 20px 10px rgba(222, 222, 222, .25);
    text-align: center;
}

.aviso-cookies.activo { display: block; }
.aviso-cookies .titulo, .aviso-cookies .parrafo { margin-bottom: 15px; }

.aviso-cookies .boton {
    width: 100%;
    background: #595959;
    border: none;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    padding: 15px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .3s ease;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.aviso-cookies .boton:hover { background: #000; }
.aviso-cookies .enlace { color: #4DBFFF; text-decoration: none; font-size: 14px; }
.aviso-cookies .enlace:hover { text-decoration: underline; }

.fondo-aviso-cookies {
    display: none;
    background: rgba(0, 0, 0, .20);
    position: fixed;
    z-index: 99;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
}
.fondo-aviso-cookies.activo { display: block; }

/* ACORDEÓN */
.accordion-item:last-child { border-bottom: 0 !important; }
.accordion-button::after { background-size: 1.25rem; margin-left: 1rem; }
.accordion-button:not(.collapsed) {
    color: inherit;
    background-color: transparent;
    box-shadow: none;
}
.accordion-button:not(.collapsed) i { color: var(--primary) !important; }

/* PREFERENCIAS DE ACCESIBILIDAD (Reducción de movimiento) */
@media (prefers-reduced-motion: reduce) {
    .need-card, .icon-wrapper, .icon-circle, .card, .hover-effect {
        transition: none;
    }
}

#faq .accordion-collapse.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#faq .accordion-body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}