/* ================================================================
   EFGN Tienda — Store Styles v1.0.1
   ================================================================ */

/* ── Ocultar precios, badges y carrito ───────────────────────── */
.price, .woocommerce-Price-amount,
.woocommerce-Price-currencySymbol,
.onsale, .wc-block-components-product-price,
.wc-block-grid__product-price { display: none !important; }

/* Carrito en header (Astra) */
.ast-masthead-custom-menu-items.woocommerce-custom-menu-item,
.ast-site-header-cart,
.ast-header-woo-cart,
#ast-site-header-cart,
.site-header-cart { display: none !important; }

/* Carrito flotante esquina inferior derecha */
.mc-cart-button,
.mc-floating-cart,
.modern-cart-widget,
[class*="floating-cart"],
[class*="mini-cart"],
.widget_shopping_cart_content { display: none !important; }

/* ── Botón WhatsApp ──────────────────────────────────────── */
.efgn-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #16a34a;
    color: #fff !important;
    font-size: .82rem;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 9px;
    text-decoration: none !important;
    margin-top: 8px;
    transition: background .15s;
    font-family: system-ui, sans-serif;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}
.efgn-wa-btn:hover { background: #15803d; color: #fff !important; }
.efgn-wa-single {
    font-size: .95rem;
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 12px;
    margin-bottom: 4px;
}

/* ── Sección buscador encima del shop ────────────────────────── */
.efgn-shop-search-section {
    margin-bottom: 24px;
}
.efgn-shop-search-section .efgn-search-wrap {
    max-width: 560px;
}

/* ── Wrapper del buscador ─────────────────────────────────────── */
.efgn-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
}

.efgn-search-input {
    width: 100%;
    padding: 9px 40px 9px 14px;
    border: 1.5px solid #d1dae8;
    border-radius: 10px;
    font-size: .92rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    line-height: 1.4;
}
.efgn-search-input:focus {
    border-color: #0e9aa7;
    box-shadow: 0 0 0 3px rgba(14,154,167,.12);
}

.efgn-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    display: grid;
    place-items: center;
    padding: 0;
    transition: color .15s;
    line-height: 1;
}
.efgn-search-btn:hover { color: #0e9aa7; }

/* ── Dropdown resultados ──────────────────────────────────────── */
.efgn-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px -10px rgba(15,23,42,.18);
    z-index: 99999;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}
.efgn-search-dropdown.open {
    display: block;
    animation: efgnFadeIn .15s ease;
}
@keyframes efgnFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.efgn-sr-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 13px;
    text-decoration: none;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.efgn-sr-item:last-of-type { border-bottom: none; }
.efgn-sr-item:hover { background: #f0f9fa; }

.efgn-sr-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #f8fafc;
}

.efgn-sr-info { flex: 1; min-width: 0; }

.efgn-sr-title {
    font-size: .87rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
    line-height: 1.3;
}

.efgn-sr-meta {
    font-size: .74rem;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.efgn-sr-price {
    font-size: .87rem;
    font-weight: 700;
    color: #0e9aa7;
    white-space: nowrap;
    flex-shrink: 0;
}
.efgn-sr-price .woocommerce-Price-amount { color: #0e9aa7; }

.efgn-sr-all {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: .82rem;
    font-weight: 600;
    color: #0e9aa7;
    background: #f0f9fa;
    text-decoration: none;
    border-top: 1px solid #e2e8f0;
    transition: background .12s;
}
.efgn-sr-all:hover { background: #e0f4f6; color: #0e9aa7; }

.efgn-sr-empty,
.efgn-sr-loading {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: .87rem;
}

/* ── Meta en producto individual ─────────────────────────────── */
.efgn-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 18px;
    margin: 5px 0 13px;
    padding: 9px 13px;
    background: #f6f9fc;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
}
.efgn-meta-item  { font-size: .83rem; color: #475569; }
.efgn-meta-label { font-weight: 700; color: #0f172a; margin-right: 3px; }

/* ── SKU en listado ───────────────────────────────────────────── */
.efgn-loop-sku {
    display: block;
    font-size: .74rem;
    color: #94a3b8;
    margin-top: 2px;
    margin-bottom: 3px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .efgn-search-wrap { max-width: 100%; }
    .efgn-sr-price    { display: none; }
    .efgn-sr-img      { width: 40px; height: 40px; }
}

/* -- Tarjetas uniformes en listado */
ul.products li.product,
.wc-block-grid__product {
    display: flex !important;
    flex-direction: column !important;
}

/* Imagen fija 220px, centrada, sin deformarse */
ul.products li.product a img,
ul.products li.product img,
.wc-block-grid__product img {
    width: 100% !important;
    height: 220px !important;
    object-fit: contain !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* Titulo: exactamente 2 lineas, nunca mas */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
    font-size: .88rem !important;
    line-height: 1.4 !important;
    height: 2.8em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    margin: 8px 0 4px !important;
}

/* Boton WA siempre al fondo */
ul.products li.product .efgn-wa-btn {
    margin-top: auto !important;
}

/* -- Badge stock */
.efgn-stock {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
    margin-bottom: 3px;
}
.efgn-stock-in  { background: #dcfce7; color: #16a34a; }
.efgn-stock-out { background: #fee2e2; color: #dc2626; }

/* -- Barra de filtros */
.efgn-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: #f6f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.efgn-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}
.efgn-filter-label {
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.efgn-filter-select {
    padding: 8px 12px;
    border: 1.5px solid #d1dae8;
    border-radius: 8px;
    font-size: .88rem;
    color: #0f172a;
    background: #fff;
    cursor: pointer;
    outline: none;
}
.efgn-filter-select:focus { border-color: #0e9aa7; }
.efgn-filter-clear {
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
    align-self: flex-end;
}
.efgn-filter-clear:hover { border-color: #0e9aa7; color: #0e9aa7; }

/* -- Grid filtrado */
.efgn-filtered-grid { margin-top: 8px; }
.efgn-filtered-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.efgn-product-card {
    display: flex !important;
    flex-direction: column !important;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .18s;
    padding: 0 0 12px !important;
}
.efgn-product-card:hover { box-shadow: 0 8px 24px -8px rgba(15,23,42,.15); }
.efgn-card-img-wrap {
    display: block;
    background: #f8fafc;
    padding: 12px;
}
.efgn-card-img-wrap img {
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    display: block;
}
.efgn-card-body {
    flex: 1;
    padding: 8px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.efgn-card-title {
    font-size: .87rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.efgn-card-title:hover { color: #0e9aa7; }
.efgn-product-card .efgn-wa-btn { margin: 8px 12px 0; width: auto; }

.efgn-filter-loading,
.efgn-filter-empty {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-size: .9rem;
}
