/* --- cursor normal en carrusel --- */
.cursorimage,
.owl-carousel .owl-item img,
.owl-carousel .owl-item a,
body.single-auto .listing_img_gallery img {
    cursor: default !important;
}

/* --- estilo del ekko lightbox: fondo transparente + sin borde --- */
.ekko-lightbox .modal-content,
.ekko-lightbox .modal-dialog,
.ekko-lightbox .modal-body {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* --- imagen del lightbox: siempre visible completa (sin recorte) --- */
.ekko-lightbox .modal-body img {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: calc(100vh - 100px) !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
}

/* refuerzo si hay reglas muy especificas */
body.single-auto .ekko-lightbox .modal-body img,
.ekko-lightbox.modal .modal-body img {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: calc(100vh - 100px) !important;
}
body,
html {
    background: #000 !important;
    color: #fff; /* para prevenir textos invisibles */
}
/* =========================
   A) BOTÓN LATERAL (sidebar) — centrado, fondo transparente/negro, borde blanco
   ========================= */
.sell_car_quote .btn,
.sidebar_widget .sell_car_quote .btn,
.widget .sell_car_quote .btn {
  display: block !important;
  margin: 18px auto !important;       /* centrado horizontal */
  padding: 12px 22px !important;
  width: 85% !important;
  max-width: 260px !important;
  text-align: center !important;
  background: transparent !important;  /* estado normal: transparente */
  color: #ffffff !important;           /* texto blanco por defecto */
  border: 2px solid #ffffff !important;
  border-radius: 5px !important;
  box-sizing: border-box !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

/* si querés que el fondo por defecto sea negro en vez de transparente, descomenta la línea siguiente */
/* .sell_car_quote .btn { background: #000 !important; } */

/* hover/active del botón lateral */
.sell_car_quote .btn:hover,
.sidebar_widget .sell_car_quote .btn:hover,
.widget .sell_car_quote .btn:hover {
  background: #c00000 !important;   /* rojo al hover */
  color: #000000 !important;        /* letras negras al hover */
  border-color: transparent !important;
}

/* =========================
   B) BOTÓN DE TARJETA / "Ver detalles" — comportamiento inverso
   ========================= */
.listing_more_info .btn,
.listing_more_info a.btn,
.card .btn,
.btn-listing,
a.btn.details,
.btn.btn-danger {
  display: inline-block !important;
  padding: 10px 18px !important;
  border-radius: 5px !important;
  background: transparent !important;  /* estado normal: transparente / o blanco si preferís */
  color: #000000 !important;            /* texto negro normal */
  border: 2px solid #000000 !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

/* hover/active del botón de tarjeta */
.listing_more_info .btn:hover,
.listing_more_info a.btn:hover,
.card .btn:hover,
.btn-listing:hover,
a.btn.details:hover,
.btn.btn-danger:hover {
  background: #c00000 !important;   /* rojo al pasar cursor */
  color: #ffffff !important;        /* texto blanco en hover */
  border-color: transparent !important;
}

/* Fortalecedor: si hay reglas inline muy específicas, usá la versión con body context */
/* (descomenta la siguiente sección si notas que no se aplican las reglas) */
/*
body.single-auto .sell_car_quote .btn,
body.post-type-archive .sell_car_quote .btn { ...same rules... }

body.single-auto .listing_more_info .btn,
body.post-type-archive .listing_more_info .btn { ...same rules... }
*/
/* ===== BOTÓN COSTADO (dentro del sidebar .sell_car_quote) ===== */
.sell_car_quote .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    color: #fff !important;
    background: transparent !important;
    border: 2px solid #fff !important;
    border-radius: 5px;
    font-weight: 600;
    transition: all .25s ease;
}

.sell_car_quote .btn:hover {
    background: #e90000 !important;
    border-color: transparent !important;
    color: #000 !important;
}

.sell_car_quote .btn .angle_arrow {
    color: inherit !important;
    transition: inherit;
}
.sell_car_quote .btn:hover .angle_arrow {
    color: #000 !important;
}

/* ===== BOTÓN TARJETA (listing cards) — comportamiento inverso ===== */
.listing-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    color: #000 !important;
    background: transparent !important;
    border: 2px solid #000 !important;
    border-radius: 5px;
    font-weight: 600;
    transition: all .25s ease;
}

.listing-page .btn:hover {
    background: #e90000 !important;
    border-color: transparent !important;
    color: #fff !important;
}
.listing-page .btn .angle_arrow {
    color: inherit !important;
    transition: inherit;
}
.listing-page .btn:hover .angle_arrow {
    color: #fff !important;
}
// --- Forzar carga de custom CSS y estilo inline para prioridad máxima
add_action( 'wp_enqueue_scripts', function() {
    $child_dir = get_stylesheet_directory();
    $child_uri = get_stylesheet_directory_uri();

    // encolar custom.css si existe
    $custom_css = $child_dir . '/custom.css';
    if ( file_exists( $custom_css ) ) {
        $ver = filemtime( $custom_css );
        wp_enqueue_style( 'carforyou-child-custom', $child_uri . '/custom.css', array(), $ver );
    }

}, 20 ); // prioridad 20

// Añadir bloque inline en <head> con prioridad máxima (forzado)
add_action( 'wp_head', function() {
    // CONTENIDO CSS INLINE (siempre se imprimirá y pisará casi todo)
    $css = "
/* ======== OVERRIDE DEFINITIVO: botones y lightbox ======== */

/* Botón lateral (sidebar) */
.sell_car_quote .btn,
aside .sell_car_quote .btn,
.widget .sell_car_quote .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 90% !important;
  padding: 10px 18px !important;
  color: #fff !important;
  background: transparent !important;
  border: 2px solid #fff !important;
  border-radius: 5px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  font-weight: 600 !important;
  transition: all .18s ease !important;
  position: relative !important;
}

/* el pequeño punto / icono dentro del botón */
.sell_car_quote .btn .angle_arrow,
.sell_car_quote .btn .btn-dot,
.sell_car_quote .btn i {
  color: inherit !important;
  background: transparent !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* hover del botón lateral */
.sell_car_quote .btn:hover,
aside .sell_car_quote .btn:hover,
.widget .sell_car_quote .btn:hover {
  background: #c00000 !important;
  color: #000 !important;
  border-color: transparent !important;
}

/* Botón en tarjetas/listados (comportamiento inverso) */
.listing-page .btn,
.product-listing-content .btn,
.product-listing .btn,
.listing_more_info .btn,
.card .btn,
a.btn.details,
a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 14px !important;
  color: #000 !important;
  background: transparent !important;
  border: 2px solid #000 !important;
  border-radius: 5px !important;
  font-weight: 600 !important;
  transition: all .18s ease !important;
}

/* hover del botón de tarjeta */
.listing-page .btn:hover,
.product-listing-content .btn:hover,
.product-listing .btn:hover,
.listing_more_info .btn:hover,
.card .btn:hover,
a.btn.details:hover {
  background: #c00000 !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* Forzar que elementos internos hereden color */
.sell_car_quote .btn * ,
.listing-page .btn * ,
.product-listing-content .btn * {
  color: inherit !important;
  background: transparent !important;
  border: none !important;
}

/* ================= Lightbox (ekko) - imagen completa sin recorte y sin marco ================= */
/* quitar marco blanco del modal */
.ekko-lightbox .modal-content,
.ekko-lightbox .modal-dialog,
.ekko-lightbox .modal-body,
.modal.ekko-lightbox .modal-content,
.modal.ekko-lightbox .modal-dialog,
.modal.ekko-lightbox .modal-body {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* imagen dentro del ekko modal: siempre contener entera sin recortar */
.ekko-lightbox .modal-body img,
.modal.ekko-lightbox .modal-body img {
  object-fit: contain !important;
  max-width: 100% !important;
  max-height: calc(100vh - 120px) !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
  background: transparent !important;
  border: none !important;
}

/* quitar cursor lupa en el carrusel */
.cursorimage,
.owl-carousel .owl-item img,
a[data-toggle=\"lightbox\"],
a[data-gallery] {
  cursor: default !important;
}

/* Asegurar visibilidad sobre fondo negro (si tu site es oscuro) */
body, html, .site, .site-wrapper, .site-content, .listing-page {
  background-color: #000 !important;
  color: #fff !important;
}

/* refuerzo final: boton .btn generico dentro de these contexts */
body.single-auto .btn,
body.archive .btn,
.listing-page .btn {
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility !important;
}
";
    echo "<style id='carforyou-child-inline' type='text/css'>\n" . $css . "\n</style>\n";
}, 1 ); // prioridad muy alta para imprimir antes que la mayoría de estilos, pero inline en head sobrescribe

/* --- BOTONES GENERALES .btn --- */
.btn,
.btn:visited {
    color: #000 !important;          /* texto negro por defecto */
    background: #fff !important;     /* fondo blanco por defecto */
    border-color: #000 !important;   /* borde negro */
    transition: all .2s ease-in-out;
}

.btn:hover,
.btn:focus {
    color: #fff !important;          /* texto blanco al hover */
    background: #d60000 !important;  /* rojo fuerte al hover */
    border-color: #d60000 !important;
}

/* Corrige íconos dentro del botón */
.btn i,
.btn span,
.btn svg {
    color: inherit !important;
}

.btn:hover i,
.btn:hover span,
.btn:hover svg {
    color: inherit !important;
}
/* === RADICAL OVERRIDE GLOBAL DE BOTONES === */

a.btn,
button.btn,
input[type="button"].btn,
input[type="submit"].btn,
a.btn:visited {
    color:#000 !important;
    background:#fff !important;
    border:1px solid #000 !important;
    display:inline-block !important;
    transition:all .2s ease !important;
    text-decoration:none !important;
}

/* Hover universal */
a.btn:hover,
button.btn:hover,
input[type="button"].btn:hover,
input[type="submit"].btn:hover {
    color:#fff !important;
    background:#d60000 !important;
    border-color:#d60000 !important;
}

/* Forzar iconos adentro del btn a heredar */
a.btn i,
button.btn i {
    color:inherit !important;
}

a.btn:hover i,
button.btn:hover i {
    color:inherit !important;
}
/* === SOLO BOTONES EN PÁGINAS DE AUTOS === */

/* Listado de autos */
body.listing-page a.btn,
body.listing-page button.btn,
body.listing-page input[type="submit"].btn {
  background:#fff !important;
  color:#000 !important;
  border:2px solid #000 !important;
  text-decoration:none !important;
  transition:all .2s ease !important;
}

/* Hover en listado */
body.listing-page a.btn:hover,
body.listing-page button.btn:hover,
body.listing-page input[type="submit"].btn:hover {
  background:#fff !important;
  color:#000 !important;
  border-color:#000 !important;
}

/* Páginas de un auto específico */
body.single-auto a.btn,
body.single-auto button.btn,
body.single-auto input[type="submit"].btn {
  background:#fff !important;
  color:#000 !important;
  border:2px solid #000 !important;
  text-decoration:none !important;
  transition:all .2s ease !important;
}

/* Hover en single auto */
body.single-auto a.btn:hover,
body.single-auto button.btn:hover,
body.single-auto input[type="submit"].btn:hover {
  background:#fff !important;
  color:#000 !important;
  border-color:#000 !important;
}

/* Íconos internos */
body.listing-page a.btn i,
body.single-auto a.btn i {
  color:inherit !important;
}
/* === RADICAL GLOBAL OVERRIDE DE BOTONES === */

a.btn,
button.btn,
input[type="button"].btn,
input[type="submit"].btn,
a.btn:visited {
  color: #000 !important;
  background: #fff !important;
  border: 2px solid #000 !important;
  display: inline-block !important;
  text-decoration: none !important;
  text-align: center !important;
  font-weight: 600 !important;
  transition: all 0.2s ease-in-out !important;
  border-radius: 4px !important;
  padding: 10px 20px !important;
}

/* Hover universal */
a.btn:hover,
button.btn:hover,
input[type="button"].btn:hover,
input[type="submit"].btn:hover {
  color: #fff !important;
  background: #d60000 !important;
  border-color: #d60000 !important;
}

/* Íconos dentro de los botones */
a.btn i,
button.btn i,
.btn span,
.btn svg {
  color: inherit !important;
  transition: inherit !important;
}

/* Hover íconos */
a.btn:hover i,
button.btn:hover i,
.btn:hover span,
.btn:hover svg {
  color: inherit !important;
}
body.single-auto a[class*="btn"],
body.listing-page a[class*="btn"] {
  all: unset !important;
  display:inline-block !important;
  background:#fff !important;
  color:#000 !important;
  border:2px solid #000 !important;
  padding:10px 20px !important;
  cursor:pointer !important;
  text-decoration:none !important;
  font-size:14px !important;
  transition:all .2s ease !important;
}

body.single-auto a[class*="btn"]:hover,
body.listing-page a[class*="btn"]:hover {
  background:#fff !important;
  color:#000 !important;
  border-color:#000 !important;
}
/* BOTON FILTRO CARRUSEL — ESTADO NORMAL */
#filter_toggle.search_other {
    display: inline-flex;          /* lo centra con ícono incluido */
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 10px 18px;
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    border-radius: 5px;
    cursor: pointer;
    text-transform: none;
}

/* HOVER */
#filter_toggle.search_other:hover {
    background: #c60404 !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* ICONO BLANCO EN HOVER */
#filter_toggle.search_other:hover i {
    color: #fff !important;
}

/* ICONO NEGRO EN NORMAL */
#filter_toggle.search_other i {
    color: #000 !important;
}
/* Botón del widget – estado normal */
.widget .btn.btn-block {
    background:#fff !important;
    color:#000 !important;
    border:1px solid #000 !important;
}

/* Hover */
.widget .btn.btn-block:hover {
    background:#d00 !important;   /* o el rojo que usa el tema si querés */
    color:#fff !important;
    border-color:#d00 !important;
}
/* Ekko lightbox: imagen completa sin recorte y marco blanco */
.ekko-lightbox .modal-content,
.modal.ekko-lightbox .modal-content {
    background: #ffffff !important; /* marco blanco */
    padding: 10px !important;       /* separación entre borde blanco y la imagen */
    box-shadow: 0 12px 30px rgba(0,0,0,0.55) !important;
    border-radius: 4px !important;
    border: none !important;
}

/* Imagen dentro del lightbox: contenerla entera (no recortar) */
.ekko-lightbox .modal-body img,
.modal.ekko-lightbox .modal-body img {
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100vh - 120px) !important;
    display: block !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
}



