/*******************************************
 * 1. VARIABLES GLOBALES Y PALETA DE COLORES
 *******************************************/
:root {
    /* --- CONFIGURACIÓN DE COLORES PRINCIPALES --- */
    --primary: #393B8A;      /* Azul exacto del logo */
    --secondary: #E32B31;    /* Rojo exacto del logo */

    /* --- CONFIGURACIÓN DEL HEADER Y NAVBAR --- */
    --topbar-bg: var(--secondary);  /* Fondo rojo para la Top Bar */
    --topbar-text: #ffffff;         /* Texto blanco para la Top Bar */
    --header-bg: #ffffff;           /* Fondo del navbar principal (BLANCO) */
    --header-text: #111111;         /* Color de texto del navbar (NEGRO) */
    --header-hover: var(--primary);
    --header-active: #000000;

    /* --- PALETA GENERAL DE LA WEB --- */
    --light: #F7F8FC;
    --dark: #111111;
    --white: #ffffff;
    --text-muted: #999999;
    --dropdown-bg: #ffffff;
    --dropdown-hover-bg: #6969694f;
}

/*******************************************
 * 2. AJUSTES DE SCROLL Y ESTRUCTURA GENERAL
 *******************************************/
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    padding-top: 135px;
}

@media (max-width: 991.98px) {
    html {
        scroll-padding-top: 80px;
    }
    body {
        padding-top: 85px;
    }
}

/*******************************************
 * 3. UTILIDADES GENERALES
 *******************************************/
.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

.my-6 {
    margin-top: 6rem;
    margin-bottom: 6rem;
}

.py-6 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.bg-icon {
    background: url(../img/bg-icon.png) center center repeat;
    background-size: contain;
}

.container-fluid {
    width: 100%;
}

/* Spinner */
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*******************************************
 * 4. TOP BAR & NAVBAR
 *******************************************/
.fixed-top {
    transition: .5s;
    background-color: var(--header-bg) !important;
}

/* Top Bar */
.top-bar {
    height: 45px;
    background-color: var(--primary) !important;
    color: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.top-bar .text-body,
.top-bar a,
.top-bar i,
.top-bar small {
    color: var(--white) !important;
}

.top-bar a:hover,
.top-bar a:hover i {
    opacity: 0.8;
}

/* Navbar General */
.navbar {
    background-color: var(--header-bg) !important;
}

.navbar .navbar-brand h1 {
    color: var(--header-text);
}

.logo {
    width: 220px;
}

/* Botón de Menú Hamburguesa (CORREGIDO) */
.navbar-toggler {
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
    padding: 6px 10px !important;
    outline: none !important;
    box-shadow: none !important;
}

.navbar-toggler-icon {
    background-color: transparent !important; /* Quita el cuadro negro */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Navbar Enlaces */
.navbar .navbar-nav .nav-link {
    padding: 25px 15px;
    color: var(--header-text);
    font-weight: 500;
    outline: none;
}

.navbar .navbar-nav .nav-link:hover {
    color: var(--header-hover);
}

.navbar .navbar-nav .nav-link.active {
    color: var(--header-active);
    font-weight: 700;
}

/* Dropdown */
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar .dropdown-menu {
    background-color: var(--dropdown-bg);
}

.navbar .dropdown-item {
    color: var(--dark);
}

.navbar .dropdown-item:hover {
    background-color: var(--dropdown-hover-bg);
    color: var(--dark);
}

/* Responsive Navbar */
@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        margin-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, .07);
        background: var(--dropdown-bg);
    }

    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
        color: var(--dark);
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: .5s;
        opacity: 0;
    }

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}

/*******************************************
 * 5. BOTONES GENERALES
 *******************************************/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-outline-primary:hover,
.btn.btn-outline-secondary:hover {
    color: var(--white) !important;
}

/* --- BOTÓN PRIMARY --- */
.btn-primary,
button[type="submit"] {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

/* --- BOTÓN SECONDARY (BORDÓ) --- */
.btn-secondary {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: var(--white) !important;
}

.btn-secondary:hover {
    filter: brightness(0.9);
}

/* --- BOTÓN OUTLINE SECONDARY (TRANSPARENTE A BORDÓ) --- */
.btn-outline-secondary {
    color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: var(--white) !important;
    box-shadow: none !important;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn-square { width: 38px; height: 38px; }
.btn-sm-square { width: 32px; height: 32px; }
.btn-lg-square { width: 48px; height: 48px; }

.btn-sm-square small {
    color: var(--header-text);
}

/*******************************************
 * 6. HEADER Y CARRUSEL
 *******************************************/
.page-header {
    padding-top: 12rem;
    padding-bottom: 6rem;
    background: url(../img/carousel-1.jpg) top right no-repeat;
    background-size: cover;
}

.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: start;
    z-index: 1;
}

.custom-header-color,
.custom-header-color-2 { 
    color: var(--white); 
}

.carousel-control-prev,
.carousel-control-next {
    width: 15%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--primary);
    border: 10px solid var(--primary);
    border-radius: 3rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/*******************************************
 * 7. SECCIONES (About, Product, Testimonial)
 *******************************************/
.section-header {
    position: relative;
    padding-top: 25px;
}

.section-header::before {
    position: absolute;
    content: "";
    width: 60px;
    height: 2px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
}

.section-header::after {
    position: absolute;
    content: "";
    width: 90px;
    height: 2px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
}

.section-header.text-start::before,
.section-header.text-start::after {
    left: 0;
    transform: translateX(0);
}

/* About */
.about-img img {
    position: relative;
    z-index: 2;
}

.about-img::before {
    position: absolute;
    content: "";
    top: 0;
    left: -50%;
    width: 100%;
    height: 100%;
    background-image: repeating-radial-gradient(var(--white), #EEEEEE 5px, transparent 5px, transparent 10px);
    background-size: 20px 20px;
    transform: skew(20deg);
    z-index: 1;
}

/* Product / Comercios */
.product-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .07);
}

.product-item img {
    transition: .5s;
}

.product-item:hover img {
    transform: scale(1.1);
}

/* Titulo del negocio: Siempre negro, sin subrayado, incluso al hacer hover */
.product-item a.h5,
.product-item .h5,
.product-item h5 a {
    color: var(--dark) !important;
    text-decoration: none !important;
}

.product-item a.h5:hover,
.product-item .h5:hover,
.product-item h5 a:hover {
    color: var(--dark) !important;
}

/* Enlaces secundarios dentro de la tarjeta (ej. Ver Instagram / Ver Comercio) */
.product-item small a:hover {
    color: var(--primary) !important;
}

/* Testimonial */
.testimonial-carousel .owl-item .testimonial-item,
.testimonial-carousel .owl-item .testimonial-item * {
    transition: .5s;
}

.testimonial-carousel .owl-item .testimonial-item img {
    width: 60px;
    height: 60px;
}

.testimonial-carousel .owl-item.center .testimonial-item {
    background: var(--primary) !important;
}

.testimonial-carousel .owl-item.center .testimonial-item * {
    color: var(--white) !important;
}

.testimonial-carousel .owl-item.center .testimonial-item i {
    color: var(--secondary) !important;
}

.testimonial-carousel .owl-nav {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    margin: 0 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-size: 18px;
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    color: var(--white);
    background: var(--primary);
}

/*******************************************
 * 8. FOOTER
 *******************************************/
.footer {
    color: var(--text-muted);
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--text-muted);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--text-muted);
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--light);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.footer .copyright a {
    color: var(--light);
}

.footer .copyright a:hover {
    color: var(--primary);
}

/*******************************************
 * 9. CLASES DE UTILIDAD Y COLORES DE TEXTO
 *******************************************/
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }

.text-primary,
.product-item small a,
i.fa-check,
.text-primary i {
    color: var(--primary) !important;
}

.text-secondary { color: var(--secondary) !important; }

/*******************************************
 * 10. BOTONES DE FILTRO POR RUBRO (.btn-filter)
 *******************************************/
.btn-filter {
    color: var(--primary) !important;
    border: 2px solid var(--primary) !important;
    background-color: transparent !important;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-filter:hover,
.btn-filter.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

.btn-filter.active {
    box-shadow: 0 4px 10px rgba(109, 99, 241, 0.3);
}

/* Ajuste responsive para celulares y tablets */
@media (max-width: 991.98px) {
    .btn-filter {
        padding: 4px 10px !important;
        font-size: 0.85rem !important;
    }
}

/* MOSTRAR Y ADAPTAR TOP-BAR EN MÓVILES */
@media (max-width: 991.98px) {
    /* Forzar visibilidad de la barra superior */
    .top-bar {
        display: flex !important;
        height: auto !important;
        padding: 6px 0 !important;
    }

    /* Reducir tamaño de fuente e íconos para pantallas pequeñas */
    .top-bar small, 
    .top-bar a, 
    .top-bar i {
        font-size: 0.75rem !important;
    }

    /* Ajustar el espacio superior del cuerpo para compensar la barra visible */
    body {
        padding-top: 115px !important;
    }
}

/* CORRECCIÓN SAFARI / IOS Y BOTONES MÓVILES */

/* 1. Forzar visibilidad y estilo de la Top Bar */
.top-bar {
    background-color: var(--primary) !important;
    min-height: 40px;
}

/* 2. Reparar Botón Hamburguesa en Safari (iPhone) */
.navbar-toggler {
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
    padding: 6px 10px !important;
}

.navbar-toggler-icon {
    background-color: transparent !important;
    /* SVG con comillas simples para evitar fallo en Safari */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* 3. Dar estilo de "globo/píldora" a los botones de categorías en móvil */
.nav-pills .nav-link,
.btn-filter,
.portfolio-flters li {
    display: inline-block;
    padding: 8px 16px !important;
    margin: 4px !important;
    border-radius: 50px !important; /* Forma de globo/píldora */
    background-color: #f1f1f1 !important;
    color: var(--dark) !important;
    border: 1px solid #ddd !important;
    text-decoration: none;
}

.nav-pills .nav-link.active,
.btn-filter.active,
.portfolio-flters li.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/*******************************************
 * 11. ESTILOS DE LA VISTA COMERCIO (comercio.php)
 *******************************************/

/* Botones de redes sociales circulares en negro */
.btn-social-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #222222;
    color: #222222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-social-circle:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* Botón Volver a Comercios minimalista con hover azul/primario */
.btn-volver-custom {
    border: 1px solid #222222;
    color: #222222;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-volver-custom:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}