/*
 * Parches propios para el tema 4 (Ehay).
 * Cargado al final del <head>: pisa el style.css del template y neutraliza
 * reglas del admin DreamsPOS que se filtran a la tienda publica.
 *
 * Verificado en test.sermacsoft.com con Playwright (resize 1920x1080).
 */

/* Logo escalable desde el panel. */
.logo a img, .logo-sticky img { max-height: var(--t4-logo-alto, 55px); width: auto; }

/* Preloader que se apaga tarde si window.load espera a terceros. */
.preloader.loaded { opacity: 0; visibility: hidden; }

/* ========================================================================
 * NAVBAR
 * ========================================================================
 * Sin estos !important el CSS del admin pisa al del template Ehay y:
 *  - .mobile-responsive-nav se muestra en desktop
 *  - .desktop-nav pierde el background naranja
 *  - .navbar-category-dropdown aparece siempre abierto como columna lateral
 * Diagnostico hecho con DevTools: desktop_nav bg quedaba en rgb(255,255,255),
 * dropdown-opacity en 1 pese al CSS del template que lo deja en 0.
 */

/* Desktop (>=768px). */
@media (min-width: 768px) {
    .mobile-responsive-nav { display: none !important; }
    .desktop-nav           { display: block !important; }
}
/* Mobile. */
@media (max-width: 767.98px) {
    .mobile-responsive-nav { display: block !important; }
    .desktop-nav           { display: none !important; }
}

/* La franja naranja a lo ancho. */
.desktop-nav { background-color: var(--theme-color, #ff6a00) !important; }
.desktop-nav .navbar { padding: 0 !important; }

/* El boton "TODAS LAS CATEGORIAS" como caja blanca a la izquierda. */
.desktop-nav .navbar-category > button {
    background-color: #fff !important;
    color: var(--theme-color, #ff6a00) !important;
    width: 320px !important;
    padding: 22px 25px !important;
    text-align: left !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
}
.desktop-nav .navbar-category > button .arrow-down { float: right; margin-top: 3px; }

/* Links del nav en blanco sobre el naranja. */
.desktop-nav .navbar-nav .nav-link { color: #fff !important; padding: 22px 15px !important; }
.desktop-nav .navbar-nav .nav-link.active,
.desktop-nav .navbar-nav .nav-link:hover { color: #ffe8d6 !important; }

/* El admin DreamsPOS le mete padding: 25px 0 a .nav-item y la franja crece
 * de ~70px a 109px. En el template Ehay original el padding vertical lo
 * carga .nav-link, no .nav-item. */
.desktop-nav .navbar-nav .nav-item { padding: 0 !important; margin: 0 !important; list-style: none !important; }
.desktop-nav .navbar-nav { align-items: center !important; }

/* Mensaje de la derecha ("Envio gratis en compras...") en blanco. */
.desktop-nav .others-options { margin-left: auto !important; padding-right: 20px !important; color: #fff !important; }
.desktop-nav .others-options span { color: #fff !important; }

/* Dropdown de categorias oculto por default. Base del absolute. */
.navbar-category { position: relative; }
.navbar-category-dropdown {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 320px !important;
    max-height: 541px !important;
    overflow: auto !important;
    background-color: #fff !important;
    box-shadow: 0 0 20px 3px rgba(0,0,0,.05) !important;
    z-index: 999 !important;
}
.navbar-category-dropdown.active,
.navbar-category-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* ========================================================================
 * MINI CARRITO (modal cart-shit de Ehay)
 * El template Ehay original asume que el <li> del cart-list trae texto
 * suelto; mi markup usa <a>+<span> para el nombre/subtotal y una <li>
 * especial cuando el carrito queda vacío. Estos ajustes son para esos dos
 * casos nuevos, lo demás viene del style.css del template.
 * ===================================================================== */
.cart-shit .cart-list .t4-cart-vacio {
    text-align: center;
    color: #888;
    padding: 25px 10px;
    border-bottom: none;
}
.cart-shit .cart-list .t4-cart-quitar {
    cursor: pointer;
    font-size: 18px;
    opacity: .6;
}
.cart-shit .cart-list .t4-cart-quitar:hover { opacity: 1; color: var(--theme-color, #ff6a00); }

.cart-shit .cart-check-btn .default-btn.disabled {
    pointer-events: none;
    opacity: .5;
}

/* ========================================================================
 * QUICK VIEW (modal #exampleModal)
 * El template original usa Owl Carousel para la galería; nosotros no lo
 * inicializamos dentro de un modal porque Owl se porta mal en elementos
 * ocultos. Reemplazamos por una grilla simple con imagen principal +
 * thumbnails en fila, mantenemos las clases .product-view-one del template.
 * ===================================================================== */
.product-view-one .t4-quick-img {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-view-one .t4-quick-img img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
}
.product-view-one .t4-quick-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.product-view-one .t4-quick-thumb {
    display: block;
    width: 70px;
    height: 70px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}
.product-view-one .t4-quick-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-view-one .t4-quick-thumb.active {
    border-color: var(--theme-color, #ff6a00);
}

.product-view-one .t4-quick-attr { margin: 10px 0; }
.product-view-one .t4-quick-attr-label {
    display: inline-block;
    font-weight: 600;
    margin-right: 10px;
    color: var(--heading-color, #111);
}
.product-view-one .t4-quick-attr ul {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.product-view-one .t4-quick-op {
    border: 1px solid #ddd;
    background: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.product-view-one .t4-quick-op.seleccionada {
    border-color: var(--theme-color, #ff6a00);
    color: var(--theme-color, #ff6a00);
    font-weight: 600;
}
.product-view-one .t4-quick-op[disabled] {
    opacity: .4;
    text-decoration: line-through;
    cursor: not-allowed;
}

.product-view-one .t4-quick-mas-info { margin-top: 15px; }
.product-view-one .t4-quick-mas-info a {
    color: var(--theme-color, #ff6a00);
    text-decoration: underline;
    font-size: 14px;
}

.product-view-one .in-stock.stock-out { color: #c62828; }

/* El botón ojito ahora puede ser <button>; neutralizo el estilo nativo. */
.single-products .eye-btn[type="button"] {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* ========================================================================
 * IMÁGENES — ajustar a caja sin deformar
 * Los productos del cliente vienen con fotos de distintos tamaños (celular,
 * cámara, scraper). El template Ehay asume que todas son cuadradas. Les
 * damos un alto fijo con object-fit: contain para que entren centradas sin
 * recortar ni estirar.
 * ===================================================================== */

/* Tarjetas de la grilla (best-seller, featured, new-arrivals, categories tab). */
.single-products .product-img { background: #f7f7f7; }
.single-products .product-img a,
.single-products .product-img > img { display: block; }
.single-products .product-img img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    padding: 10px;
    background: #fff;
}

/* Flash deals: la imagen va a la izquierda, más ancha, dejamos un alto mayor. */
.deals-products .product-img img {
    height: 320px;
    object-fit: contain;
    padding: 10px;
    background: #fff;
}

/* Listas laterales (trending-product-list, special-area). */
.trending-product-list .single-list img:first-child {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: #f7f7f7;
    padding: 6px;
    flex-shrink: 0;
}

/* Categorías populares. */
.popular-categories-area .single-categories img {
    max-width: 100%;
    height: 140px;
    object-fit: contain;
}

/* Mini carrito del modal. */
.cart-shit .cart-list img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #f7f7f7;
    padding: 4px;
}

/* Partners / marcas: logos de distinto formato. */
.partner-area .partner-item img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* Métodos de pago del pie. */
.payment-option li img {
    max-height: 24px;
    width: auto;
    object-fit: contain;
}

/* ========================================================================
 * PAGE TITLE AREA — breadcrumb
 * ===================================================================== */
.page-title-area {
    background: #f5f5f5;
    padding: 30px 0;
    margin-bottom: 0;
}
.page-title-area .page-title-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.page-title-area .page-title-content ul li {
    display: inline-block;
    margin-right: 10px;
    color: #666;
}
.page-title-area .page-title-content ul li + li::before {
    content: "/";
    margin-right: 10px;
    color: #ccc;
}
.page-title-area .page-title-content ul li a {
    color: var(--heading-color, #111);
    text-decoration: none;
}
.page-title-area .page-title-content ul li.active {
    color: var(--theme-color, #ff6a00);
    font-weight: 600;
}

/* ========================================================================
 * LISTADO DE PRODUCTOS — sidebar + barra + filtros
 * ===================================================================== */
.t4-sidebar-widget {
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 20px;
}
.t4-sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--heading-color, #111);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.t4-filtro-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
}
.t4-filtro-lista li { margin-bottom: 6px; }
.t4-filtro-lista label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}
.t4-filtro-precio input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
}
.t4-filtro-precio button { width: 100%; padding: 8px; margin-top: 4px; }
.t4-filtro-precio small { display: block; margin-top: 8px; }

.t4-productos-barra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
}
.t4-productos-conteo { font-size: 14px; color: #666; }
.t4-productos-orden { display: flex; align-items: center; gap: 10px; }
.t4-productos-orden label { margin: 0; font-size: 14px; }
.t4-productos-orden select { width: auto; min-width: 200px; }

.t4-productos-vacio { color: #777; }

@keyframes t4spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.t4-spin { display: inline-block; animation: t4spin 1s linear infinite; }

/* ========================================================================
 * DETALLE DE PRODUCTO — galería, variaciones, tabs
 * ===================================================================== */
.product-view-one.product-view-one { background: #fff; border-radius: 8px; padding: 30px; }
.product-details-area .product-view-one-image #big img {
    max-height: 450px;
    object-fit: contain;
    background: #f7f7f7;
    width: 100%;
    padding: 20px;
}
.product-details-area #thumbs .item img {
    height: 90px;
    object-fit: contain;
    background: #f7f7f7;
    padding: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}
.product-details-area #thumbs .owl-item.current img,
.product-details-area #thumbs .item:hover img {
    border-color: var(--theme-color, #ff6a00);
}

.product-details-area .price .in-stock.stock-out { color: #c62828; }
.t4-vigencia-oferta {
    background: #fff3e0;
    padding: 8px 12px;
    border-left: 3px solid var(--theme-color, #ff6a00);
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.product-color-switch.t4-variacion ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 15px 0;
}
.product-color-switch.t4-variacion ul li { margin: 0; display: inline-block; }
.product-color-switch.t4-variacion ul li span { font-weight: 600; margin-right: 5px; }
.t4-var-opcion {
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
.t4-var-opcion small { font-size: 11px; color: #777; margin-left: 4px; }
.product-color-switch.t4-variacion li.active .t4-var-opcion {
    border-color: var(--theme-color, #ff6a00);
    color: var(--theme-color, #ff6a00);
    font-weight: 600;
}
.t4-var-opcion[disabled] {
    opacity: .4;
    text-decoration: line-through;
    cursor: not-allowed;
}

.products-details-tab ul.tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 30px 0 0;
    border-bottom: 2px solid #eee;
    gap: 20px;
}
.products-details-tab ul.tabs li {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
}
.products-details-tab ul.tabs li.current {
    color: var(--theme-color, #ff6a00);
    border-bottom: 2px solid var(--theme-color, #ff6a00);
    margin-bottom: -2px;
}
.products-details-tab .tab_content .tabs_item { padding: 20px 0; }

ul.additional-information {
    list-style: none;
    padding: 0;
    margin: 0;
}
ul.additional-information li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
ul.additional-information li span {
    display: inline-block;
    width: 150px;
    font-weight: 600;
    color: var(--heading-color, #111);
}

/* ========================================================================
 * CHECKOUT
 * ===================================================================== */
.billing-details, .order-details {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}
.billing-details .title, .order-details .title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 20px;
}
.billing-details .form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.billing-details .form-group .required { color: #dc3545; }
.order-details .order-table table { margin-bottom: 0; }
.order-details .product-name .t4-ck-mini {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #f7f7f7;
    padding: 3px;
    margin-right: 8px;
    vertical-align: middle;
}
.order-details .product-name .t4-ck-cant { font-size: 12px; color: #777; margin-left: 5px; }

.t4-cupon-msg { font-size: 13px; }

/* ========================================================================
 * CONTACTO
 * ===================================================================== */
.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}
.contact-info-list li {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
    padding-left: 60px;
}
.contact-info-list li i {
    position: absolute;
    left: 15px;
    top: 20px;
    font-size: 28px;
    color: var(--theme-color, #ff6a00);
}
.contact-info-list li h3 { font-size: 15px; margin: 0 0 4px; color: var(--heading-color, #111); }
.contact-info-list li p { margin: 0; font-size: 14px; color: #666; }
.contact-info-list li p a { color: inherit; }

.contact-form { background: #fff; padding: 30px; border: 1px solid #eee; border-radius: 8px; }
.contact-form .form-group label { font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.t4-btn-wa { margin-left: 10px; background: #25D366 !important; }
.t4-mapa { height: 400px; border-radius: 8px; overflow: hidden; }
.t4-mapa iframe { width: 100%; height: 100%; border: 0; }

/* ========================================================================
 * LOGIN / REGISTRO
 * ===================================================================== */
.user-form-content {
    background: #fff;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    height: 100%;
}
.user-form-content h3 { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.user-form-content .form-group label { font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.user-form-content .login-action { font-size: 13px; }
.user-form-content .forgot-login a { color: var(--theme-color, #ff6a00); text-decoration: none; }
.t4-form-msg { font-size: 14px; }

/* ========================================================================
 * CHECKOUT RETURN
 * ===================================================================== */
.order-success-content {
    background: #fff;
    padding: 50px 30px;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.order-success-content .order-summary { text-align: left; margin-top: 30px; }

