/**
 * LOPDP Manager Ecuador — Estilos públicos.
 * Banner de cookies, formulario ARCO+, política de privacidad.
 *
 * @package LOPDP_Manager
 * @since   1.0.0
 */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
	--lopdp-radius:   6px;
	--lopdp-shadow:   0 4px 24px rgba(0,0,0,.18);
	--lopdp-trans:    .25s ease;
	--lopdp-z-banner: 999999;
}

/* ── Banner de cookies ──────────────────────────────────────────────────────── */
.lopdp-banner {
	position: fixed;
	left:    0;
	right:   0;
	z-index: var(--lopdp-z-banner);
	box-shadow: var(--lopdp-shadow);
	transition: transform var(--lopdp-trans), opacity var(--lopdp-trans);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
}

.lopdp-banner--bottom { bottom: 0; }
.lopdp-banner--top    { top: 0; }

.lopdp-banner--hiding {
	opacity: 0;
	transform: translateY(20px);
	pointer-events: none;
}
.lopdp-banner--top.lopdp-banner--hiding {
	transform: translateY(-20px);
}

.lopdp-banner__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 24px;
	flex-wrap: wrap;
	max-width: 1200px;
	margin: 0 auto;
}

.lopdp-banner__text {
	flex: 1;
	min-width: 240px;
	line-height: 1.5;
}

.lopdp-banner__text a {
	color: inherit;
	text-decoration: underline;
	margin-left: 6px;
}

.lopdp-banner__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* ── Panel de preferencias ──────────────────────────────────────────────────── */
.lopdp-preferences {
	border-top: 1px solid rgba(255,255,255,.15);
}

.lopdp-preferences__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 24px 20px;
}

.lopdp-preferences__inner h3 {
	margin: 0 0 12px;
	font-size: 15px;
	color: inherit;
}

.lopdp-categories {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.lopdp-category {
	background: rgba(255,255,255,.07);
	border: 1px solid rgba(255,255,255,.15);
	border-radius: var(--lopdp-radius);
	padding: 12px;
}

.lopdp-category__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.lopdp-category__header strong {
	flex: 1;
	font-size: 13px;
}

.lopdp-category__desc {
	margin: 0;
	font-size: 12px;
	opacity: .75;
	line-height: 1.5;
}

.lopdp-badge {
	font-size: 10px;
	background: rgba(255,255,255,.2);
	padding: 2px 6px;
	border-radius: 3px;
	white-space: nowrap;
}

.lopdp-preferences__actions {
	margin-top: 16px;
}

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.lopdp-toggle {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
}

.lopdp-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.lopdp-toggle__slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: rgba(255,255,255,.25);
	border-radius: 20px;
	transition: background var(--lopdp-trans);
}

.lopdp-toggle__slider::before {
	content: '';
	position: absolute;
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform var(--lopdp-trans);
}

.lopdp-toggle input:checked + .lopdp-toggle__slider {
	background: #22c55e;
}

.lopdp-toggle input:checked + .lopdp-toggle__slider::before {
	transform: translateX(16px);
}

.lopdp-toggle input:disabled + .lopdp-toggle__slider {
	opacity: .5;
	cursor: not-allowed;
}

/* ── Botones ────────────────────────────────────────────────────────────────── */
.lopdp-btn {
	display: inline-block;
	padding: 8px 18px;
	border-radius: var(--lopdp-radius);
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: opacity var(--lopdp-trans), transform var(--lopdp-trans);
	white-space: nowrap;
	text-decoration: none;
}

.lopdp-btn:hover  { opacity: .85; }
.lopdp-btn:active { transform: scale(.97); }

.lopdp-btn--primary {
	color: #fff;
}

.lopdp-btn--secondary {
	background: rgba(255,255,255,.15);
	color: inherit;
	border: 1px solid rgba(255,255,255,.35);
}

.lopdp-btn--link {
	background: transparent;
	color: inherit;
	opacity: .7;
	font-weight: 400;
	padding: 8px 6px;
}

.lopdp-btn--submit {
	padding: 12px 32px;
	font-size: 16px;
}

.lopdp-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
}

/* ── Formulario ARCO+ ───────────────────────────────────────────────────────── */
.lopdp-arco-wrapper {
	max-width: 680px;
	margin: 0 auto;
}

.lopdp-form__title {
	font-size: 22px;
	margin-bottom: 8px;
}

.lopdp-form__intro {
	color: #555;
	margin-bottom: 24px;
	line-height: 1.7;
}

.lopdp-field {
	margin-bottom: 18px;
}

.lopdp-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 14px;
}

.lopdp-field input[type="text"],
.lopdp-field input[type="email"],
.lopdp-field input[type="tel"],
.lopdp-field select,
.lopdp-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: var(--lopdp-radius);
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
	transition: border-color var(--lopdp-trans), box-shadow var(--lopdp-trans);
	font-family: inherit;
}

.lopdp-field input:focus,
.lopdp-field select:focus,
.lopdp-field textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}

.lopdp-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 540px) {
	.lopdp-field-row { grid-template-columns: 1fr; }
}

.lopdp-field--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.5;
}

.lopdp-field--checkbox input[type="checkbox"] {
	margin-top: 3px;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.lopdp-form__footer {
	margin-top: 24px;
}

.lopdp-form__note {
	margin-top: 12px;
	font-size: 13px;
	color: #666;
}

/* ── Errores de campo ────────────────────────────────────────────────────────── */
.lopdp-field-error {
	display: block;
	color: #d63638;
	font-size: 13px;
	margin-top: 4px;
}

.lopdp-field input:invalid,
.lopdp-field select:invalid {
	border-color: #d63638;
}

/* ── Mensajes de respuesta ──────────────────────────────────────────────────── */
.lopdp-success {
	background: #edfaef;
	border: 1px solid #00a32a;
	border-left: 4px solid #00a32a;
	border-radius: var(--lopdp-radius);
	padding: 16px 20px;
	margin-bottom: 16px;
	color: #1e4620;
}

.lopdp-success strong {
	display: block;
	font-size: 16px;
	margin-bottom: 8px;
}

.lopdp-error {
	background: #fdf2f2;
	border: 1px solid #d63638;
	border-left: 4px solid #d63638;
	border-radius: var(--lopdp-radius);
	padding: 16px 20px;
	margin-bottom: 16px;
	color: #5a1010;
}

/* ── Política de privacidad ─────────────────────────────────────────────────── */
.lopdp-privacy-policy h2 {
	margin-top: 32px;
	font-size: 20px;
	border-bottom: 2px solid #f0f0f0;
	padding-bottom: 8px;
}

.lopdp-privacy-policy h2:first-of-type {
	margin-top: 16px;
}

.lopdp-privacy-policy ul {
	padding-left: 20px;
}

.lopdp-privacy-policy li {
	margin-bottom: 8px;
}

.lopdp-privacy-policy a {
	color: #0073aa;
}

/* ── Política de privacidad — Secciones y tablas (v1.2.0) ───────────────────── */

.lopdp-policy-section {
	margin-bottom: 40px;
}

.lopdp-policy-section h2 {
	font-size: 1.35em;
	font-weight: 700;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e8eaed;
	color: #1d2327;
}

.lopdp-policy-section h3 {
	font-size: 1.1em;
	font-weight: 600;
	margin: 24px 0 10px;
	color: #2c3338;
}

.lopdp-policy-section p {
	line-height: 1.75;
	margin-bottom: 14px;
	color: #3c434a;
}

.lopdp-policy-section ul {
	padding-left: 22px;
	margin-bottom: 16px;
}

.lopdp-policy-section li {
	margin-bottom: 8px;
	line-height: 1.65;
	color: #3c434a;
}

.lopdp-policy-section a {
	color: #0073aa;
	text-decoration: underline;
}

.lopdp-policy-section a:hover {
	color: #005177;
}

/* Tabla de política de privacidad */
.lopdp-policy-table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0 20px;
	font-size: 0.95em;
	overflow-x: auto;
	display: block;
}

.lopdp-policy-table thead {
	background-color: #1b4f8a;
	color: #fff;
}

.lopdp-policy-table thead th {
	padding: 10px 14px;
	text-align: left;
	font-weight: 600;
	white-space: nowrap;
	border: 1px solid #15407a;
}

.lopdp-policy-table tbody tr:nth-child(odd) {
	background-color: #f9f9f9;
}

.lopdp-policy-table tbody tr:nth-child(even) {
	background-color: #ffffff;
}

.lopdp-policy-table tbody td {
	padding: 9px 14px;
	border: 1px solid #e0e0e0;
	vertical-align: top;
	line-height: 1.6;
}

.lopdp-policy-table tbody tr:hover {
	background-color: #f0f6fc;
}

/* Fecha de actualización */
.lopdp-policy-updated {
	font-size: 0.88em;
	color: #8c8f94;
	margin-bottom: 32px;
	padding: 8px 14px;
	background: #f6f7f7;
	border-radius: 4px;
	border-left: 3px solid #c3c4c7;
}

/* Responsive: tablas */
@media (max-width: 640px) {
	.lopdp-policy-table {
		font-size: 0.88em;
	}
	.lopdp-policy-table thead th,
	.lopdp-policy-table tbody td {
		padding: 7px 10px;
	}
}
