/*
 * Walter Schadtler Child Theme - estilos base.
 * Aquí van ajustes globales del sitio, sin tocar GeneratePress ni Elementor.
 */

/* =========================================================
   Variables base Walter / CRM
========================================================= */

:root {
  --wsc-purple: #68289a;
  --wsc-purple-dark: #3f1b5f;
  --wsc-orange: #f86600;
  --wsc-bg: #f8f6fa;
  --wsc-card: #ffffff;
  --wsc-ink: #20172a;
  --wsc-muted: #766982;
  --wsc-line: rgba(104, 40, 154, 0.14);
  --wsc-shadow: 0 18px 45px rgba(42, 20, 61, 0.10);
  --wsc-radius: 24px;

  /*
   * Layout estándar CRM escritorio:
   * Sidebar 20% / Contenido 80%
   */
  --wsc-crm-sidebar-ratio: 20fr;
  --wsc-crm-content-ratio: 80fr;
  --wsc-crm-gap: 24px;
  --wsc-crm-padding-x: 24px;
  --wsc-crm-padding-y: 24px;
}

/* =========================================================
   Base global
========================================================= */

html {
  scroll-behavior: smooth;
}

body.wsc-child-theme {
  color: var(--wsc-ink);
}

body.wsc-child-theme a {
  text-underline-offset: 0.16em;
}

body.wsc-child-theme ::selection {
  background: rgba(104, 40, 154, 0.18);
}

/* =========================================================
   Páginas operativas /crm/
========================================================= */

body.wsc-crm-site {
  background: var(--wsc-bg);
}

body.wsc-crm-site .site-content,
body.wsc-crm-site .inside-site-info,
body.wsc-crm-site .inside-header,
body.wsc-crm-site *,
body.wsc-crm-site *::before,
body.wsc-crm-site *::after {
  box-sizing: border-box;
}

/* Ocultar header del sitio en todo CRM */
body.wsc-crm-site .site-header,
body.wsc-crm-site #masthead {
  display: none !important;
}

/* Evitar márgenes superiores heredados */
body.wsc-crm-site .site-content {
  min-height: calc(var(--wsc-vh, 1vh) * 100 - 80px);
}

body.wsc-crm-site .inside-article {
  border-radius: 0;
}

/* =========================================================
   CRM Layout estándar escritorio
   Aplica a todos los módulos CRM excepto login
========================================================= */

body.wsc-crm-site:not(.wsc-crm-login-page) #page,
body.wsc-crm-site:not(.wsc-crm-login-page) .site.grid-container,
body.wsc-crm-site:not(.wsc-crm-login-page) .site-content.grid-container {
  width: 100% !important;
  max-width: none !important;
}

/*
 * Shell principal:
 * Sidebar 20% / Contenido 80%
 */
body.wsc-crm-site:not(.wsc-crm-login-page) #content.site-content,
body.wsc-crm-site:not(.wsc-crm-login-page) .site-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: var(--wsc-crm-padding-y) var(--wsc-crm-padding-x) !important;
  display: grid !important;
  grid-template-columns: minmax(240px, var(--wsc-crm-sidebar-ratio)) minmax(0, var(--wsc-crm-content-ratio));
  gap: var(--wsc-crm-gap);
  align-items: start;
}

/* Columna lateral izquierda de GeneratePress */
body.wsc-crm-site:not(.wsc-crm-login-page) #left-sidebar,
body.wsc-crm-site:not(.wsc-crm-login-page) .is-left-sidebar,
body.wsc-crm-site:not(.wsc-crm-login-page) .wsc-crm-sidebar-column {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-column: 1;
  padding: 0 !important;
  margin: 0 !important;
}

/* Interior del sidebar */
body.wsc-crm-site:not(.wsc-crm-login-page) .inside-left-sidebar,
body.wsc-crm-site:not(.wsc-crm-login-page) .wsc-crm-sidebar-inner {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Widget del menú lateral */
body.wsc-crm-site:not(.wsc-crm-login-page) .wsc-crm-sidebar-widget,
body.wsc-crm-site:not(.wsc-crm-login-page) #left-sidebar .widget {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Menú CRM */
body.wsc-crm-site:not(.wsc-crm-login-page) #wsc-crm-sidebar {
  width: 100% !important;
  max-width: 100% !important;
}

/* Área principal */
body.wsc-crm-site:not(.wsc-crm-login-page) #primary,
body.wsc-crm-site:not(.wsc-crm-login-page) .content-area {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-column: 2;
  padding: 0 !important;
  margin: 0 !important;
}

/* Limpieza interna GeneratePress */
body.wsc-crm-site:not(.wsc-crm-login-page) #main,
body.wsc-crm-site:not(.wsc-crm-login-page) .site-main,
body.wsc-crm-site:not(.wsc-crm-login-page) .inside-article,
body.wsc-crm-site:not(.wsc-crm-login-page) .entry-content {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Ocultar right sidebar si algún layout lo llega a activar */
body.wsc-crm-site:not(.wsc-crm-login-page) #right-sidebar,
body.wsc-crm-site:not(.wsc-crm-login-page) .is-right-sidebar {
  display: none !important;
}

/* Elementor: evitar anchos distintos por módulo */
body.wsc-crm-site:not(.wsc-crm-login-page) .elementor,
body.wsc-crm-site:not(.wsc-crm-login-page) .elementor-section,
body.wsc-crm-site:not(.wsc-crm-login-page) .elementor-container,
body.wsc-crm-site:not(.wsc-crm-login-page) .elementor-widget-wrap,
body.wsc-crm-site:not(.wsc-crm-login-page) .elementor-widget-html,
body.wsc-crm-site:not(.wsc-crm-login-page) .e-con,
body.wsc-crm-site:not(.wsc-crm-login-page) .e-con-inner {
  width: 100% !important;
  max-width: 100% !important;
}

/* Módulos CRM actuales y futuros */
body.wsc-crm-site:not(.wsc-crm-login-page) #wsc-cuestionario-app,
body.wsc-crm-site:not(.wsc-crm-login-page) #wsc-dashboard-app,
body.wsc-crm-site:not(.wsc-crm-login-page) [id^="wsc-"][id$="-app"] {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Menú sticky en escritorio */
@media (min-width: 769px) {
  body.wsc-crm-site:not(.wsc-crm-login-page) #left-sidebar,
  body.wsc-crm-site:not(.wsc-crm-login-page) .is-left-sidebar,
  body.wsc-crm-site:not(.wsc-crm-login-page) .wsc-crm-sidebar-column {
    position: sticky !important;
    top: 10px;
    align-self: flex-start !important;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 20;
  }

  body.admin-bar.wsc-crm-site:not(.wsc-crm-login-page) #left-sidebar,
  body.admin-bar.wsc-crm-site:not(.wsc-crm-login-page) .is-left-sidebar,
  body.admin-bar.wsc-crm-site:not(.wsc-crm-login-page) .wsc-crm-sidebar-column {
    top: 0;
    max-height: calc(100vh - 80px);
  }
}

/* =========================================================
   Página Login CRM
   Pantalla completa, sin sidebar
========================================================= */

body.wsc-crm-login-page #content.site-content,
body.wsc-crm-login-page .site-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

body.wsc-crm-login-page #primary,
body.wsc-crm-login-page .content-area,
body.wsc-crm-login-page #main,
body.wsc-crm-login-page .site-main,
body.wsc-crm-login-page .inside-article,
body.wsc-crm-login-page .entry-content {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.wsc-crm-login-page #left-sidebar,
body.wsc-crm-login-page .is-left-sidebar,
body.wsc-crm-login-page #right-sidebar,
body.wsc-crm-login-page .is-right-sidebar {
  display: none !important;
}

/* =========================================================
   Página del cuestionario
========================================================= */

body.wsc-cuestionario-page .entry-header,
body.wsc-cuestionario-page .entry-title {
  display: none !important;
}

body.wsc-cuestionario-page .site-content,
body.wsc-cuestionario-page .content-area,
body.wsc-cuestionario-page .site-main,
body.wsc-cuestionario-page .inside-article {
  width: 100%;
  max-width: none;
}

body.wsc-cuestionario-page .inside-article {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* =========================================================
   Botones base para componentes propios
========================================================= */

.wsc-btn,
button.wsc-btn,
a.wsc-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--wsc-purple);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  min-height: 44px;
  padding: 12px 18px;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.wsc-btn:hover,
.wsc-btn:focus-visible {
  background: var(--wsc-purple-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(104, 40, 154, 0.22);
}

.wsc-btn--orange {
  background: var(--wsc-orange);
}

.wsc-btn--orange:hover,
.wsc-btn--orange:focus-visible {
  background: #d95400;
}

.wsc-card {
  background: var(--wsc-card);
  border: 1px solid var(--wsc-line);
  border-radius: var(--wsc-radius);
  box-shadow: var(--wsc-shadow);
}

/* =========================================================
   Móvil
========================================================= */

@media (max-width: 768px) {
  :root {
    --wsc-crm-gap: 12px;
    --wsc-crm-padding-x: 10px;
    --wsc-crm-padding-y: 10px;
  }

  body.wsc-crm-site .site-content {
    min-height: calc(var(--wsc-vh, 1vh) * 100 - 60px);
  }

  body.wsc-crm-site:not(.wsc-crm-login-page) #content.site-content,
  body.wsc-crm-site:not(.wsc-crm-login-page) .site-content {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    padding: var(--wsc-crm-padding-y) var(--wsc-crm-padding-x) !important;
  }

  body.wsc-crm-site:not(.wsc-crm-login-page) #primary,
  body.wsc-crm-site:not(.wsc-crm-login-page) .content-area {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.wsc-crm-site:not(.wsc-crm-login-page) #left-sidebar,
  body.wsc-crm-site:not(.wsc-crm-login-page) .is-left-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #wsc-crm-mobile-sidebar-mount {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  body.admin-bar #wsc-crm-mobile-sidebar-mount {
    top: 0;
  }

  body.wsc-crm-site:not(.wsc-crm-login-page) #wsc-crm-sidebar {
    max-width: 100% !important;
  }

  .wsc-btn,
  button.wsc-btn,
  a.wsc-btn {
    width: 100%;
    min-height: 50px;
  }
}