/* PlazaGeneral – estilos (branding rojo Plaza #c1272d)
   Tamaños de letra en em: relativos al tamaño por defecto del tema. */
:root {
	--pg-red: #c1272d;
	--pg-red-dark: #9c1f24;
	--pg-gris: #f5f5f6;
	--pg-borde: #ddd;
	--pg-texto: #2b2b2b;
}

body.pg-fullwidth .site-main,
body.pg-fullwidth .entry-content,
body.pg-fullwidth .wp-block-post-content {
	max-width: 1100px;
	margin-left: auto;
	margin-right: auto;
}

.pg-wrap { max-width: 1100px; margin: 0 auto; padding: 1em 0 2em; color: var(--pg-texto); }
.pg-narrow { max-width: 640px; }
.pg-title { color: var(--pg-red); margin-bottom: 1em; }

/* Avisos */
.pg-notice { padding: .75em 1em; border-radius: 6px; margin: 0 0 1em; font-size: .95em; }
.pg-notice-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.pg-notice-error { background: #fdecea; border: 1px solid #f5b5b1; color: #8e1b16; }

/* Tarjetas resumen */
.pg-cards { display: flex; gap: 1em; flex-wrap: wrap; margin-bottom: 1.25em; }
.pg-card {
	background: #fff; border: 1px solid var(--pg-borde); border-top: 4px solid var(--pg-red);
	border-radius: 8px; padding: 1em 1.5em; min-width: 160px; text-align: center;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pg-card-num { display: block; font-size: 1.6em; font-weight: 700; color: var(--pg-red); }
.pg-card-label { display: block; font-size: .85em; text-transform: uppercase; letter-spacing: .05em; color: #777; }

/* Botones: mismas métricas que los inputs (padding .55em .7em + borde 1px)
   para que en las filas flex queden con la misma altura. */
.pg-btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--pg-red); color: #fff !important;
	border: 1px solid var(--pg-red); border-radius: 6px;
	padding: .55em 1.1em;
	font-size: 1em; font-weight: 600; font-family: inherit;
	text-decoration: none; cursor: pointer; line-height: 1.4;
	box-sizing: border-box;
	transition: background .15s, color .15s;
}
.pg-btn:hover { background: var(--pg-red-dark); border-color: var(--pg-red-dark); color: #fff !important; }
.pg-btn-outline { background: transparent; color: var(--pg-red) !important; }
.pg-btn-outline:hover { background: var(--pg-red); color: #fff !important; }
.pg-btn-small { padding: .3em .7em; font-size: .85em; }

/* Tabla */
.pg-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .95em; }
.pg-table th { background: var(--pg-red); color: #fff; text-align: left; padding: .6em .75em; }
.pg-table td { padding: .6em .75em; border-bottom: 1px solid var(--pg-borde); vertical-align: middle; }
.pg-table tr:nth-child(even) td { background: var(--pg-gris); }
.pg-actions { white-space: nowrap; }
.pg-logo { max-height: 40px; max-width: 90px; height: auto; border-radius: 4px; }
.pg-logo-grande { max-height: 90px; max-width: 200px; }

.pg-badge { display: inline-block; padding: .15em .5em; border-radius: 999px; font-size: .8em; font-weight: 600; }
.pg-badge-ok { background: #e8f5e9; color: #1b5e20; }
.pg-badge-no { background: #fdecea; color: #8e1b16; }

/* Formularios */
.pg-form { background: #fff; border: 1px solid var(--pg-borde); border-radius: 8px; padding: 1.5em; }
.pg-field label { display: block; font-weight: 600; margin-bottom: .3em; }
.pg-field input[type="text"],
.pg-field input[type="url"],
.pg-field input[type="tel"],
.pg-field input[type="email"],
.pg-field input[type="password"],
.pg-field textarea {
	width: 100%; padding: .55em .7em; border: 1px solid var(--pg-borde); border-radius: 6px;
	font-size: 1em; font-family: inherit; line-height: 1.4; box-sizing: border-box;
}
.pg-field input:focus, .pg-field textarea:focus {
	outline: none; border-color: var(--pg-red); box-shadow: 0 0 0 2px rgba(193,39,45,.15);
}
.pg-readonly { background: var(--pg-gris); color: #555; }
.pg-aes { font-family: monospace; font-size: .85em; }

/* Fila clave AES: input y botón con la misma altura (stretch) */
.pg-aes-row { display: flex; gap: .5em; align-items: stretch; }
.pg-aes-row input { flex: 1; min-width: 0; }
.pg-aes-row .pg-btn { white-space: nowrap; }

.pg-check label { font-weight: 600; }
.pg-check input { margin-right: .4em; }

/* Fila de submit: botones alineados y de igual altura */
.pg-submit { margin-top: 1.25em; display: flex; gap: .75em; flex-wrap: wrap; align-items: stretch; }

.pg-muted { color: #777; font-size: .9em; }
.pg-hr { border: none; border-top: 1px solid var(--pg-borde); margin: 1.25em 0; }
.pg-foto img { max-width: 140px; border-radius: 50%; border: 3px solid var(--pg-red); }

@media (max-width: 700px) {
	.pg-table { display: block; overflow-x: auto; }
	.pg-aes-row { flex-direction: column; align-items: stretch; }
}

/* ---------- Sin barra lateral en las páginas del plugin ---------- */
body.pg-fullwidth #secondary,
body.pg-fullwidth .widget-area,
body.pg-fullwidth .sidebar,
body.pg-fullwidth aside.sidebar,
body.pg-fullwidth #sidebar,
body.pg-fullwidth .site-sidebar {
	display: none !important;
}
body.pg-fullwidth .content-area,
body.pg-fullwidth #primary,
body.pg-fullwidth .site-content .col-full,
body.pg-fullwidth .site-main {
	width: 100% !important;
	max-width: 1100px;
	float: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ---------- Modal de ajuste de foto ---------- */
.pg-modal {
	display: none;
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(0, 0, 0, .55);
	align-items: center; justify-content: center;
	padding: 1em;
}
.pg-modal.pg-modal-open { display: flex; }
.pg-modal-box {
	background: #fff; border-radius: 10px; padding: 1.5em;
	max-width: 380px; width: 100%; text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.pg-modal-box h3 { margin: 0 0 .75em; color: var(--pg-red); }
.pg-crop-area {
	width: 300px; height: 300px; margin: 0 auto .75em;
	border: 2px dashed var(--pg-borde); border-radius: 8px; overflow: hidden;
	background: var(--pg-gris);
}
#pg-crop-canvas { display: block; cursor: grab; touch-action: none; }
#pg-crop-canvas:active { cursor: grabbing; }
#pg-crop-zoom { width: 100%; margin: .5em 0 1em; accent-color: var(--pg-red); }
.pg-modal-btns { display: flex; gap: .75em; justify-content: center; }

/* Icono de descarga CSV en la columna de clientes únicos */
.pg-table .pg-uniq { white-space: nowrap; }
.pg-table .pg-csv {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 6px;
	color: var(--plaza-primary, #c1272d);
	text-decoration: none;
}
.pg-table .pg-csv:hover { opacity: .75; }

/* Teléfono con prefijo de país */
.pg-tel-row { display: flex; gap: 8px; }
.pg-tel-row .pg-tel-prefijo { flex: 0 0 auto; max-width: 45%; }
.pg-tel-row .pg-tel-num { flex: 1 1 auto; }
