/* Mkt360 Cookies — usa los colores y tipografías del tema si existen
   (variables de theme.json) y valores neutros si no. */
:root {
	--m360c-bg: var(--wp--preset--color--base, #fff);
	--m360c-fg: var(--wp--preset--color--contrast, #1d1d1d);
	--m360c-muted: var(--wp--preset--color--muted, #5c5c5c);
	--m360c-line: var(--wp--preset--color--border, #d9d9d9);
	--m360c-soft: var(--wp--preset--color--secondary, #f2f2f2);
	--m360c-accent: var(--wp--preset--color--primary, #1d1d1d);
	--m360c-on-accent: var(--wp--preset--color--on-primary, #fff);
	--m360c-font: var(--wp--preset--font-family--body, system-ui, sans-serif);
	--m360c-title-font: var(--wp--preset--font-family--display, var(--m360c-font));
}

/* Primera capa: visible solo si no hay elección válida (clase puesta en el <head>). */
.m360c-banner { display: none; }
html.m360c-need .m360c-banner { display: block; }
.m360c-banner {
	position: fixed; z-index: 99990; left: 1rem; right: 1rem; bottom: 1rem;
	max-width: 44rem; margin-inline: auto;
	background: var(--m360c-bg); color: var(--m360c-fg); font-family: var(--m360c-font);
	border: 1px solid var(--m360c-line); border-radius: 14px;
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .35);
}
.m360c-banner__inner { padding: 1.25rem 1.4rem 1.2rem; }
.m360c-banner__title, .m360c-panel__title {
	margin: 0 0 .4rem; font-family: var(--m360c-title-font); font-size: 1.35rem; line-height: 1.2; font-weight: 500;
}
.m360c-banner__text { margin: 0; font-size: .875rem; line-height: 1.6; color: var(--m360c-muted); }
.m360c-banner__text a, .m360c-panel a { color: var(--m360c-fg); text-decoration: underline; text-underline-offset: 2px; }
.m360c-banner__actions, .m360c-panel__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }

/* Aceptar y Rechazar: exactamente el mismo estilo (Guía AEPD 3.1.2.2). */
.m360c-btn {
	appearance: none; cursor: pointer; font: inherit; font-family: var(--m360c-font);
	font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	min-height: 44px; padding: .7rem 1.3rem; border-radius: 999px; line-height: 1.2;
	transition: background-color .15s, color .15s, border-color .15s;
}
.m360c-btn--choice { flex: 1 1 10rem; background: var(--m360c-accent); color: var(--m360c-on-accent); border: 1px solid var(--m360c-accent); }
.m360c-btn--choice:hover { filter: brightness(1.12); }
.m360c-btn--save { background: transparent; color: var(--m360c-fg); border: 1px solid var(--m360c-fg); }
.m360c-btn--save:hover { background: var(--m360c-soft); }
.m360c-btn--link { background: none; border: 0; color: var(--m360c-fg); text-decoration: underline; text-underline-offset: 3px; padding-inline: .6rem; }
.m360c-btn:focus-visible, .m360c-fab:focus-visible, .m360c-panel__close:focus-visible, .m360c-switch input:focus-visible + .m360c-switch__track { outline: 2px solid var(--m360c-accent); outline-offset: 3px; }

/* Segunda capa */
.m360c-panel {
	position: fixed; inset: 0; z-index: 99995; display: grid; place-items: center; padding: 1rem;
	background: rgba(0, 0, 0, .45); font-family: var(--m360c-font);
}
.m360c-panel[hidden] { display: none; }
html.m360c-panel-open { overflow: hidden; }
.m360c-panel__box {
	width: min(40rem, 100%); max-height: min(88vh, 52rem); display: flex; flex-direction: column;
	background: var(--m360c-bg); color: var(--m360c-fg); border-radius: 16px; outline: none;
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5);
}
.m360c-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem .6rem; }
.m360c-panel__close { appearance: none; border: 0; background: none; font-size: 1.75rem; line-height: 1; cursor: pointer; color: var(--m360c-fg); width: 44px; height: 44px; }
.m360c-panel__body { overflow-y: auto; padding: 0 1.4rem 1rem; font-size: .875rem; line-height: 1.6; }
.m360c-panel__body > p { color: var(--m360c-muted); margin-top: 0; }
.m360c-panel__actions { margin: 0; padding: 1rem 1.4rem 1.3rem; border-top: 1px solid var(--m360c-line); }
.m360c-panel__actions .m360c-btn { flex: 1 1 9rem; }

.m360c-cat { border-top: 1px solid var(--m360c-line); padding: .9rem 0; }
.m360c-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.m360c-cat__label { font-weight: 600; }
.m360c-cat__state { font-size: .75rem; color: var(--m360c-muted); }
.m360c-cat__desc { margin: .35rem 0 0; color: var(--m360c-muted); }
.m360c-cat__details { margin-top: .5rem; }
.m360c-cat__details summary { cursor: pointer; font-size: .8125rem; text-decoration: underline; text-underline-offset: 2px; }

/* Interruptor accesible (checkbox real) */
.m360c-switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; }
.m360c-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m360c-switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--m360c-line); transition: background-color .15s; flex: none; }
.m360c-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.m360c-switch input:checked + .m360c-switch__track { background: var(--m360c-accent); }
.m360c-switch input:checked + .m360c-switch__track::after { transform: translateX(18px); }
.m360c-switch input:disabled + .m360c-switch__track { opacity: .55; }

.m360c-table { width: 100%; border-collapse: collapse; font-size: .8125rem; margin: .6rem 0; }
.m360c-table th, .m360c-table td { text-align: left; vertical-align: top; padding: .45rem .5rem; border-bottom: 1px solid var(--m360c-line); }
.m360c-table th { font-weight: 600; background: var(--m360c-soft); }
.m360c-table code { font-size: .75rem; word-break: break-word; }

/* Botón flotante para reabrir la configuración */
.m360c-fab { display: none; }
html.m360c-decided .m360c-fab {
	display: grid; place-items: center; position: fixed; z-index: 99980; left: 1rem; bottom: 1rem;
	width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
	background: var(--m360c-bg); color: var(--m360c-fg); border: 1px solid var(--m360c-line);
	box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .35);
}

@media (max-width: 600px) {
	.m360c-banner { left: .5rem; right: .5rem; bottom: .5rem; }
	.m360c-banner__inner { padding: 1rem 1rem .9rem; }
	.m360c-banner__title { font-size: 1.15rem; }
	.m360c-banner__text { font-size: .8125rem; }
	.m360c-panel { padding: 0; align-items: end; }
	.m360c-panel__box { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
	.m360c-table thead { display: none; }
	.m360c-table tr { display: block; border-bottom: 1px solid var(--m360c-line); padding: .4rem 0; }
	.m360c-table td { display: block; border: 0; padding: .1rem 0; }
}
@media (prefers-reduced-motion: reduce) {
	.m360c-switch__track, .m360c-switch__track::after, .m360c-btn { transition: none; }
}
@media print { .m360c-banner, .m360c-fab, .m360c-panel { display: none !important; } }
