/*
Theme Name: Corticolors
Theme URI: https://corticolors.com/
Author: Agencia IA Solutions
Author URI: https://agenciaiasolutions.com/
Description: Tema clásico optimizado con theme.json y bloques Gutenberg para Corticolors. Sin dependencias de Elementor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: corticolors
*/

/* ==========================================================================
   1. TIPOGRAFÍA LOCAL: POPPINS (WOFF2 LATIN SUBSET)
   Pesos activos comprobados en producción: 300, 400, 500, 600
   ========================================================================== */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cursivas, 700/800 e Inter: antes las cargaba Elementor desde Google Fonts (los textos las usan). */
@font-face {
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-300italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-400italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-500italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('./assets/fonts/poppins-v24-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/inter-v20-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fuentes de reserva con las medidas de Poppins (Agencia IA Solutions, 17-11-2026).
   Mientras llega Poppins, el texto se pinta con Arial (o Roboto en Android) ajustada al ancho y alto de Poppins,
   así el cambio de fuente no mueve la página (CLS). size-adjust calculado con fontTools sobre los .woff2 del tema. */
@font-face {
  font-family: 'Poppins Fallback';
  src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans'), local('Helvetica');
  size-adjust: 102%;
  ascent-override: 102.9%;
  descent-override: 34.3%;
  line-gap-override: 9.8%;
}

@font-face {
  font-family: 'Poppins Fallback Android';
  src: local('Roboto'), local('Roboto-Regular');
  size-adjust: 105.5%;
  ascent-override: 99.5%;
  descent-override: 33.2%;
  line-gap-override: 9.5%;
}

/* ==========================================================================
   2. VARIABLES CSS GLOBALES
   ========================================================================== */

:root {
  /* Colores */
  --cc-color-primary: #BFC312;
  --cc-color-secondary: #FFFFFF;
  --cc-color-text: #222222;
  --cc-color-accent: #8FAA3A;
  --cc-color-text-2: #7B7B7B;
  --cc-color-text-3: #979797;
  --cc-color-gray: #D9D9D9;
  --cc-color-tag: #FF6868;

  /* Tipografía */
  --cc-font-family: "Poppins", "Poppins Fallback", "Poppins Fallback Android", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cc-font-size-xs: 12px;
  --cc-font-size-s: 14px;
  --cc-font-size-button: 15px;
  --cc-font-size-base: 16px;
  --cc-font-size-h3: 26px;
  --cc-font-size-h2: 32px;
  --cc-font-size-h1: 48px;

  /* Contenedores y espaciados */
  --cc-container-width: 1140px;
  --cc-container-padding: 20px;
  --cc-widget-spacing: 20px;
  --cc-paragraph-spacing: 14.4px;

  /* Bordes y sombras */
  --cc-radius-button: 8px;
  --cc-radius-card: 16px;
  --cc-radius-container: 12px;
  --cc-shadow-card: 0px 0px 10px 0px #EBE1E1;
  --cc-shadow-floating: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   3. RESET Y ESTRUCTURA BASE
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--cc-font-family);
  color: var(--cc-color-text-2);
  background-color: var(--cc-color-secondary);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--cc-font-family);
  font-weight: 300;
  font-size: var(--cc-font-size-base);
  color: var(--cc-color-text-2);
  background-color: var(--cc-color-secondary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor central alineado con Elementor (1140px) */
.cc-container,
.site-main,
.wp-site-blocks > main {
  max-width: var(--cc-container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--cc-container-padding);
  padding-right: var(--cc-container-padding);
}

/* Elementos tipográficos */
h1:where(:not(.cc-entorno *)), h2:where(:not(.cc-entorno *)), h3:where(:not(.cc-entorno *)), h4:where(:not(.cc-entorno *)), h5:where(:not(.cc-entorno *)), h6:where(:not(.cc-entorno *)),
.wp-block-heading {
  font-family: var(--cc-font-family);
  margin-top: 0;
  margin-bottom: 0;
  letter-spacing: normal;
}

h1:where(:not(.cc-entorno *)), .h1, h1.wp-block-heading:where(:not(.cc-entorno *)), body h1:where(:not(.cc-entorno *)), .entry-content h1:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text);
  font-size: var(--cc-font-size-h1);
  font-weight: 600;
  line-height: 48px;
  text-transform: uppercase;
}

h2:where(:not(.cc-entorno *)), .h2, h2.wp-block-heading:where(:not(.cc-entorno *)), body h2:where(:not(.cc-entorno *)), .entry-content h2:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text);
  font-size: var(--cc-font-size-h2);
  font-weight: 500;
  line-height: 42px;
  text-transform: none;
}

h3:where(:not(.cc-entorno *)), .h3, h3.wp-block-heading:where(:not(.cc-entorno *)), body h3:where(:not(.cc-entorno *)), .entry-content h3:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text-2) !important;
  font-size: var(--cc-font-size-h3);
  font-weight: 300;
  line-height: 39px;
  letter-spacing: -0.3px;
  text-transform: none;
}

h4:where(:not(.cc-entorno *)), .h4, h4.wp-block-heading:where(:not(.cc-entorno *)), body h4:where(:not(.cc-entorno *)), .entry-content h4:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text-2) !important;
  font-size: var(--cc-font-size-base);
  font-weight: 500;
  line-height: 24px;
  text-transform: none;
}

h5:where(:not(.cc-entorno *)), .h5, h5.wp-block-heading:where(:not(.cc-entorno *)), body h5:where(:not(.cc-entorno *)), .entry-content h5:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text-2) !important;
  font-size: var(--cc-font-size-s);
  font-weight: 300;
  text-transform: none;
}

h6:where(:not(.cc-entorno *)), .h6, h6.wp-block-heading:where(:not(.cc-entorno *)), body h6:where(:not(.cc-entorno *)), .entry-content h6:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text-2) !important;
  font-size: var(--cc-font-size-base);
  font-weight: 300;
  text-transform: none;
}

p:where(:not(.cc-entorno *)), .wp-block-paragraph, body p:where(:not(.cc-entorno *)) {
  margin-top: 0;
  margin-bottom: var(--cc-paragraph-spacing);
  font-size: var(--cc-font-size-base);
  font-weight: 300;
  line-height: 24px;
  color: var(--cc-color-text-2);
}

ul:where(:not(.cc-entorno *)), ol:where(:not(.cc-entorno *)), .wp-block-list {
  margin-top: 0;
  margin-bottom: var(--cc-widget-spacing);
  padding-left: 24px;
  color: var(--cc-color-text-2);
}

li:where(:not(.cc-entorno *)), body li:where(:not(.cc-entorno *)) {
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 300;
  font-size: var(--cc-font-size-base);
  line-height: 24px;
  color: var(--cc-color-text-2);
}

a:where(:not(.cc-entorno *)) {
  color: var(--cc-color-text);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover:where(:not(.cc-entorno *)), a:focus:where(:not(.cc-entorno *)) {
  color: var(--cc-color-primary);
}

/* Enlaces editoriales dentro del texto: subrayados (excluyendo explícitamente cualquier botón) */
.entry-content p a:not(.wp-block-button__link):not(.wp-element-button):not(.cc-button):not([class*="button"]):where(:not(.cc-entorno *)),
.cc-content p a:not(.wp-block-button__link):not(.wp-element-button):not(.cc-button):not([class*="button"]):where(:not(.cc-entorno *)) {
  text-decoration: underline;
  font-weight: 500;
}

/* Botones estándar de marca (sin subrayado en ningún caso) */
button:where(:not(.cc-entorno *)),
input[type="button"]:where(:not(.cc-entorno *)),
input[type="submit"]:where(:not(.cc-entorno *)),
a.wp-block-button__link:where(:not(.cc-entorno *)),
.wp-block-button__link,
.wp-element-button,
.cc-button {
  display: inline-block;
  font-family: var(--cc-font-family);
  font-size: var(--cc-font-size-button) !important;
  font-weight: 500;
  line-height: 22px !important;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none !important;
  background-color: var(--cc-color-primary);
  color: var(--cc-color-secondary) !important;
  border: none;
  border-radius: var(--cc-radius-button);
  padding: 4px 9px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover:where(:not(.cc-entorno *)),
input[type="button"]:hover:where(:not(.cc-entorno *)),
input[type="submit"]:hover:where(:not(.cc-entorno *)),
.wp-block-button__link:hover,
.wp-element-button:hover,
.cc-button:hover {
  background-color: var(--cc-color-accent);
  color: var(--cc-color-secondary) !important;
  text-decoration: none !important;
}

button:focus:where(:not(.cc-entorno *)),
button:active:where(:not(.cc-entorno *)),
.wp-block-button__link:focus,
.wp-block-button__link:active,
.wp-element-button:focus,
.wp-element-button:active {
  outline: 2px solid #000000;
  outline-offset: 2px;
  text-decoration: none !important;
}

/* Estilo outline para botones secundarios */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline .wp-element-button {
  background-color: transparent;
  color: var(--cc-color-primary) !important;
  border: 1px solid var(--cc-color-primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-element-button:hover {
  background-color: var(--cc-color-primary);
  color: var(--cc-color-secondary) !important;
}

/* Tarjeta estándar de marca */
.cc-card,
.wp-block-group.is-style-card {
  background-color: var(--cc-color-secondary);
  border-radius: var(--cc-radius-card);
  box-shadow: var(--cc-shadow-card);
  padding: 24px;
  margin-bottom: var(--cc-widget-spacing);
}

/* ==========================================================================
   4. BREAKPOINTS RESPONSIVOS (ELEMENTOR ALIGNMENT)
   Mobile: max-width 767px | Tablet: max-width 1024px
   ========================================================================== */

@media (max-width: 1024px) {
  :root {
    --cc-container-width: 1024px;
  }
}

@media (max-width: 767px) {
  :root {
    --cc-container-width: 767px;
    --cc-container-padding: 16px;
    --cc-font-size-h1: 40px;
    --cc-font-size-h2: 28px;
    --cc-font-size-h3: 21px;
    --cc-font-size-button: 18px;
  }

  h1:where(:not(.cc-entorno *)), .h1, h1.wp-block-heading:where(:not(.cc-entorno *)), body h1:where(:not(.cc-entorno *)), .entry-content h1:where(:not(.cc-entorno *)) {
    font-size: 40px !important;
    line-height: 48px !important;
  }

  h2:where(:not(.cc-entorno *)), .h2, h2.wp-block-heading:where(:not(.cc-entorno *)), body h2:where(:not(.cc-entorno *)), .entry-content h2:where(:not(.cc-entorno *)) {
    font-size: 28px !important;
    line-height: 36.4px !important;
  }

  h3:where(:not(.cc-entorno *)), .h3, h3.wp-block-heading:where(:not(.cc-entorno *)), body h3:where(:not(.cc-entorno *)), .entry-content h3:where(:not(.cc-entorno *)) {
    font-size: 21px !important;
    line-height: 39px !important;
    letter-spacing: -0.3px;
  }

  h4:where(:not(.cc-entorno *)), .h4, h4.wp-block-heading:where(:not(.cc-entorno *)), body h4:where(:not(.cc-entorno *)), .entry-content h4:where(:not(.cc-entorno *)) {
    font-size: 16px !important;
    line-height: 24px !important;
  }

  button:where(:not(.cc-entorno *)),
  input[type="button"]:where(:not(.cc-entorno *)),
  input[type="submit"]:where(:not(.cc-entorno *)),
  a.wp-block-button__link:where(:not(.cc-entorno *)),
  .wp-block-button__link,
  .wp-element-button,
  .cc-button {
    font-size: 18px !important;
    line-height: 22px !important;
  }
}

/* ==========================================================================
   SECCIONES DE CORTICOLORS-CORE A ANCHO COMPLETO
   Las secciones (P01-P23...) traen su propio contenedor (1120 px, igual que
   Elementor), así que se liberan del ancho y padding del contenedor de página.
   ========================================================================== */
body {
  overflow-x: clip;
}

/* En Elementor las secciones van dentro de un contenedor flex y sus márgenes no se
   colapsan (60 px abajo + 80 px arriba = 140 px). Para que pase lo mismo, el contenido
   de una página hecha con secciones se apila en columna flex. Las entradas de blog sin
   secciones siguen con el flujo normal. */
.entry-content.cc-content:has(> section[class^="cc-"]) {
  display: flex;
  flex-direction: column;
}

.site-main section[class^="cc-"] {
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Banner de Cookiebot: el estilo general de los botones del tema (color con !important) dejaba en blanco el texto de «Denegar» y «Permitir la selección» (17-11-2026). */
#CybotCookiebotDialog button.CybotCookiebotDialogBodyButton:not(#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll) {
  color: #1d1d1b !important;
  background-color: #fff !important;
}
#CybotCookiebotDialog button#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
  color: #fff !important;
}

/* Icono de Cookiebot (Jorge, 17-11-2026): abajo a la izquierda tapaba la barra de compra de la ficha en móvil.
   Va a la derecha, encima de los botones flotantes de llamada y WhatsApp (footer.css), centrado con ellos,
   y sube con ellos cuando aparece la barra de la ficha (ficha-barra.css). */
#CookiebotWidget {
  left: auto !important;
  right: 33px !important;
  bottom: 159px !important;
  transition: transform .28s ease;
}
body:has(.cc-floating-btn-wrap.is-cerrado) #CookiebotWidget { bottom: 95px !important; }
body.cc-barra-on #CookiebotWidget { transform: translateY(calc(-1 * var(--cc-barra-h, 80px))); }
@media (max-width: 767px) {
  #CookiebotWidget {
    right: calc(18px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(154px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:has(.cc-floating-btn-wrap.is-cerrado) #CookiebotWidget { bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
  body.cc-barra-on #CookiebotWidget { transform: translateY(calc(-1 * var(--cc-barra-h, 84px) - 14px)); }
}
