/* Grupal Reseñas — estilos del front. Azul de marca: #334F98 */

.gres-wrap { --gres-azul:#334F98; --gres-radio:10px; margin:0 auto; }

.gres-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:18px; }
.gres-search {
	flex:1 1 240px; min-width:200px; padding:10px 14px; border:1px solid #d8dce6;
	border-radius:999px; font-size:15px; outline:none;
}
.gres-search:focus { border-color:var(--gres-azul); box-shadow:0 0 0 3px rgba(51,79,152,.15); }

.gres-filtros { display:flex; flex-wrap:wrap; gap:8px; }
.gres-chip {
	background:#eef1f8; color:var(--gres-azul); border:1px solid transparent;
	padding:6px 14px; border-radius:999px; font-size:13px; cursor:pointer; transition:.15s;
}
.gres-chip:hover { background:#e2e7f5; }
.gres-chip.is-active { background:var(--gres-azul); color:#fff; }

.gres-grid {
	display:grid; gap:22px;
	grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
}
.gres-wrap[data-cols="3"] .gres-grid { grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); }
.gres-wrap[data-cols="5"] .gres-grid { grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); }

.gres-card { cursor:pointer; text-align:left; outline:none; }
.gres-card:focus-visible { box-shadow:0 0 0 3px rgba(51,79,152,.4); border-radius:var(--gres-radio); }
.gres-card-cover {
	position:relative; overflow:hidden; border-radius:var(--gres-radio);
	background:#f4f5f9; box-shadow:0 2px 10px rgba(0,0,0,.08); aspect-ratio:2/3;
	display:flex; align-items:center; justify-content:center;
}
.gres-card-cover img { width:100%; height:100%; object-fit:contain; transition:.25s; }
.gres-card:hover .gres-card-cover img { transform:scale(1.04); }
.gres-card-badge {
	position:absolute; left:50%; bottom:10px; transform:translateX(-50%) translateY(6px);
	background:var(--gres-azul); color:#fff; font-size:12px; padding:6px 12px;
	border-radius:999px; opacity:0; transition:.2s; white-space:nowrap;
}
.gres-card:hover .gres-card-badge, .gres-card:focus .gres-card-badge { opacity:1; transform:translateX(-50%) translateY(0); }
.gres-card-title { font-size:15px; font-weight:600; margin:10px 0 4px; line-height:1.3; color:#1f2937; }
.gres-card-materias { display:flex; flex-wrap:wrap; gap:4px; }
.gres-tag { font-size:11px; background:#eef1f8; color:var(--gres-azul); padding:2px 8px; border-radius:999px; }

.gres-vacio { text-align:center; color:#6b7280; padding:40px 0; }

/* Botón de descarga en la ficha de producto (single) — compacto, del ancho del texto */
.gres-inline { margin:10px 0; }
.gres-btn-pdf-inline {
	display:inline-block; width:auto; text-decoration:none;
	background:var(--gres-azul); color:#fff !important;
	padding:9px 16px; border-radius:8px; font-size:14px; font-weight:600; line-height:1; white-space:nowrap;
}
.gres-btn-pdf-inline:hover { background:#28407e; color:#fff !important; }

/* Modal */
.gres-modal { position:fixed; inset:0; z-index:99999; display:none; }
.gres-modal.is-open { display:block; }
.gres-modal-overlay { position:absolute; inset:0; background:rgba(17,24,39,.6); backdrop-filter:blur(2px); }
.gres-modal-box {
	position:relative; margin:5vh auto; max-width:760px; width:92%; max-height:90vh; overflow:auto;
	background:#fff; border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.3);
	animation:gresIn .2s ease; padding:0;
}
@keyframes gresIn { from { opacity:0; transform:translateY(12px);} to { opacity:1; transform:none;} }
.gres-modal-close {
	position:absolute; top:10px; right:14px; background:transparent; border:0;
	font-size:30px; line-height:1; color:#9ca3af; cursor:pointer; z-index:2;
}
.gres-modal-close:hover { color:#111827; }
.gres-modal-header {
	display:flex; gap:16px; align-items:flex-start; padding:22px 48px 14px 24px;
	border-bottom:1px solid #eef0f4; background:linear-gradient(180deg,#f7f9fd,#fff);
	border-radius:14px 14px 0 0;
}
.gres-modal-header > div { flex:1 1 auto; min-width:0; }
/* Botón de descarga arriba a la derecha (además del de abajo) */
.gres-btn-pdf-top { align-self:flex-start; margin-left:auto; padding:8px 14px; font-size:13px; white-space:nowrap; flex:0 0 auto; }
.gres-modal-cover { width:78px; height:auto; border-radius:6px; box-shadow:0 2px 8px rgba(0,0,0,.15); flex:0 0 auto; }
.gres-modal-cover:not([src]) { display:none; }
.gres-modal-title { margin:0 30px 6px 0; font-size:20px; color:var(--gres-azul); line-height:1.25; }
.gres-modal-materias { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:6px; }
.gres-modal-isbn { font-size:12px; color:#6b7280; }
.gres-modal-body { padding:20px 24px; line-height:1.65; color:#374151; }
.gres-modal-body img { max-width:100%; height:auto; }
.gres-modal-loading { color:#9ca3af; text-align:center; padding:30px 0; }
.gres-modal-footer { padding:14px 24px 22px; border-top:1px solid #eef0f4; text-align:right; }
.gres-btn-pdf {
	display:inline-block; background:var(--gres-azul); color:#fff !important; text-decoration:none;
	padding:11px 22px; border-radius:8px; font-size:14px; font-weight:600;
}
.gres-btn-pdf:hover { background:#28407e; }

body.gres-noscroll { overflow:hidden; }

@media (max-width:560px) {
	.gres-modal-box { margin:0; width:100%; max-height:100vh; border-radius:0; }
	.gres-toolbar { flex-direction:column; align-items:stretch; }
}
