/**
 * Estilos Frontend: Banner de Cookies & RGPD - WP Agency Toolkit
 */

:root {
	--wpat-cookie-bg: #1e293b;
	--wpat-cookie-text: #f8fafc;
	--wpat-cookie-btn-accept-bg: #2563eb;
	--wpat-cookie-btn-accept-text: #ffffff;
	--wpat-cookie-btn-reject-bg: #475569;
	--wpat-cookie-btn-reject-text: #ffffff;
	--wpat-cookie-btn-settings-bg: transparent;
	--wpat-cookie-btn-settings-text: #94a3b8;
	--wpat-cookie-btn-settings-border: #64748b;
}

/* Contenedor del Banner Principal */
#wpat_cookie_banner {
	position: fixed;
	z-index: 9999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-sizing: border-box;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
	opacity: 0;
	pointer-events: none;
}

#wpat_cookie_banner * {
	box-sizing: border-box;
}

#wpat_cookie_banner.wpat-visible {
	opacity: 1;
	pointer-events: auto;
}

/* Formatos de Banner */
/* 1. Barra Inferior */
#wpat_cookie_banner.layout-bar {
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	background: var(--wpat-cookie-bg);
	color: var(--wpat-cookie-text);
	padding: 18px 24px;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	transform: translateY(100%);
}

#wpat_cookie_banner.layout-bar.wpat-visible {
	transform: translateY(0);
}

#wpat_cookie_banner.layout-bar .wpat-cookie-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

/* 2. Tarjeta Flotante (Box Esquina) */
#wpat_cookie_banner.layout-box-bottom-left,
#wpat_cookie_banner.layout-box-bottom-right {
	bottom: 24px;
	max-width: 440px;
	width: calc(100% - 32px);
	background: var(--wpat-cookie-bg);
	color: var(--wpat-cookie-text);
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	transform: translateY(30px);
}

#wpat_cookie_banner.layout-box-bottom-left {
	left: 20px;
}

#wpat_cookie_banner.layout-box-bottom-right {
	right: 20px;
}

#wpat_cookie_banner.layout-box-bottom-left.wpat-visible,
#wpat_cookie_banner.layout-box-bottom-right.wpat-visible {
	transform: translateY(0);
}

/* 3. Modal Centrado */
#wpat_cookie_banner.layout-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -40%);
	max-width: 540px;
	width: calc(100% - 32px);
	background: var(--wpat-cookie-bg);
	color: var(--wpat-cookie-text);
	padding: 28px;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#wpat_cookie_banner.layout-modal.wpat-visible {
	transform: translate(-50%, -50%);
}

#wpat_cookie_backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(3px);
	z-index: 9999998;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

#wpat_cookie_backdrop.wpat-visible {
	opacity: 1;
	pointer-events: auto;
}

/* Contenido del Texto del Banner */
.wpat-cookie-content {
	flex: 1;
	min-width: 260px;
}

.wpat-cookie-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: inherit;
	line-height: 1.3;
}

.wpat-cookie-text {
	font-size: 13.5px;
	line-height: 1.5;
	margin: 0;
	opacity: 0.9;
}

.wpat-cookie-text a {
	color: var(--wpat-cookie-btn-accept-bg);
	text-decoration: underline;
}

/* Botones de Acción del Banner */
.wpat-cookie-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.wpat-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	padding: 10px 18px;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease-in-out;
	line-height: 1.2;
}

.wpat-cookie-btn-accept {
	background: var(--wpat-cookie-btn-accept-bg);
	color: var(--wpat-cookie-btn-accept-text);
	border-color: var(--wpat-cookie-btn-accept-bg);
}

.wpat-cookie-btn-accept:hover {
	filter: brightness(1.1);
}

.wpat-cookie-btn-reject {
	background: var(--wpat-cookie-btn-reject-bg);
	color: var(--wpat-cookie-btn-reject-text);
	border-color: var(--wpat-cookie-btn-reject-bg);
}

.wpat-cookie-btn-reject:hover {
	filter: brightness(1.1);
}

.wpat-cookie-btn-settings {
	background: var(--wpat-cookie-btn-settings-bg);
	color: var(--wpat-cookie-btn-settings-text);
	border: 1px solid var(--wpat-cookie-btn-settings-border);
}

.wpat-cookie-btn-settings:hover {
	color: #ffffff;
	border-color: #ffffff;
}

/* Modal de Preferencias y Categorías */
#wpat_cookie_modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999999;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	padding: 16px;
	box-sizing: border-box;
}

#wpat_cookie_modal * {
	box-sizing: border-box;
}

#wpat_cookie_modal.wpat-visible {
	opacity: 1;
	pointer-events: auto;
}

.wpat-cookie-modal-dialog {
	background: #ffffff;
	color: #0f172a;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	border-radius: 14px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wpat-cookie-modal-header {
	padding: 20px 24px;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.wpat-cookie-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	color: #0f172a;
}

.wpat-cookie-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: #64748b;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

.wpat-cookie-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
}

.wpat-cookie-cat-item {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 14px;
}

.wpat-cookie-cat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.wpat-cookie-cat-title {
	font-weight: 700;
	font-size: 14.5px;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpat-cookie-cat-desc {
	font-size: 12.5px;
	color: #64748b;
	line-height: 1.5;
	margin: 0;
}

/* Switch de Categorías */
.wpat-cookie-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

.wpat-cookie-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.wpat-cookie-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .2s;
	border-radius: 24px;
}

.wpat-cookie-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .2s;
	border-radius: 50%;
}

.wpat-cookie-switch input:checked + .wpat-cookie-slider {
	background-color: #2563eb;
}

.wpat-cookie-switch input:checked + .wpat-cookie-slider:before {
	transform: translateX(20px);
}

.wpat-cookie-switch input:disabled + .wpat-cookie-slider {
	background-color: #94a3b8;
	cursor: not-allowed;
	opacity: 0.7;
}

.wpat-cookie-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	background: #f8fafc;
}

/* Enlaces Legales en Banner y Modal */
.wpat-cookie-legal-links-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 12px;
	margin-top: 6px;
	opacity: 0.9;
}

.wpat-cookie-legal-link {
	color: var(--wpat-cookie-text) !important;
	text-decoration: underline !important;
	transition: opacity 0.15s ease;
}

.wpat-cookie-legal-link:hover {
	opacity: 0.75;
}

.wpat-cookie-links-sep {
	color: var(--wpat-cookie-text);
	opacity: 0.5;
}

.wpat-cookie-modal-links a {
	color: #2563eb;
	text-decoration: underline;
}

/* Botón Flotante para Revocar Consentimiento */
#wpat_cookie_revoke_badge {
	position: fixed;
	z-index: 9999990;
	background: #1e293b;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.15);
	padding: 7px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s ease;
	font-family: inherit;
}

#wpat_cookie_revoke_badge.bottom-left {
	bottom: 18px;
	left: 18px;
}

#wpat_cookie_revoke_badge.bottom-right {
	bottom: 18px;
	right: 18px;
}

#wpat_cookie_revoke_badge:hover {
	transform: scale(1.05);
	background: #0f172a;
}

/* Tabla de Cookies (para Shortcode en Política de Cookies) */
.wpat-cookie-table-wrapper {
	overflow-x: auto;
	margin: 20px 0;
}

.wpat-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	line-height: 1.5;
	border: 1px solid #e2e8f0;
}

.wpat-cookie-table th {
	background: #f1f5f9;
	color: #1e293b;
	font-weight: 700;
	padding: 12px 14px;
	text-align: left;
	border-bottom: 2px solid #cbd5e1;
}

.wpat-cookie-table td {
	padding: 10px 14px;
	border-bottom: 1px solid #e2e8f0;
	color: #334155;
}

.wpat-cookie-table tr:nth-child(even) td {
	background: #f8fafc;
}

.wpat-cookie-badge-cat {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 12px;
	display: inline-block;
}

.wpat-cookie-badge-cat.necessary { background: #eff6ff; color: #1d4ed8; }
.wpat-cookie-badge-cat.analytics { background: #ecfdf5; color: #047857; }
.wpat-cookie-badge-cat.marketing { background: #fef2f2; color: #b91c1c; }
.wpat-cookie-badge-cat.preferences { background: #faf5ff; color: #7e22ce; }
