/**
 * 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;
}

/* Botón de cierre en el Banner Principal y Modal (con aislamiento total contra temas) */
#wpat_cookie_banner .wpat-cookie-banner-close,
#wpat_cookie_modal .wpat-cookie-modal-close {
	all: unset;
	box-sizing: border-box !important;
	position: absolute !important;
	top: 14px !important;
	right: 14px !important;
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	max-width: 28px !important;
	max-height: 28px !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 6px !important;
	color: #94a3b8 !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	box-shadow: none !important;
	outline: none !important;
	transition: all 0.15s ease !important;
	z-index: 10 !important;
}

#wpat_cookie_banner .wpat-cookie-banner-close:hover,
#wpat_cookie_modal .wpat-cookie-modal-close:hover {
	color: #0f172a !important;
	background: #f1f5f9 !important;
	background-color: #f1f5f9 !important;
}

#wpat_cookie_banner .wpat-cookie-banner-close svg,
#wpat_cookie_modal .wpat-cookie-modal-close svg {
	width: 16px !important;
	height: 16px !important;
	stroke: currentColor !important;
	display: block !important;
}

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

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

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

#wpat_cookie_banner.layout-bar .wpat-cookie-banner-close {
	display: none !important;
}

#wpat_cookie_banner.layout-bar .wpat-cookie-content {
	flex: 1 !important;
	min-width: 260px !important;
}

#wpat_cookie_banner.layout-bar .wpat-cookie-title {
	font-size: 15px !important;
	font-weight: 700 !important;
	margin: 0 0 4px 0 !important;
	line-height: 1.3 !important;
}

#wpat_cookie_banner.layout-bar .wpat-cookie-text {
	font-size: 12.5px !important;
	line-height: 1.45 !important;
	margin: 0 !important;
	opacity: 0.95 !important;
}

#wpat_cookie_banner.layout-bar .wpat-cookie-actions {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	flex-wrap: wrap !important;
}

#wpat_cookie_banner.layout-bar .wpat-cookie-legal-links-wrap {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	margin-top: 4px !important;
	font-size: 11.5px !important;
}

/* 2. Formato: Tarjeta Flotante (Layout Floating / Box Bottom-Left / Box Bottom-Right) */
#wpat_cookie_banner.layout-floating,
#wpat_cookie_banner.layout-floating.bottom-left,
#wpat_cookie_banner.layout-box-bottom-left {
	position: fixed !important;
	bottom: 24px !important;
	left: 24px !important;
	right: auto !important;
	top: auto !important;
	width: calc(100% - 32px) !important;
	max-width: 480px !important;
	background: #ffffff !important;
	color: #1e293b !important;
	padding: 24px 22px 18px !important;
	border-radius: 12px !important;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
	border: 1px solid #e2e8f0 !important;
	transform: translateY(30px) !important;
}

#wpat_cookie_banner.layout-floating.bottom-right,
#wpat_cookie_banner.layout-box-bottom-right {
	position: fixed !important;
	bottom: 24px !important;
	right: 24px !important;
	left: auto !important;
	top: auto !important;
	width: calc(100% - 32px) !important;
	max-width: 480px !important;
	background: #ffffff !important;
	color: #1e293b !important;
	padding: 24px 22px 18px !important;
	border-radius: 12px !important;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
	border: 1px solid #e2e8f0 !important;
	transform: translateY(30px) !important;
}

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

/* 3. Formato: Modal Centrado (Layout Modal) */
#wpat_cookie_banner.layout-modal {
	position: fixed !important;
	top: 50% !important;
	left: 50% !important;
	bottom: auto !important;
	right: auto !important;
	transform: translate(-50%, -45%) !important;
	width: calc(100% - 32px) !important;
	max-width: 500px !important;
	background: #ffffff !important;
	color: #1e293b !important;
	padding: 24px 22px 18px !important;
	border-radius: 12px !important;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28) !important;
	border: 1px solid #e2e8f0 !important;
}

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

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

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

/* Estilos de Contenido para Tarjeta Flotante y Modal Centrado */
#wpat_cookie_banner.layout-floating .wpat-cookie-title,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-title,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-title,
#wpat_cookie_banner.layout-modal .wpat-cookie-title {
	font-size: 16px !important;
	font-weight: 700 !important;
	margin: 0 0 12px 0 !important;
	color: #0f172a !important;
	line-height: 1.3 !important;
	text-align: center !important;
}

#wpat_cookie_banner.layout-floating .wpat-cookie-text,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-text,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-text,
#wpat_cookie_banner.layout-modal .wpat-cookie-text {
	font-size: 12px !important;
	line-height: 1.55 !important;
	margin: 0 0 14px 0 !important;
	color: #475569 !important;
	text-align: left !important;
}

#wpat_cookie_banner.layout-floating .wpat-cookie-actions,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-actions,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-actions,
#wpat_cookie_banner.layout-modal .wpat-cookie-actions {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 8px !important;
	width: 100% !important;
	margin-bottom: 12px !important;
	box-sizing: border-box !important;
}

#wpat_cookie_banner.layout-floating .wpat-cookie-legal-links-wrap,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-legal-links-wrap,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-legal-links-wrap,
#wpat_cookie_banner.layout-modal .wpat-cookie-legal-links-wrap {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	gap: 14px !important;
	margin-top: 4px !important;
	font-size: 11.5px !important;
}

#wpat_cookie_banner.layout-floating .wpat-cookie-legal-link,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-legal-link,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-legal-link,
#wpat_cookie_banner.layout-modal .wpat-cookie-legal-link {
	color: #2563eb !important;
	text-decoration: underline !important;
	font-size: 11.5px !important;
	transition: opacity 0.15s ease !important;
}

#wpat_cookie_banner.layout-floating .wpat-cookie-legal-link:hover,
#wpat_cookie_banner.layout-box-bottom-left .wpat-cookie-legal-link:hover,
#wpat_cookie_banner.layout-box-bottom-right .wpat-cookie-legal-link:hover,
#wpat_cookie_banner.layout-modal .wpat-cookie-legal-link:hover {
	opacity: 0.75 !important;
}

/* Botones Comunes de Acción (con aislamiento total contra temas) */
#wpat_cookie_banner .wpat-cookie-btn,
#wpat_cookie_modal .wpat-cookie-btn {
	all: unset;
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	padding: 9px 6px !important;
	min-height: 36px !important;
	border-radius: 6px !important;
	border: 1px solid transparent !important;
	cursor: pointer !important;
	text-decoration: none !important;
	line-height: 1.25 !important;
	white-space: normal !important;
	word-break: normal !important;
	overflow-wrap: normal !important;
	box-shadow: none !important;
	outline: none !important;
	transition: all 0.15s ease-in-out !important;
	width: 100% !important;
	max-width: 100% !important;
}

#wpat_cookie_banner .wpat-cookie-btn-accept,
#wpat_cookie_modal .wpat-cookie-btn-accept {
	background: var(--wpat-cookie-btn-accept-bg, #2563eb) !important;
	background-color: var(--wpat-cookie-btn-accept-bg, #2563eb) !important;
	color: var(--wpat-cookie-btn-accept-text, #ffffff) !important;
	border-color: var(--wpat-cookie-btn-accept-bg, #2563eb) !important;
}

#wpat_cookie_banner .wpat-cookie-btn-accept:hover,
#wpat_cookie_modal .wpat-cookie-btn-accept:hover {
	filter: brightness(1.08) !important;
}

#wpat_cookie_banner .wpat-cookie-btn-reject,
#wpat_cookie_banner .wpat-cookie-btn-settings,
#wpat_cookie_modal .wpat-cookie-btn-reject,
#wpat_cookie_modal .wpat-cookie-btn-save {
	background: #f8fafc !important;
	background-color: #f8fafc !important;
	color: #1e293b !important;
	border: 1px solid #e2e8f0 !important;
}

#wpat_cookie_banner .wpat-cookie-btn-reject:hover,
#wpat_cookie_banner .wpat-cookie-btn-settings:hover,
#wpat_cookie_modal .wpat-cookie-btn-reject:hover,
#wpat_cookie_modal .wpat-cookie-btn-save:hover {
	background: #f1f5f9 !important;
	background-color: #f1f5f9 !important;
	border-color: #cbd5e1 !important;
	color: #0f172a !important;
}

/* Modal de Preferencias y Categorías */
/* Modal de Preferencias y Categorías (Diseño Moderno & Acordeón) */
#wpat_cookie_modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999999;
	background: rgba(15, 23, 42, 0.65);
	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 {
	position: relative;
	background: #ffffff;
	color: #0f172a;
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	border-radius: 12px;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	padding: 24px 22px 18px;
	overflow: hidden;
}

.wpat-cookie-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: all 0.15s ease;
	z-index: 2;
}

.wpat-cookie-modal-close:hover {
	color: #0f172a;
	background: #f1f5f9;
}

.wpat-cookie-modal-header {
	text-align: center;
	margin-bottom: 16px;
}

.wpat-cookie-modal-header h3 {
	margin: 0 0 10px 0;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.wpat-cookie-modal-intro {
	font-size: 12px;
	line-height: 1.55;
	color: #64748b;
	margin: 0;
	text-align: left;
}

.wpat-cookie-modal-body {
	overflow-y: auto;
	flex: 1;
	padding-right: 2px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-bottom: 4px;
}

.wpat-cookie-modal-body::-webkit-scrollbar {
	width: 5px;
}
.wpat-cookie-modal-body::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

.wpat-cookie-cat-item {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	transition: all 0.2s ease;
}

.wpat-cookie-cat-item.open {
	border-color: #cbd5e1;
	background: #ffffff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.wpat-cookie-cat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 11px 14px;
	cursor: pointer;
	user-select: none;
}

.wpat-cookie-cat-title {
	font-weight: 600;
	font-size: 13.5px;
	color: #1e293b;
	display: flex;
	align-items: center;
	gap: 6px;
}

.wpat-cookie-cat-controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wpat-cookie-badge-always {
	font-size: 11.5px;
	font-weight: 600;
	color: #16a34a;
}

.wpat-cookie-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	transition: transform 0.25s ease;
}

.wpat-cookie-cat-item.open .wpat-cookie-chevron {
	transform: rotate(180deg);
}

.wpat-cookie-cat-content {
	display: none;
	padding: 0 14px 12px 14px;
	border-top: 1px solid #f1f5f9;
}

.wpat-cookie-cat-item.open .wpat-cookie-cat-content {
	display: block;
}

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

/* Switch de Categorías (Sleek Orange Slider) */
.wpat-cookie-switch {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
	margin: 0;
	cursor: pointer;
}

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

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

.wpat-cookie-slider:before {
	position: absolute;
	content: "";
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background-color: #ffffff;
	transition: 0.2s ease;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

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

.wpat-cookie-modal-footer {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wpat-cookie-modal-actions {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}

.wpat-cookie-modal-actions .wpat-cookie-btn {
	padding: 9px 6px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 6px;
	text-align: center;
	white-space: nowrap;
	justify-content: center;
}

.wpat-cookie-btn-accept {
	background: var(--wpat-cookie-btn-accept-bg, #2563eb);
	color: var(--wpat-cookie-btn-accept-text, #ffffff);
	border: 1px solid var(--wpat-cookie-btn-accept-bg, #2563eb);
}

.wpat-cookie-btn-reject,
.wpat-cookie-btn-save {
	background: #ffffff;
	color: #334155;
	border: 1px solid #cbd5e1;
}

.wpat-cookie-btn-reject:hover,
.wpat-cookie-btn-save:hover {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #0f172a;
}

/* Enlaces Legales en Modal */
.wpat-cookie-modal-links {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 11.5px;
	color: #94a3b8;
}

.wpat-cookie-modal-links .wpat-cookie-legal-link {
	color: #64748b !important;
	text-decoration: none !important;
	font-size: 11.5px;
	transition: color 0.15s ease;
}

.wpat-cookie-modal-links .wpat-cookie-legal-link:hover {
	color: #0f172a !important;
	text-decoration: underline !important;
}

.wpat-cookie-modal-links .wpat-cookie-links-sep {
	color: #cbd5e1;
	font-size: 10px;
}

/* Enlaces Legales en Banner */
.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;
}

/* 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; }
