/*
Theme Name:   Central de Desguaces Ads
Theme URI:    https://www.centraldedesguaces.net
Description:  Tema hijo de Divi para las landings de campanas de Google Ads. Paleta corporativa RO-DES.
Author:       Central de Desguaces
Author URI:   https://www.ro-des.com/
Template:     Divi
Version:      1.1.0
Requires PHP: 8.0
Text Domain:  cdnet-ads
*/

/* =========================================================
   1. PALETA CORPORATIVA RO-DES
   Verde y gris son los corporativos. El resto son derivados
   calculados para cumplir contraste WCAG AA.
   ========================================================= */
:root {
	/* Corporativos */
	--cdnet-verde: #9ed92d;
	--cdnet-gris: #929292;

	/* Derivados del verde */
	--cdnet-verde-hover: #b0e34d;    /* mas claro, para hover */
	--cdnet-verde-fondo: #eef8d6;    /* fondo suave de secciones */
	--cdnet-verde-profundo: #4f7114; /* unico verde que admite texto blanco (5.7:1) */

	/* Textos */
	--cdnet-texto: #2f2f2f;          /* 7.9:1 sobre verde, 12.6:1 sobre blanco */
	--cdnet-texto-suave: #4a4a4a;    /* 8.9:1 sobre blanco */

	/* Neutros */
	--cdnet-borde: #e2e2e2;
	--cdnet-fondo-alt: #f5f5f5;

	--cdnet-radio: 8px;
	--cdnet-ancho-max: 1140px;
}

/* =========================================================
   REGLA DE ORO DEL CONTRASTE

   El verde #9ed92d es muy luminoso: con texto blanco da 1.7:1,
   ilegible (WCAG AA exige 4.5:1). Por eso:

     - Fondo verde   -> SIEMPRE texto --cdnet-texto (7.9:1)
     - Texto blanco  -> SOLO sobre --cdnet-verde-profundo (5.7:1)
                        o sobre foto con velo oscuro
     - Gris #929292  -> bordes, iconos y titulares grandes.
                        Como texto normal sobre blanco da 3.1:1: no vale.
   ========================================================= */

/* =========================================================
   2. BASE
   ========================================================= */
body {
	-webkit-font-smoothing: antialiased;
}

/* =========================================================
   3. HERO
   ========================================================= */

/* 3a. Hero sobre foto: velo oscuro para que el texto blanco se lea.
   Divi: pon la imagen como fondo de la seccion y anade esta clase. */
.cdnet-hero {
	position: relative;
	text-align: center;
}

.cdnet-hero:before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	pointer-events: none;
}

.cdnet-hero > * {
	position: relative;
	z-index: 1;
}

.cdnet-hero h1,
.cdnet-hero h2,
.cdnet-hero p {
	color: #fff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.cdnet-hero h1 {
	font-size: clamp(2rem, 5vw, 3.4rem);
	line-height: 1.1;
	font-weight: 800;
}

/* 3b. Hero verde plano, sin foto. Texto oscuro obligatorio. */
.cdnet-hero--verde {
	background: var(--cdnet-verde);
}

.cdnet-hero--verde:before {
	display: none;
}

.cdnet-hero--verde h1,
.cdnet-hero--verde h2,
.cdnet-hero--verde p {
	color: var(--cdnet-texto);
	text-shadow: none;
}

/* =========================================================
   4. LLAMADAS A LA ACCION
   Divi: modulo Boton > pestana Avanzado > Clase CSS
   ========================================================= */
.cdnet-cta,
.cdnet-cta:visited,
a.cdnet-cta.et_pb_button {
	display: inline-block;
	background: var(--cdnet-verde) !important;
	color: var(--cdnet-texto) !important;
	font-weight: 700;
	padding: 16px 34px !important;
	border: none !important;
	border-radius: var(--cdnet-radio) !important;
	text-decoration: none;
	line-height: 1;
	transition: background .15s ease, transform .15s ease;
}

.cdnet-cta:hover,
.cdnet-cta:focus,
a.cdnet-cta.et_pb_button:hover {
	background: var(--cdnet-verde-hover) !important;
	color: var(--cdnet-texto) !important;
	transform: translateY(-2px);
}

/* Divi anade una flecha en el hover de sus botones. La quitamos. */
a.cdnet-cta.et_pb_button:after {
	display: none !important;
}

/* Variante oscura: la unica que admite texto blanco.
   Usala sobre fondos verdes o claros, donde el verde vivo no destacaria. */
.cdnet-cta--oscura,
.cdnet-cta--oscura:visited,
a.cdnet-cta--oscura.et_pb_button {
	background: var(--cdnet-verde-profundo) !important;
	color: #fff !important;
}

.cdnet-cta--oscura:hover,
a.cdnet-cta--oscura.et_pb_button:hover {
	background: #456310 !important;
	color: #fff !important;
}

/* Variante contorno, para CTA secundarias */
.cdnet-cta--linea,
.cdnet-cta--linea:visited,
a.cdnet-cta--linea.et_pb_button {
	background: transparent !important;
	color: var(--cdnet-texto) !important;
	border: 2px solid var(--cdnet-verde) !important;
}

.cdnet-cta--linea:hover,
a.cdnet-cta--linea.et_pb_button:hover {
	background: var(--cdnet-verde) !important;
}

/* =========================================================
   5. BOTONES FLOTANTES DE CONTACTO
   Mismo patron que ro-des.com: telefono y WhatsApp fijos.
   ========================================================= */
.cdnet-flotantes {
	position: fixed;
	left: 14px;
	bottom: 90px;
	z-index: 99998;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cdnet-flotante {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
	transition: transform .15s ease;
}

.cdnet-flotante:hover {
	transform: scale(1.08);
	color: #fff;
}

.cdnet-flotante svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

.cdnet-flotante--tel { background: var(--cdnet-verde-profundo); }
.cdnet-flotante--wa  { background: #25d366; }

/* =========================================================
   6. BARRA FIJA DE LLAMADA EN MOVIL
   Se activa en paginas con la clase cdnet-landing.
   980px es el breakpoint al que Divi cambia a menu movil.
   ========================================================= */
.cdnet-cta-movil {
	display: none;
}

@media (max-width: 980px) {
	.cdnet-cta-movil {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99999;
		background: var(--cdnet-verde);
		color: var(--cdnet-texto);
		text-align: center;
		padding: 16px;
		font-weight: 700;
		font-size: 1.05rem;
		text-decoration: none;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, .18);
	}

	.cdnet-cta-movil:hover {
		color: var(--cdnet-texto);
	}

	body.cdnet-con-barra-movil #page-container {
		padding-bottom: 64px;
	}

	.cdnet-flotantes {
		bottom: 78px;
	}
}

/* =========================================================
   7. SECCIONES Y REJILLA DE VENTAJAS
   ========================================================= */
.cdnet-seccion--alt {
	background: var(--cdnet-fondo-alt);
}

.cdnet-seccion--verde {
	background: var(--cdnet-verde-fondo);
}

.cdnet-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	max-width: var(--cdnet-ancho-max);
	margin: 0 auto;
}

.cdnet-card {
	background: #fff;
	border: 1px solid var(--cdnet-borde);
	border-top: 4px solid var(--cdnet-verde);
	border-radius: var(--cdnet-radio);
	padding: 26px 24px;
}

.cdnet-card h3 {
	margin-top: 0;
	font-size: 1.125rem;
	color: var(--cdnet-texto);
	text-transform: uppercase;
	letter-spacing: .02em;
}

.cdnet-card p {
	color: var(--cdnet-texto-suave);
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Variante con fondo verde suave, al estilo de ro-des.com */
.cdnet-card--verde {
	background: var(--cdnet-verde-fondo);
	border-color: transparent;
	border-top-color: var(--cdnet-verde);
}

/* =========================================================
   8. FORMULARIO DE CAPTACION
   Compatible con el modulo de Divi, WPForms y Contact Form 7.
   ========================================================= */
.cdnet-form {
	max-width: 520px;
	margin: 0 auto;
	background: #fff;
	border-radius: var(--cdnet-radio);
	padding: 28px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

.cdnet-form input[type="text"],
.cdnet-form input[type="tel"],
.cdnet-form input[type="email"],
.cdnet-form textarea,
.cdnet-form select,
.cdnet-form .et_pb_contact_field input,
.cdnet-form .et_pb_contact_field textarea {
	width: 100%;
	margin-bottom: 14px;
	border: 1px solid var(--cdnet-borde);
	border-radius: var(--cdnet-radio);
}

.cdnet-form input:focus,
.cdnet-form textarea:focus,
.cdnet-form select:focus {
	outline: 2px solid var(--cdnet-verde-profundo);
	outline-offset: 1px;
}

.cdnet-form button,
.cdnet-form input[type="submit"],
.cdnet-form .et_pb_contact_submit {
	width: 100%;
	background: var(--cdnet-verde) !important;
	color: var(--cdnet-texto) !important;
	border: none !important;
	border-radius: var(--cdnet-radio) !important;
	padding: 15px !important;
	font-weight: 700;
}

.cdnet-form .et_pb_contact_submit:after {
	display: none !important;
}

/* =========================================================
   9. LANDINGS SIN DISTRACCIONES
   Escribe "cdnet-landing" en el campo "Clase CSS del body"
   de la caja lateral del editor de la pagina.
   ========================================================= */
.cdnet-landing #top-header,
.cdnet-landing #main-header,
.cdnet-landing #main-footer,
.cdnet-landing #et-secondary-nav,
.cdnet-landing .et_slide_in_menu_container {
	display: none !important;
}

/* Divi inyecta padding-top en linea para compensar la cabecera fija. */
.cdnet-landing #page-container {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

.cdnet-landing #main-content {
	padding-top: 0;
}

/* =========================================================
   10. UTILIDADES
   ========================================================= */
.cdnet-centrado { text-align: center; }
.cdnet-sin-margen { margin: 0; }

.cdnet-texto-verde { color: var(--cdnet-verde-profundo); }
.cdnet-texto-gris  { color: var(--cdnet-texto-suave); }

/* Separador decorativo. Aqui si vale el gris corporativo: al no ser texto,
   no le aplican los minimos de contraste. */
.cdnet-separador {
	width: 64px;
	height: 3px;
	border: 0;
	margin: 0 auto 22px;
	background: var(--cdnet-gris);
}

.cdnet-separador--verde {
	background: var(--cdnet-verde);
}

/* Iconos decorativos dentro de las tarjetas */
.cdnet-card svg,
.cdnet-card .et-pb-icon {
	color: var(--cdnet-gris);
	fill: currentColor;
}

.cdnet-oculto-visual {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media print {
	.cdnet-cta-movil,
	.cdnet-flotantes { display: none !important; }
}
