*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
/* Estado inicial */
img[data-src] {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Estado cargado */
img.loaded {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Si el JS falla por alguna razón crítica, esto permite que se vean */
img:not([data-src]) {
    visibility: visible;
}
body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
}
.container-fluid {
    max-width: 1700px;
}

/* =================== */
/* Top Bar */
/* =================== */
.top-bar {
    background: #183e51;
    color: #fff;
    font-size: .9rem;
    padding: 10px 0;
    height: 50px;
}

.top-bar {
      align-items: center;
}

.top-bar .container-fluid {
      align-items: center;
}
.top-bar .container-fluid .row {
      align-items: center;
}

.top-bar p {
    margin-bottom: 0;
    font-size: .75rem;
}

.profile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 14px;
        padding: 2px 20px;
    color: black;
    background-color: white !important;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}


.profile-link i {
    font-size: 18px;
    margin-right: 5px;
    min-width: 16px;
}

.profile-link:hover {
    background-color: #0056b3;
}

.open-overlay-btn .profile-link {
    min-height: 31px;
}

.logout-btn {
    min-width: 16px;
}


.panel-overlay{
    visibility: hidden;
}

.user-panel-overlay {
    visibility: hidden;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
}

.logout-btn {
    color: #fff;
    font-size: 16px;
    margin-left: 10px;
    text-decoration: none;
}



/* ======================= */
/* Header */
/* ======================= */

.header-logo {
    height: 40px;
    max-width: 100%;
    object-fit: contain;
}

.product-card .card-img-top {  
    object-fit: cover;
    aspect-ratio: 0.733; /* Aproximado a 330/450 */
}

.header-icon {
    color: #333;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.header-icon:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* ======================= */
/* Search Area - General */
/* ======================= */
#header-login-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 150px;
    min-height: 31px;
    opacity: 0;
}

#header-login-area:not(:empty) {
    opacity: 1;
}

#search {
    width: 100%;
    display: block;
    padding: 0 30px;
    flex-grow: 1;
    opacity: 1;
}

.d-flex.align-items-center.w-100 {
    gap: 15px;
}

.navbar .container-fluid > .d-flex {
    min-height: 60px;
}

#navbar .d-md-flex.align-items-center {
    flex-shrink: 0;
    justify-content: flex-end;
}


@media (min-width: 768px) {
    #header-login-area {
        transition: opacity 0.15s ease-in-out;
    }

    #search {
        transition: width 0.25s ease-in-out, padding 0.25s ease-in-out, opacity 0.18s ease-in-out;
        opacity: 0;
        animation: fadeInSearch 0.35s ease-in-out 0.05s forwards;
    }

    @keyframes fadeInSearch {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    .d-flex.align-items-center.w-100 {
        transition: gap 0.18s ease-in-out;
    }

    .navbar .container-fluid > .d-flex {
        transition: all 0.18s ease-in-out;
    }

    #navbar .d-md-flex.align-items-center {
        transition: transform 0.25s ease-in-out, margin 0.25s ease-in-out;
    }

    .navbar {
        transition: all 0.18s ease-in-out;
    }

    #header-login-area > * {
        opacity: 1;
    }
}

#search .input-group {
    position: relative;
}

#search .search-input {
    border-radius: 4px !important;
}

#search .btn-template-lupa {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: transparent;
    border: none;
    color: #6c757d;
    z-index: 4;
}

#search .btn-template-lupa:hover {
    color: #495057;
}

#search .input-group-append {
    position: static;
}

#search .input-group {
    position: relative;
}

/* Botón de búsqueda personalizado */
.btn-template-lupa {
    color: #000000 !important;
    background: none !important;
    z-index: 99;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 0;
    text-decoration: none;
}

/* ======================= */
/* Responsive - Search & Header */
/* ======================= */
@media (max-width: 767px) {
        #search {
        width: 90%;
    }
    
    .margen__buscador {
        /* margin-top: 6.6rem !important; */
    }

    .margen__buscador-banner {
        /* margin-top: 6.6rem !important; */
    }

    .margen__buscador-breadcrumb {
        /* margin-top: 3rem !important; */
    }

    header {
        /* position: fixed; */
        top: 0;
        width: 100%;
        z-index: 1000;
        background: #fff;
    }
}

@media only screen and (max-width: 768px) {
    #search {
        width: 85%;
    }

    .input-group {
        width: 125% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 10px;
    }

    .search {
        border: 2px solid #ced4da;
        border-radius: 10px;
    }

    .form-control.search-input.search {
        border-radius: 10px;
    }

    .search-input + .input-group-btnb .btnb {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 50px;
        padding: 0;
    }

    .container {
        width: 100%;
    }
}

/* =================== */
/* Navbar & Menu */
/* =================== */
#navbar {
    background: #ffc10736;
}

.navbar-nav {
    padding: 0 !important;
    margin: 0 !important;
    text-align: center;
}

.navbar-light .navbar-nav .nav-link {
    color: black;
}

.owl-productos {
    visibility: hidden;
}

.visibleUl {
    visibility: hidden !important; 
    
}

a.nav-link {
    display: inline-block;
    padding: 10px 1.5em 10px 10px;
    border-radius: 0 !important;
    font-size: .9rem;
    color: inherit;
    text-decoration: none;
     color: #001d3e;
    font-weight: 500;
    -webkit-transition: 0.2s color;
    transition: 0.2s color;
}

.link-header {
    text-decoration: none;
    color: #001d3e;
}

.link-header:focus, .link-header:hover {
    color: #2f5a89;
    text-decoration: underline;
    text-decoration: none;
}


@media (max-width: 767px) {
    .container-fluid *:not(.owl-carousel *):not(.productLoader):not(.owl-thumb-item *):not([class*="EstrellasMedia"] *):not(#filtros-container *):not(.colores-container *):not(#pills-tabContent *) {
        padding-right: 1px !important;
        padding-left: 1px !important;
        margin-right: 0px !important;
        margin-left: 0px !important;
    }
}

.breadcrumb{
    padding: 0.5rem 0.5rem 0.10rem 0.75rem;
    font-size: 0.9rem;
    min-height:49px;
    visibility:hidden;
}

.lazy-img{
    visibility:hidden;
}

.container-header{

    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.nav-item i {
    font-size: 14px;
    width: 16px;
    display: inline-block;
    text-align: center;
}

    @media (min-width: 992px) {
    .container-fluid-lg {
        max-width: 100%;
        width: 100%;
    }
}

.producto-texto {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: 1.2;
  height: 3.6rem; 
  font-size: 1rem;
  transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              line-height 0.3s ease;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  margin-bottom: .1rem;
}

.producto-texto.texto-largo {
  font-size: 0.82rem;
  line-height: 1.4; 
}

.resenas-overlay {
    position: absolute;
    bottom: 15px;
    left: 8px;
    z-index: 10;
    display: inline-flex;
    flex-direction: column-reverse;
    gap: 0px;
    line-height: 0;
    background-color: rgb(255 255 255 / 85%);
    padding: 5px 4px;
    border: 1px solid #66666614;
    border-radius: 6px;
    width: fit-content;
    max-width: 28px;
}

.resenas-overlay .estrellas-container {
    opacity: 1 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: auto;
    max-width: 20px;
}

.resenas-overlay .EstrellasMedia {
    display: flex;
    flex-direction: column;
    gap: 0px;
    line-height: 0;
    margin: 0;
    padding: 0;
    width: 20px; 
}

.resenas-overlay .EstrellasMedia img {
    height: 16px;
    width: 16px;
    display: block;
    margin: 0 auto;
    padding: 0;
    vertical-align: top;
}

.resenas-overlay .small {
    display: block !important;
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    margin-top: 2px;
    color: #333;
    white-space: nowrap; 
    width: 100%;
}
.card-body-padding {
    padding-left: 5px;
    padding-right: 5px;
}

.content-center {
    text-align: center;
}

.precio-container {
    line-height: 1.2;
}

.precio-desde-text {
    font-size: 12px;
    margin-bottom: 2px;
    color: #666;
}

.precio-euro-size {
    font-size: 22px !important;
}

.precio-iva-text {
    font-size: 12px;
    color: #666;
}

/* FLOTANTES - Estilos base con visibility:hidden hasta que cargue flotantes.css */
#scrollBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #333;
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 9999;
  transition: opacity 0.3s ease-in-out;
  visibility: hidden;
}

#whatsapp-container {
  position: fixed;
  bottom: 20px;
  right: 69px;
  z-index: 999;
  display: flex;
  align-items: center;
  visibility: hidden;
}

#whatsapp-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #25d366;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#whatsapp-button i {
  color: #fff;
}

@media only screen and (max-width: 768px) {
  #whatsapp-container {
    bottom: 60px;
    right: 25px;
  }
}

#google-reviews-float {
    position: fixed;
    right: 33px;
    bottom: 80px;
    z-index: 999;
    background: white;
    border: 1px solid #aaaaaa;
    border-radius: 12px;
    padding: 12px 10px;
    width: 65px;
    text-align: center;
    visibility: hidden;
}

#google-reviews-float a {
    text-decoration: none;
    color: inherit;
    display: block;
}

#google-reviews-float .google-icon {
    margin-bottom: 6px;
}

#google-reviews-float .google-icon img {
    width: 28px;
    height: 28px;
}

#google-reviews-float .rating-number {
    font-size: 20px;
    font-weight: bold;
    color: #202124;
    margin-bottom: 2px;
    line-height: 1;
}

#google-reviews-float .stars {
    color: #fbbc04;
    font-size: 10px;
    margin-bottom: 6px;
    letter-spacing: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1px;
    height: 10px;
    line-height: 10px;
}

#google-reviews-float .reviews-count {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    line-height: 1.1;
}

#google-reviews-float .reviews-count span {
    font-size: 9px;
    font-weight: normal;
    color: #80868b;
}
@media (max-width: 767px) {
    #google-reviews-float {
        width: 50px;
        padding: 10px;
        bottom: 110px;
        right: 20px;
    }
    
    #google-reviews-float .google-icon {
        margin-bottom: 4px;
    }
    
    #google-reviews-float .google-icon img {
        width: 30px;
        height: 30px;
    }
    
    #google-reviews-float .stars {
        margin-bottom: 0;
        font-size: 9px;
        gap: 0px;
    }
    
    #google-reviews-float .rating-number,
    #google-reviews-float .reviews-count {
        display: none;
    }
}
.image-container {
    position: relative;
    height: 270px;
    overflow: hidden;
}
.image-container img,
.image-container .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
#nav-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 0 40px;
    min-height: 46px;
    box-sizing: border-box;
}
#nav-cats-col {
    flex-shrink: 0;
    width: 180px;
    display: flex;
    align-items: center;
}
#desktop-nav-wrapper {
    background: #fff;
}
#buscador-header,
#nav-inner {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
}
#megaMenuTrigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: #183e51;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    height: 34px;
}
.mega-chevron {
    font-size: .6rem;
    opacity: .75;
    transition: transform .2s ease;
}
#megaMenuTrigger:hover {
    background: #0f2b38;
}
#megaMenuTrigger[aria-expanded="true"] .mega-chevron {
    transform: rotate(180deg);
}

#megaMenuTrigger .mega-chevron {
    display: inline-block;
    width: .6rem;
    font-size: .6rem;
    flex-shrink: 0;
}
.bh-icons .fa-rss,
.btn-template-lupa .fa-search {
    display: inline-block;
    width: 1rem;
    font-size: 1rem;
    flex-shrink: 0;
}
.bh-icons .fa-cart-shopping {
    display: inline-block;
    width: 1.3rem;
    font-size: 1.3rem;
    flex-shrink: 0;
}
#megaMenuTrigger .fa-bars {
    display: inline-block;
    width: 1rem;
    font-size: 1rem;
    flex-shrink: 0;
}
.owl-productos,
.owl-mas-categorias-home,
.owl-mas-categorias {
    /* visibility: hidden; */
}
.owl-mas-categorias .owl-stage {
    display: flex !important;
    flex-direction: row !important;
}
.owl-mas-categorias .owl-item {
    display: block !important;
    flex-shrink: 0;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    /* Evita el salto horizontal si aparece el scroll */
    overflow-x: hidden; 
}

.container-fluid {
    max-width: 1700px;
}

/* =================== */
/* Top Bar - Altura Fija */
/* =================== */
.top-bar {
    background: #183e51;
    color: #fff;
    font-size: .9rem;
    padding: 10px 0;
    height: 50px; /* Mantenemos altura fija para evitar saltos */
    display: flex;
    align-items: center;
}

/* Evitar colapso de login area */
#header-login-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 150px;
    min-height: 31px;
    /* En lugar de opacity 0, usamos un esqueleto o mantenemos el espacio */
    background: rgba(255,255,255,0.05); 
    border-radius: 5px;
}

/* ======================= */
/* Search & Nav - Estabilidad */
/* ======================= */
#nav-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 0 40px;
    min-height: 46px; /* Reserva espacio para la navegación */
    box-sizing: border-box;
}

/* IMPORTANTE: Quitamos visibility:hidden de elementos estructurales */
.breadcrumb {
    padding: 0.5rem 0.5rem 0.10rem 0.75rem;
    font-size: 0.9rem;
    min-height: 49px;
    display: flex; /* Cambiado de visibility:hidden */
    align-items: center;
}

/* Reserva de espacio para imágenes Lazy */
.lazy-img {
    background-color: #f0f0f0; /* Color de fondo mientras carga */
    min-height: 80px;
    display: block;
}

/* ======================= */
/* Productos - Estabilidad de Card */
/* ======================= */
.image-container {
    position: relative;
    height: 270px;
    overflow: hidden;
    background-color: #f8f8f8; /* Placeholder */
}

.producto-texto {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    height: 3.6rem; /* Altura fija para que el texto no empuje el precio */
    line-height: 1.2;
}

/* ── Buscador header unificado ── */
#buscador-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 40px;
    gap: 16px;
    box-sizing: border-box;
}
#buscador-header .bh-logo   { flex-shrink: 0; }
#buscador-header .bh-search { flex: 1; min-width: 0; }
#buscador-header .bh-icons  { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }

#buscador-header-mobile-row {
    display: none;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    box-sizing: border-box;
}
#buscador-header-mobile-row .bh-m-menu  { flex-shrink: 0; }
#buscador-header-mobile-row .bh-m-logo  { flex: 1; text-align: center; }
#buscador-header-mobile-row .bh-m-icons { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 8px; }

#buscador-search-mobile { display: none;}

@media (max-width: 767px) {
    #buscador-header            { display: none !important; }
    #buscador-header-mobile-row { display: flex !important; }
    #buscador-search-mobile     { display: block !important; }
}

.mega-panel-overlay {
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
    height: 0 !important;
    overflow: hidden !important;
}
.mega-panel-overlay.open {
    height: 100% !important;
    overflow: visible !important;
}
.mega-overlay-bg {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}
.mega-overlay-bg.open {
    display: block !important;
    height: 100% !important;
    overflow: visible !important;
}
#desktop-nav-wrapper {
    visibility: hidden;
    opacity: 0;
    /* min-height: 46px; */
    max-height: 46px;
    overflow: hidden;
    background: #fff;
}
#nav-inner {
    visibility: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 0 40px;
    min-height: 46px;
    max-height: 46px;
    box-sizing: border-box;
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
}
#nav-cats-col {
    flex-shrink: 0;
    width: 180px;
    display: flex;
    align-items: center;
}
#nav-destacados {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: hidden;
    padding-left: 16px;
    justify-content: center;
    align-items: center;
}
#nav-destacados .nav-item {
    white-space: nowrap;
}
#megaMenuTrigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: #183e51;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    height: 34px;
}
.mega-chevron {
    font-size: .6rem;
    opacity: .75;
    transition: transform .2s ease;
}