#mg-buscador-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
}

#mg-buscador-barra {
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    background: white;
    height: 48px;
}




#mg-buscador-input {
    flex: 1;
    padding: 0 20px;
    border: none;
    outline: none;
    font-size: 16px;
    height: 100%; /* toma el 100% del alto del contenedor */
    background: #f5f5f5;
}



#mg-clear-input {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    color: #999;
    z-index: 2;
    padding: 0 8px;
    background: white;
    border-radius: 50%;
    line-height: 1;
}

#mg-clear-input:hover {
    color: #c60045;
}

#mg-buscador-boton {
    background: #E0B734 !important;
    border: none;
    color: white;
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;

    /* 👇 Solo redondear las esquinas derechas */
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}


#mg-buscador-boton .dashicons {
    color: white;
    font-size: 20px;
}


#mg-buscador-contenedor {
    position: fixed;
    top: 121px;
    left: 0;
    right: 0;
    width: 100vw;
    height: calc(100vh - 121px);
    margin: 0 !important;
    padding: 40px 55px;
    box-sizing: border-box;
    background: white;
   box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;

    opacity: 0;
    transform: translateY(160px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;

    overflow-y: auto;
}

#mg-buscador-contenedor.mostrar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#mg-buscador-header {
    position: relative;
    width: 100%;
    text-align: center;
}

#mg-buscador-header h2 {
    font-size: 24px;
    margin: 0;
    color: #c60045;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.mg-close {
    font-size: 36px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
}

.mg-placeholder {
    text-align: center;
    font-size: 16px;
    margin: 30px 0 0 0;
    padding-top: 20px;
    max-width: 700px;
    width: 100%;
}

.mg-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    max-width: 100%;
    width: 100%;
    padding: 12px;
}

.mg-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: none;
    padding: 0;
    background: none;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.mg-item h4 {
    font-size: 16px !important;
    font-weight: 400;
    color: #222 !important;
    margin: 8px 0 4px;
    text-align: center;
    line-height: 1.4;
    min-height: 4em !important;
}

.mg-item p {
    font-size: 14px;
    text-align: left;
    margin: 0;
    color: #000;
    font-weight: 500;
}

.mg-item del {
    color: #888;
    margin-right: 5px;
     font-weight: 400 !important;
}

.mg-item ins {
    color: #b40f28 !important;
    text-decoration: none;
    font-weight: 700 !important;
}

.mg-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease-in-out; /* mismo efecto que el otro grid */
}

.mg-item img:hover {
    transform: scale(1.1);
    z-index: 10;
}

.mg-ver-todos {
    margin-top: 30px;
    text-align: center;
}

.mg-ver-todos a {
    background: none;
    color: black;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

@media screen and (max-width: 1200px) {
    .mg-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (max-width: 900px) {
    .mg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .mg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scroll lock */
body.mg-no-scroll {
    overflow: hidden;
}

/* Precio */
.mg-precios {
    display: flex;
    flex-direction: column;
    justify-content: left !important;
    gap: 5px;
    align-items: center;
    
}

.mg-precios:not(:has(del)) .amount {
    font-weight: 700 !important;
    color: #b40f28 !important;
}

/* --------------------- */
/* 🔍 Lupa flotante móvil */
#mg-lupa-movil {
    display: none;
}

@media (max-width: 768px) {
    #mg-buscador-wrapper {
        display: none;
    }

    #mg-lupa-movil {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 10000;
    }

    #mg-lupa-movil button {
        background: white;
        border: 2px solid black;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    #mg-lupa-movil button .dashicons {
        font-size: 22px;
        color: black;
    }

    /* Para resultados en una sola columna o 2 en mobile */
    .mg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #mg-buscador-contenedor {
        top: 60px !important;
        padding: 20px !important;
    }
}

.mg-precios del,
.mg-precios ins,
.mg-precios .amount {
  display: block;
  width: 100%;
  text-align: center; /* centra cada línea */
  line-height: 1.2;
}

.mg-precios ins {
  order: 2;
  font-weight: 700 !important;
  color: #b40f28 !important;
}

.mg-precios del {
  order: 1;
  color: #888;
}

/* ===================================================== */
/* A PARTIR DE ACÁ: SOLO AÑADIDOS PARA APILAR PRECIOS    */
/* (no se borró ni modificó ninguna regla anterior)      */
/* ===================================================== */

/* WooCommerce envuelve los importes en .price.
   Apilo dentro de .price para que del/ins queden uno debajo del otro. */
.mg-precios .price {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  gap: 2px;
}

/* Aseguro bloque y centrado dentro de .price (por si hay reglas del theme) */
.mg-precios .price del,
.mg-precios .price ins,
.mg-precios .price .amount {
  display: block !important;
  text-align: center !important;
  line-height: 1.2 !important;
  width: 100%;
}

/* Orden: oferta (ins) arriba, normal (del) abajo */
.mg-precios .price ins {
  order: 2;
  font-weight: 700 !important;
  color: #b40f28 !important;
}

.mg-precios .price del {
  order: 1;
  color: #888 !important;
}


/* SOLO cuando hay barra de admin (usuario logueado) */
body.admin-bar #mg-buscador-contenedor{
  /* 121 = alto de tu header; 32 = alto admin bar desktop */
  top: calc(121px + 32px) !important;
  height: calc(100vh - (121px + 32px)) !important;
}

/* En mobile WP usa 46px de barra (breakpoint oficial 782px) */
@media (max-width: 782px){
  body.admin-bar #mg-buscador-contenedor{
    /* 60 = top que ya usás en mobile; 46 = admin bar mobile */
    top: calc(60px + 46px) !important;
    height: calc(100vh - (60px + 46px)) !important;
  }
}
