/* v3.0 Ferretería */
.ec-hardware-card{transition:transform .18s ease,box-shadow .18s ease}.ec-hardware-card:hover{transform:translateY(-3px);box-shadow:0 .6rem 1.4rem rgba(15,23,42,.12)!important}.ec-hardware-card h3{line-height:1.35}.ec-nav-custom .dropdown-menu{min-width:260px}.ec-tech-specs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}.ec-tech-spec{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:.75rem}.ec-tech-spec small{display:block;color:#64748b}.ec-tech-spec strong{display:block;color:#111827}@media(max-width:575px){.ec-tech-specs{grid-template-columns:1fr}}
.ec-nav-link{display:inline-flex;align-items:center;padding:.55rem .75rem;border-radius:9px;color:inherit;text-decoration:none;font-weight:600;white-space:nowrap}.ec-nav-link:hover{background:rgba(15,118,110,.08);color:var(--ec-primary,#0f766e)}.ec-category-nav .ec-nav-custom{scrollbar-width:thin}.ec-category-nav .dropdown-menu{max-height:70vh;overflow:auto}
/* v3.1 · carrito lateral */
.ec-sidecart{position:fixed;z-index:1065;right:0;top:0;width:min(430px,92vw);height:100vh;background:#fff;box-shadow:-12px 0 40px rgba(15,23,42,.18);transform:translateX(105%);transition:transform .2s ease;display:flex;flex-direction:column}.ec-sidecart.is-open{transform:translateX(0)}.ec-sidecart-backdrop{position:fixed;z-index:1060;inset:0;background:rgba(15,23,42,.42);opacity:0;transition:opacity .18s}.ec-sidecart-backdrop.is-open{opacity:1}.ec-sidecart-head,.ec-sidecart-footer{padding:18px;border-bottom:1px solid #e5e7eb}.ec-sidecart-footer{border-top:1px solid #e5e7eb;border-bottom:0;margin-top:auto}.ec-sidecart-items{overflow:auto;padding:8px 18px}.ec-sidecart-item{display:grid;grid-template-columns:64px 1fr auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #eef2f7;color:inherit;text-decoration:none}.ec-sidecart-item img{width:64px;height:64px;object-fit:cover;border-radius:10px;border:1px solid #e5e7eb}.ec-sidecart-item span{min-width:0}.ec-sidecart-item strong,.ec-sidecart-item small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ec-sidecart-lock{overflow:hidden}

/* v3.1.1 - navegación jerárquica de ferretería */
.ec-category-nav{align-items:flex-start;flex-wrap:wrap;overflow:visible!important}
.ec-nav-custom{display:flex;align-items:center;gap:.35rem .5rem;flex-wrap:wrap;overflow:visible!important;min-width:0}
.ec-nav-custom .ec-nav-dropdown{position:relative}
.ec-nav-custom .ec-all-cats,.ec-nav-custom .ec-nav-link{display:inline-flex;align-items:center;min-height:40px;padding:.55rem .72rem;border-radius:9px;color:var(--ec-ink,#0f172a);text-decoration:none;font-weight:650;white-space:nowrap}
.ec-nav-custom .ec-all-cats:hover,.ec-nav-custom .ec-nav-link:hover,.ec-nav-custom .ec-nav-dropdown.show>.ec-all-cats{background:rgba(15,118,110,.08);color:var(--ec-primary,#0f766e)}
.ec-nav-custom .dropdown-menu{min-width:280px;max-width:min(92vw,380px);max-height:70vh;overflow:auto;border-radius:12px;margin-top:.25rem!important;padding:.45rem;z-index:1060}
.ec-nav-custom .dropdown-item{white-space:normal;border-radius:8px;padding:.62rem .75rem}
.ec-nav-custom .dropdown-item:hover{background:rgba(15,118,110,.08);color:var(--ec-primary,#0f766e)}
@media(min-width:992px){
 .ec-nav-custom .ec-nav-dropdown:hover>.dropdown-menu{display:block}
 .ec-nav-custom .ec-nav-dropdown:hover>.dropdown-toggle::after{transform:rotate(180deg)}
}
@media(max-width:991.98px){
 .ec-category-nav{gap:.65rem}
 .ec-nav-custom{width:100%;flex-basis:100%;display:grid;grid-template-columns:1fr;gap:.25rem}
 .ec-nav-custom .ec-nav-link,.ec-nav-custom .ec-all-cats{width:100%;justify-content:space-between;border:1px solid var(--ec-border,#e5e7eb);background:#fff}
 .ec-nav-custom .dropdown-menu{position:static!important;transform:none!important;width:100%;max-width:none;box-shadow:none!important;border:1px solid var(--ec-border,#e5e7eb);margin-top:.25rem!important}
 .ec-whatsapp-link{margin-left:0!important}
}
/* R6.5: menú principal compacto y jerárquico */
@media(min-width:992px){
 .ec-category-nav{flex-wrap:nowrap!important;align-items:center!important}
 .ec-nav-custom{display:flex!important;flex-wrap:nowrap!important;gap:.15rem!important;overflow:visible!important}
 .ec-nav-custom>.ec-nav-link,.ec-nav-custom>.ec-nav-dropdown>.ec-all-cats{padding:.55rem .62rem!important;font-size:.9rem}
 .ec-nav-custom .ec-compact-menu{width:min(92vw,720px);max-width:720px;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:.15rem .75rem;padding:.75rem}
 .ec-nav-custom .ec-nav-dropdown:hover>.ec-compact-menu,.ec-nav-custom .ec-nav-dropdown.show>.ec-compact-menu{display:grid}
 .ec-compact-menu>li:first-child,.ec-compact-menu>.dropdown-divider{grid-column:1/-1}
 .ec-menu-group{list-style:none;min-width:0}
 .ec-menu-subitems{display:flex;flex-direction:column;padding:0 .75rem .45rem 1rem;gap:.25rem}
 .ec-menu-subitems a{font-size:.82rem;color:var(--ec-muted,#64748b);white-space:normal}
 .ec-menu-subitems a:hover{color:var(--ec-primary,#0f766e)}
}

/* R6.6 · menú compacto + catálogo visual estilo ferretería */
.ec-category-nav{display:flex;align-items:center;gap:.75rem;border-top:1px solid var(--ec-border,#e5e7eb);padding-top:.75rem;overflow:visible!important}
.ec-nav-custom{display:flex;align-items:center;gap:.2rem;flex-wrap:nowrap;overflow:visible!important;min-width:0}
.ec-nav-custom>.ec-nav-link,.ec-nav-custom>.ec-nav-dropdown>.ec-nav-link{font-size:.91rem;font-weight:750;padding:.58rem .68rem;border-radius:7px;color:var(--ec-ink,#0f172a);text-decoration:none;white-space:nowrap;background:transparent;border:0}
.ec-nav-custom>.ec-nav-link:hover,.ec-nav-custom>.ec-nav-dropdown>.ec-nav-link:hover,.ec-nav-custom>.ec-nav-dropdown.show>.ec-nav-link{color:var(--ec-primary,#0f766e);background:rgba(15,118,110,.07)}
.ec-nav-dropdown{position:relative}
.ec-products-dropdown{width:290px;min-width:290px!important;max-width:calc(100vw - 32px)!important;padding:.45rem!important;border-radius:8px!important;overflow:visible!important;max-height:none!important;margin-top:.15rem!important}
.ec-menu-category{position:relative;list-style:none}
.ec-menu-category-row{display:flex;align-items:stretch;gap:0}
.ec-menu-category-row>.dropdown-item{flex:1;padding:.68rem .75rem!important;border-radius:6px!important;font-weight:600;color:#334155;white-space:normal}
.ec-menu-category-row>.dropdown-item:hover{background:#f1f5f9;color:var(--ec-primary,#0f766e)}
.ec-submenu-toggle{width:36px;border:0;background:transparent;color:#94a3b8;border-radius:6px;display:flex;align-items:center;justify-content:center}
.ec-submenu-toggle:hover{background:#f1f5f9;color:var(--ec-primary,#0f766e)}
.ec-submenu{display:none;position:absolute;left:calc(100% + 4px);top:-5px;width:280px;max-width:calc(100vw - 32px);padding:.45rem;margin:0;background:#fff;border:1px solid #e5e7eb;border-radius:8px;list-style:none;z-index:1080}
.ec-submenu li a{display:block;padding:.62rem .72rem;border-radius:6px;color:#475569;text-decoration:none;white-space:normal}
.ec-submenu li a:hover{background:#f1f5f9;color:var(--ec-primary,#0f766e)}
@media(min-width:992px){
 .ec-nav-dropdown:hover>.ec-products-dropdown{display:block}
 .ec-menu-category.has-submenu:hover>.ec-submenu{display:block}
 .ec-menu-category.has-submenu:hover .ec-submenu-toggle i{transform:translateX(2px)}
}
@media(max-width:1199.98px) and (min-width:992px){
 .ec-nav-custom>.ec-nav-link,.ec-nav-custom>.ec-nav-dropdown>.ec-nav-link{font-size:.83rem;padding:.55rem .48rem}
 .ec-admin-toggle{font-size:.86rem;padding:.5rem .65rem}
 .ec-whatsapp-link{font-size:.86rem}
}
@media(max-width:991.98px){
 .ec-category-nav{align-items:stretch;flex-wrap:wrap}
 .ec-nav-custom{width:100%;flex-basis:100%;display:grid;grid-template-columns:1fr;gap:.25rem}
 .ec-nav-custom>.ec-nav-link,.ec-nav-custom>.ec-nav-dropdown>.ec-nav-link{width:100%;justify-content:space-between;border:1px solid var(--ec-border,#e5e7eb);background:#fff}
 .ec-products-dropdown{position:static!important;transform:none!important;width:100%!important;min-width:0!important;max-width:none!important;box-shadow:none!important;border:1px solid var(--ec-border,#e5e7eb)!important;margin-top:.25rem!important}
 .ec-submenu{position:static;width:auto;max-width:none;box-shadow:none!important;border:0;border-left:2px solid #e2e8f0;margin:.1rem .5rem .45rem 1rem;padding:.15rem 0 .15rem .5rem}
 .ec-menu-category.submenu-open>.ec-submenu{display:block}
 .ec-menu-category.submenu-open .ec-submenu-toggle i{transform:rotate(90deg)}
 .ec-whatsapp-link{margin-left:0!important}
}

.ec-catalog-landing{background:#fff;min-height:60vh}
.ec-catalog-landing h1{font-size:clamp(1.8rem,3vw,2.4rem);font-weight:850;color:var(--ec-primary,#0f4c81);letter-spacing:.01em}
.ec-section-title{font-size:clamp(1.35rem,2.3vw,1.9rem);font-weight:850;color:var(--ec-primary,#0f4c81)}
.ec-category-card-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2rem 2.5rem}
.ec-category-card{min-width:0}
.ec-category-card-link{display:block;color:inherit;text-decoration:none}
.ec-category-card-media{display:block;aspect-ratio:1/1;overflow:hidden;background:#fff;border:1px solid #eef2f7}
.ec-category-card-media img{width:100%;height:100%;object-fit:contain;display:block;transition:transform .2s ease}
.ec-category-card-link:hover .ec-category-card-media img{transform:scale(1.035)}
.ec-category-card-name{display:block;margin-top:.85rem;font-weight:800;color:var(--ec-primary,#0f4c81);line-height:1.3}
.ec-category-card-count{display:block;margin-top:.18rem;font-size:.85rem;font-style:italic;font-weight:700;color:#111827}
@media(max-width:1199.98px){.ec-category-card-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:1.5rem}}
@media(max-width:991.98px){.ec-category-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767.98px){.ec-category-card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:1.1rem}}
@media(max-width:420px){.ec-category-card-grid{grid-template-columns:1fr 1fr;gap:.85rem}.ec-category-card-name{font-size:.9rem}}

.ec-catalog-shell{max-width:1380px}
.ec-catalog-sidebar{position:sticky;top:145px}
.ec-catalog-sidebar h2{margin:0 0 1rem;padding:.85rem 1.25rem;border-radius:10px;background:var(--ec-primary,#0f4c81);color:#fff;font-size:1.35rem;font-weight:800}
.ec-sidebar-categories,.ec-sidebar-subcategories{list-style:none;padding:0;margin:0}
.ec-sidebar-categories>li>a{display:flex;align-items:center;gap:.55rem;padding:.57rem .15rem;color:#94a3b8;text-decoration:none;border-bottom:1px solid transparent}
.ec-sidebar-categories>li>a i{font-size:.7rem;color:var(--ec-primary,#0f4c81)}
.ec-sidebar-categories>li>a span{flex:1;min-width:0}
.ec-sidebar-categories>li>a small,.ec-sidebar-subcategories a small{margin-left:auto;color:#94a3b8}
.ec-sidebar-categories>li.active>a,.ec-sidebar-categories>li>a:hover{color:var(--ec-primary,#0f4c81);font-weight:750}
.ec-sidebar-subcategories{margin:.15rem 0 .5rem 1.2rem;border-left:2px solid #e2e8f0;padding-left:.7rem}
.ec-sidebar-subcategories a{display:flex;gap:.4rem;padding:.38rem .15rem;color:#64748b;text-decoration:none;font-size:.9rem}
.ec-sidebar-subcategories li.active a,.ec-sidebar-subcategories a:hover{color:var(--ec-primary,#0f4c81);font-weight:700}
.ec-catalog-title-row h1{font-size:clamp(2rem,3.5vw,2.65rem);font-weight:850;color:#172033;margin:0}
.ec-catalog-title-row p{margin:.5rem 0 0;color:#64748b;max-width:800px}
.ec-catalog-toolbar{display:flex;align-items:center;gap:.75rem;padding:1.1rem 0 1.35rem;color:#94a3b8}
.ec-view-switch{display:flex;gap:.25rem}
.ec-view-switch .btn{padding:.2rem .35rem;border:0;background:transparent;color:#cbd5e1;font-size:1.25rem}
.ec-view-switch .btn.active,.ec-view-switch .btn:hover{color:var(--ec-primary,#0f4c81)}
.ec-result-count{font-size:.95rem}
.ec-modern-product-grid{margin-bottom:1rem}
.ec-product-card{display:flex;flex-direction:column;background:#fff;border:1px solid #e5e7eb;transition:box-shadow .18s ease,transform .18s ease}
.ec-product-card:hover{box-shadow:0 10px 24px rgba(15,23,42,.08);transform:translateY(-2px)}
.ec-product-card-image{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;background:#fff;overflow:hidden;border-bottom:1px solid #e5e7eb}
.ec-product-card-image img{width:100%;height:100%;object-fit:contain;padding:.6rem;transition:transform .2s ease}
.ec-product-card:hover .ec-product-card-image img{transform:scale(1.03)}
.ec-product-card-body{display:flex;flex:1;flex-direction:column;padding:.72rem .72rem .65rem}
.ec-product-card-title{display:block;color:#111827;text-decoration:none;text-align:center;font-size:.91rem;line-height:1.35;min-height:2.5em}
.ec-product-card-title:hover{color:var(--ec-primary,#0f4c81)}
.ec-product-card-brand{display:block;text-align:center;color:#64748b;text-decoration:none;font-size:.78rem;margin-top:.25rem}
.ec-product-card-badges{display:flex;flex-wrap:wrap;gap:.25rem;margin:.5rem 0}
.ec-product-card-footer{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-top:auto;padding-top:.35rem}
.ec-product-price{font-size:.82rem;font-weight:750;color:#334155}.ec-product-price del{font-weight:400;color:#94a3b8;margin-right:.2rem}
.ec-list-product{display:grid;grid-template-columns:150px 1fr;gap:1.2rem;padding:1rem 0;border-bottom:1px solid #e5e7eb}
.ec-list-product-image{display:flex;aspect-ratio:1/1;border:1px solid #e5e7eb;align-items:center;justify-content:center;background:#fff}.ec-list-product-image img{width:100%;height:100%;object-fit:contain;padding:.6rem}
.ec-list-product-content h3{font-size:1.1rem;color:#172033}.ec-list-product-content a{text-decoration:none}.ec-list-product-content p{color:#64748b;font-size:.9rem}
@media(max-width:1199.98px){.ec-modern-product-grid.row-cols-xl-5>*{width:25%}}
@media(max-width:991.98px){.ec-catalog-sidebar{position:static}.ec-catalog-sidebar-col{order:0}.ec-catalog-sidebar h2{cursor:default}.ec-modern-product-grid.row-cols-xl-5>*{width:33.333333%}}
@media(max-width:767.98px){.ec-modern-product-grid.row-cols-xl-5>*{width:50%}.ec-list-product{grid-template-columns:110px 1fr}.ec-catalog-title-row h1{font-size:1.9rem}}
@media(max-width:420px){.ec-product-card-body{padding:.6rem .45rem}.ec-product-card-title{font-size:.84rem}.ec-product-card-footer{align-items:flex-end}.ec-product-price{font-size:.75rem}}
@media(min-width:992px){.ec-nav-custom>.ec-nav-link,.ec-nav-custom>.ec-nav-dropdown>.ec-nav-link{text-transform:uppercase;letter-spacing:.01em}}

/* DIAFRP-MOBILE-MENU-START */
/*
 * Navegación adaptable DIAFRP.
 * Escritorio: siempre visible.
 * Celular/tableta: cerrada inicialmente y controlada por botón.
 */

.ec-mobile-menu-toggle {
    display: none;
}

.ec-mobile-menu-panel {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 992px) {
    .ec-mobile-menu-panel {
        display: flex !important;
    }
}

@media (max-width: 991.98px) {

    .ec-category-nav {
        display: block !important;
        width: 100%;
        padding-top: .75rem;
    }

    .ec-mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: .72rem 1rem;
        border: 1px solid var(--ec-border, #e5e7eb);
        border-radius: 10px;
        background: #ffffff;
        color: var(--ec-ink, #0f172a);
        font: inherit;
        font-weight: 750;
        text-align: left;
        cursor: pointer;
        transition:
            border-color .18s ease,
            background-color .18s ease,
            color .18s ease;
    }

    .ec-mobile-menu-toggle:hover,
    .ec-mobile-menu-toggle:focus-visible,
    .ec-mobile-menu-toggle.is-open {
        border-color: var(--ec-primary, #0f766e);
        background: rgba(15, 118, 110, .06);
        color: var(--ec-primary, #0f766e);
        outline: none;
    }

    .ec-mobile-menu-toggle > span {
        display: inline-flex;
        align-items: center;
        gap: .55rem;
    }

    .ec-mobile-menu-chevron {
        transition: transform .18s ease;
    }

    .ec-mobile-menu-toggle.is-open .ec-mobile-menu-chevron {
        transform: rotate(180deg);
    }

    .ec-mobile-menu-panel {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        width: 100%;
        padding-top: .65rem;
    }

    .ec-mobile-menu-panel.is-open {
        display: flex;
    }

    .ec-mobile-menu-panel .ec-nav-custom {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: .4rem;
    }

    .ec-mobile-menu-panel .ec-nav-link {
        width: 100%;
        min-height: 48px;
        justify-content: space-between;
        padding: .72rem 1rem;
        border: 1px solid var(--ec-border, #e5e7eb);
        border-radius: 10px;
        background: #ffffff;
        white-space: normal;
    }

    .ec-mobile-menu-panel .ec-admin-toggle,
    .ec-mobile-menu-panel .ec-whatsapp-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 46px;
        margin-left: 0 !important;
        border-radius: 10px;
    }

    .ec-mobile-menu-panel .ec-products-dropdown {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin-top: .35rem !important;
        box-shadow: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ec-mobile-menu-toggle,
    .ec-mobile-menu-chevron {
        transition: none;
    }
}
/* DIAFRP-MOBILE-MENU-END */


/* R7.7.0-HF1B-MENU-SCROLL-SAFE-START
 * Ajuste aditivo: no reemplaza estilos existentes.
 * Menú PRODUCTOS y sidebar de catálogo desplazables en escritorio.
 */
@media (min-width: 992px) {
  .ec-nav-custom .ec-products-dropdown {
    max-height: min(72vh, calc(100dvh - 120px)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
  }

  /* Mantener las subcategorías dentro del panel desplazable para que no se recorten. */
  .ec-products-dropdown .ec-menu-category.has-submenu > .ec-submenu {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    margin: .12rem .25rem .42rem .8rem !important;
    padding: .12rem 0 .12rem .55rem !important;
    border: 0 !important;
    border-left: 2px solid #e2e8f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .ec-catalog-sidebar {
    max-height: calc(100dvh - 165px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    padding-right: .35rem;
  }
}

@media (max-width: 991.98px) {
  .ec-nav-custom .ec-products-dropdown,
  .ec-catalog-sidebar {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0;
  }
}
/* R7.7.0-HF1B-MENU-SCROLL-SAFE-END */
