/* =========================================================
   L4D Private Area (Bootstrap 5) | Avada-friendly
   Scope: .l4d
========================================================= */

:root {
  --l4d-radius: 14px;
  --l4d-border: rgba(0,0,0,.08);
  --l4d-bg: #ffffff;
  --l4d-muted: #6c757d;
  --l4d-shadow: 0 10px 30px rgba(0,0,0,.08);
  --l4d-shadow-sm: 0 6px 18px rgba(0,0,0,.08);

  --l4d-primary: #c1192d;
  --l4d-primary-softer: rgba(193, 25, 45, 0.06);
  --l4d-primary-soft: rgba(193, 25, 45, 0.12);
  --l4d-primary-medium: rgba(193, 25, 45, 0.52);
  --l4d-primary-dark: rgba(193, 25, 45, 0.82);
  --l4d-focus: 0 0 0 .25rem rgba(193, 25, 45, .22);
}

/* ---------- Cards / containers ---------- */
.l4d .l4d-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--l4d-bg);
  border: 1px solid var(--l4d-border);
  border-radius: var(--l4d-radius);
  padding: 12px;
  box-shadow: var(--l4d-shadow-sm);
  margin-bottom: 12px;
}

.l4d .l4d-sidebar {
  position: sticky;
  top: 14px;
}

/* ---------- User pic ---------- */
/*.l4d .l4d-user-pic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #f8f9fa;
  border: 1px solid var(--l4d-border);
  display: flex;
  align-items: center;
  justify-content: center;
}*/

/* si UserUtils::getUserPic mete <img> */
/*.l4d #user-pic img,
.l4d .l4d-user-pic img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
}*/

/* Bot贸n editar foto sobre avatar */
.l4d .l4d-edit-pic {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--l4d-border);
  transition: transform .16s ease, box-shadow .16s ease;
}
.l4d .l4d-edit-pic:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--l4d-shadow-sm);
}

/* ---------- Menu links ---------- */
.l4d .nav-link {
  border-radius: 10px;
  padding: .6rem .75rem;
  color: #212529;
  transition: transform .14s ease, background-color .14s ease, color .14s ease;
}

/* evita que Avada subraye o cambie colores raros */
.l4d .nav-link:hover {
  text-decoration: none !important;
  background: var(--l4d-primary-softer);
  color: #212529;
  transform: translateY(-1px);
}

.l4d .nav-link i.bi {
  font-size: 1.05rem;
  opacity: .9;
}

/* ---------- Buttons ---------- */
.l4d .btn {
  border-radius: 12px;
}
.l4d .btn:focus {
  box-shadow: var(--l4d-focus) !important;
}

/* ---------- Modal style ---------- */
.l4d .l4d-modal {
  border-radius: var(--l4d-radius);
  box-shadow: var(--l4d-shadow);
}

/* Avatar preview inside modal */
.l4d .l4d-avatar-preview {
  width: 150px;
  height: 150px;
  margin: 6px auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid var(--l4d-border);
  display: grid;
  place-items: center;
  box-shadow: var(--l4d-shadow-sm);
}

/* ---------- Loader overlay ---------- */
.l4d .l4d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(2px);
  border-radius: var(--l4d-radius);
  z-index: 10;
  animation: l4dFadeIn .18s ease-out;
}

/* ---------- Form controls tuned (Avada-proof) ---------- */
.l4d input.form-control,
.l4d textarea.form-control,
/*.l4d select.form-select,*/
.l4d input[type="number"].form-control,
.l4d input[type="date"].form-control,
.l4d input[type="datetime-local"].form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;

  padding: .45rem .75rem !important;
  border-radius: 12px !important;
  border: 1px solid #ced4da !important;
  background-color: #fff !important;
  line-height: 1.5 !important;
  box-shadow: none !important;
}

.l4d input.form-control:focus,
.l4d textarea.form-control:focus,
.l4d select.form-select:focus {
  border-color: rgba(220,53,69,.55) !important;
  box-shadow: var(--l4d-focus) !important;
}

/* Select arrow restore */
.l4d select.form-select {
  background-image:
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px 12px;
}

/* ---------- Sidebar collapse animation (mobile) ---------- */
/* Bootstrap collapse is height-based; we add extra smoothness */
.l4d #l4dSidebar.collapse,
.l4d #l4dSidebar.collapsing,
.l4d #l4dSidebar.collapse.show {
  transform-origin: top;
}

.l4d #l4dSidebar.collapsing {
  transition: height .18s ease, opacity .18s ease, transform .18s ease;
  opacity: .6;
  transform: scaleY(.98);
}

.l4d #l4dSidebar.collapse.show {
  animation: l4dSlideDown .22s ease-out;
}

/* Give main content a tiny entrance */
.l4d .private-content {
  animation: l4dContentIn .20s ease-out;
}

/* ---------- Micro-interactions ---------- */
.l4d .card,
.l4d .l4d-user-card {
  transition: transform .16s ease, box-shadow .16s ease;
  transform: none !important;
}
.l4d .card:hover,
.l4d .l4d-user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--l4d-shadow);
}

/* ---------- Keyframes ---------- */
@keyframes l4dFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes l4dSlideDown {
  from { opacity: .7; transform: scaleY(.98); }
  to   { opacity: 1; transform: scaleY(1); }
}

@keyframes l4dContentIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .l4d * {
    animation: none !important;
    transition: none !important;
  }
}


/* ==========================================================
   馃柤 Drag & Drop File Input (moderno)
========================================================== */
.files input {
    outline: 2px dashed #c1192d;
    outline-offset: -10px;
    padding: 120px 20px 85px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    transition: all .2s ease;
}

.files input:hover,
.files input:focus {
    background: #fff5f6;
    border-color: var(--l4d-primary);
    outline-color: var(--l4d-primary);
}

.files:before {
    content: "Haga click o arrastre aqu铆 su imagen.";
    position: absolute;
    text-align: center;
    bottom: 14px;
    width: 100%;
    font-weight: 600;
    color: var(--l4d-primary);
}

.files:after {
    content: "";
    background-image: url("https://cdn-icons-png.flaticon.com/512/109/109612.png");
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    width: 60px;
    height: 60px;
    margin: auto;
    background-size: cover;
    opacity: 0.7;
}
.navbar-toggler {
  border: 1px solid #ccc;
}

.page-id-366 #cmplz-manage-consent, .page-id-366 .grecaptcha-badge, .page-id-366 .fusion-footer-widget-area { display: none !important; }

#l4d-mobile-menu summary {
  cursor: pointer;
  font-weight: 600;
}

#l4d-mobile-menu[open] summary i {
  transform: rotate(180deg);
}

#l4dSidebar a.link.is-active {
  background-color: var(--l4d-primary-soft);
  box-shadow: inset 0 0 0 1px var(--l4d-primary-medium);
  font-weight: 600;
  border-radius: .375rem;
}

.btn-mobile-menu.is-active {
  background-color: var(--l4d-primary-soft);
  font-weight: 600;
}

/* =========================
   MOBILE FIRST
========================= */

/* En m贸vil: ocultar sidebar */
#l4dSidebar {
  display: none;
}

/* En m贸vil: mostrar men煤 m贸vil */
#l4d-mobile-menu {
  display: block;
}

/* =========================
   DESKTOP (md y arriba)
========================= */
@media (min-width: 768px) {

  /* En desktop: mostrar sidebar */
  #l4dSidebar {
    display: block;
  }

  /* En desktop: ocultar men煤 m贸vil */
  #l4d-mobile-menu {
    display: none;
  }
}

/* ==========================================================
   BADGES (Estados de prospecci贸n)
========================================================== */

:root {
  --custom: #19c121;
  --seguimiento: #8b4ce5;
  --presupuesto: #ff9b00;
  --visita: #0094c6;
  --nuevo: #000000;
  --pdte: #5bc863;
}


.l4d .btn-menu span.badge {
  font-size: 0.75em;
  padding: .35em .55em;
  border-radius: 6px;
  transition:
    background-color .25s ease,
    color .25s ease,
    transform .15s ease;
}

.l4d .badge-CUSTOM       { background-color: var(--custom); }
.l4d .badge-SEGUIMIENTO  { background-color: var(--seguimiento); }
.l4d .badge-PRESUPUESTO  { background-color: var(--presupuesto); }
.l4d .badge-VISITA       { background-color: var(--visita); }
.l4d .badge-NUEVO        { background-color: var(--nuevo); }
.l4d .badge-PDTE         { background-color: var(--pdte); }

.l4d .btn-menu span.badge:hover {
  transform: translateY(-1px);
}

/* Animaci贸n de entrada / cambio */
@keyframes badge-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

.l4d .btn-menu span.badge {
  animation: badge-pulse 0.35s ease;
}

.l4d-user-banner {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    display: block;
}
.l4d-user-banner {
    aspect-ratio: 16 / 6;
}
.l4d-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Modo headquarter / delegacy */
.l4d-user-card.wide-pic {
    flex-direction: column;
    align-items: stretch;
}

.l4d-user-card.wide-pic .l4d-user-pic {
    width: 100%;
}

.l4d-user-card.wide-pic .l4d-user-pic img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain!important;
}

.l4d-user-card.wide-pic .l4d-user-info {
    padding-top: 0.5rem;
}

.l4d-sticky-actions.is-dirty {
  box-shadow: 0 -6px 20px rgba(245, 158, 11, 0.35);
}

.l4d-sticky-actions.is-dirty::before {
  content: "Cambios sin guardar";
  position: absolute;
  top: -24px;
  right: 1rem;
  font-size: 12px;
  color: #b45309;
}

[data-view] {
  transition: opacity .18s ease, transform .18s ease;
}

.l4d-view-enter {
  opacity: 0;
  transform: translateX(12px);
}

.l4d-view-enter-active {
  opacity: 1;
  transform: translateX(0);
}

.l4d-view-exit {
  opacity: 1;
  transform: translateX(0);
}

.l4d-view-exit-active {
  opacity: 0;
  transform: translateX(-12px);
}

.is-forward .l4d-view-enter { transform: translateX(12px); }
:not(.is-forward) .l4d-view-enter { transform: translateX(-12px); }

.btn-horario i {
  transition: transform 0.18s ease, opacity 0.15s ease;
}

.btn-horario i.icon-animate {
  transform: scale(0.6);
  opacity: 0;
}
