:root {
	--pcac-accent: #f4c64e;
	--pcac-accent-dark: #000000;
	--pcac-text-dark: #111827;
}

/* ===== Gallery grid — uses the exact column count chosen in
   Settings on desktop, then steps down at each breakpoint below so it
   always stays responsive on tablets/phones. ===== */
.pcac-gallery {
	display: grid;
	grid-template-columns: repeat( var( --pcac-columns, 5 ), 1fr );
	gap: 22px;
	margin: 24px 0;
}
@media (max-width: 1200px) {
	.pcac-gallery { grid-template-columns: repeat( 4, 1fr ); }
}
@media (max-width: 992px) {
	.pcac-gallery { grid-template-columns: repeat( 3, 1fr ); }
}
@media (max-width: 680px) {
	.pcac-gallery { grid-template-columns: repeat( 2, 1fr ); }
}
@media (max-width: 420px) {
	.pcac-gallery { grid-template-columns: repeat( 1, 1fr ); }
}

.pcac-card-item {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 16px !important;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	transition: transform .18s ease, box-shadow .18s ease;
	display: flex;
	flex-direction: column;
}
.pcac-card-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.pcac-thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f4f5f6;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.pcac-thumb img {
	width: 100%;
	height: 100%;
	/* "contain" (not "cover") so the full certificate image is always
	   visible, never cropped, regardless of its original aspect ratio. */
	object-fit: contain;
	display: block;
}
.pcac-file-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
.pcac-file-placeholder .dashicons {
	font-size: 56px;
	width: 56px;
	height: 56px;
	color: #b7bbc0;
}

.pcac-blurred img,
.pcac-blurred .pcac-file-placeholder {
	filter: blur(10px) grayscale(0.3);
	transform: scale(1.08);
}

/* ===== Multi-page slider — several pages of the SAME COA (page 1,
   page 2, …) sit stacked inside one card and slide, instead of
   showing as separate duplicate cards. ===== */
.pcac-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}
.pcac-slide.pcac-slide-active {
	opacity: 1;
	pointer-events: auto;
}
.pcac-slide img { width: 100%; height: 100%; object-fit: contain; }

button.pcac-slide-nav {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 30px !important;
	height: 30px !important;
	border-radius: 50% !important;
	background: rgba(17,24,39,0.55) !important;
	color: #ffffff !important;
	border: 0 !important;
	outline: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 3;
	opacity: 0;
	transition: opacity .18s ease, background .18s ease;
	padding: 0 !important;
}
button.pcac-slide-nav .dashicons { font-size: 16px; width: 16px; height: 16px; }
button.pcac-slide-nav:hover { background: rgba(17,24,39,0.85) !important; }
.pcac-has-slider:hover button.pcac-slide-nav,
.pcac-has-slider button.pcac-slide-nav:focus {
	opacity: 1;
}
.pcac-slide-prev { left: 8px !important; }
.pcac-slide-next { right: 8px !important; }

.pcac-slide-dots {
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 3;
}
.pcac-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255,255,255,0.65);
	border: 1px solid rgba(0,0,0,0.15);
	cursor: pointer;
	padding: 0;
}
.pcac-dot-active { background: #ffffff; }

/* Lock overlay shown on top of a blurred thumbnail.
   Fixed, predictable sizing so "Login Required" never wraps
   inconsistently between cards of the same width. */
button.pcac-overlay {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	cursor: pointer !important;
	background: rgba(15, 23, 42, 0.50) !important;
	color: #ffffff !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	padding: 10px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}
.pcac-overlay .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}
.pcac-overlay span:last-child {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.3;
	/* Allow a clean wrap onto a second line instead of ever being
	   clipped mid-word by the thumbnail's overflow:hidden. */
	white-space: normal;
	max-width: 100px;
	overflow-wrap: break-word;
}

.pcac-card-body {
	padding: 16px 16px 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.pcac-card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--pcac-text-dark);
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ===== Buttons =====
   These rules use !important + extra specificity (e.g. a.pcac-btn,
   button.pcac-btn, prefixed by their containers) because this plugin's
   buttons render inside Elementor/theme widgets whose own global button
   styles (border-radius, color, background) otherwise win the cascade
   and silently override the plugin's look. */
a.pcac-btn,
button.pcac-btn,
.pcac-card-body a.pcac-btn,
.pcac-lock-actions a.pcac-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-decoration: none !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	padding: 12px 22px !important;
	border-radius: 30px !important;
	-webkit-border-radius: 30px !important;
	cursor: pointer !important;
	/* "none", not "transparent" — some themes (e.g. WoodMart) force their
	   own visible border color with !important, which a transparent
	   border-color can still inherit around. Zero-width border + outline
	   removal guarantees no ring can ever render. */
	border: 0 !important;
	outline: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	box-shadow: none !important;
	transition: opacity .15s ease, transform .1s ease, box-shadow .15s ease !important;
	line-height: 1.2 !important;
	white-space: nowrap !important;
	text-align: center !important;
	text-transform: none !important;
}
.pcac-btn:hover { opacity: 0.92; box-shadow: 0 6px 16px rgba(0,0,0,0.18) !important; }
.pcac-btn:active { transform: scale(0.97); }
.pcac-btn:focus { outline: none !important; box-shadow: 0 0 0 3px rgba(244,198,78,0.35) !important; }
.pcac-btn-block { width: 100% !important; }

/* Primary: gold → black gradient, 30px corner radius */
a.pcac-btn-primary,
button.pcac-btn-primary {
	background: linear-gradient( 135deg, var(--pcac-accent) 0%, var(--pcac-accent-dark) 100% ) !important;
	color: #ffffff !important;
	border: 0 !important;
}
a.pcac-btn-primary:hover,
button.pcac-btn-primary:hover,
a.pcac-btn-primary:visited,
a.pcac-btn-primary:focus {
	color: #ffffff !important;
	border: 0 !important;
}

/* Secondary: clearly visible, outlined in the accent color on white */
a.pcac-btn-secondary,
button.pcac-btn-secondary {
	background: #ffffff !important;
	color: var(--pcac-text-dark) !important;
	border: 2px solid var(--pcac-accent) !important;
}
a.pcac-btn-secondary:hover,
button.pcac-btn-secondary:hover,
a.pcac-btn-secondary:visited,
a.pcac-btn-secondary:focus {
	background: var(--pcac-accent) !important;
	color: #111111 !important;
	border: 2px solid var(--pcac-accent) !important;
}

.pcac-lockbox {
	max-width: 440px;
	margin: 0 auto;
	text-align: center;
	padding: 40px 30px;
}
.pcac-lockbox .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--pcac-accent-dark);
	background: rgba(244,198,78,0.25);
	border-radius: 50%;
	padding: 18px;
	box-sizing: content-box;
}
.pcac-lockbox h3 {
	margin: 20px 0 10px;
	font-size: 22px;
	font-weight: 700;
	color: var(--pcac-text-dark);
}
.pcac-lock-desc {
	color: #4b5563;
	font-size: 15px;
	line-height: 1.6;
	margin-bottom: 26px;
}
.pcac-lock-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}
.pcac-lock-actions .pcac-btn { flex: 1 1 auto; min-width: 150px; }

.pcac-standalone-lock {
	background: #fff;
	border: 1px solid #eceef0;
	border-radius: 18px;
	box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}
.pcac-standalone-lock.pcac-fullpage {
	width: 100%;
	max-width: 480px;
}
.pcac-back-link {
	margin-top: 16px;
	font-size: 13px;
}
.pcac-back-link a { color: var(--pcac-text-dark); text-decoration: underline; }

/* ===== Modal ===== */
.pcac-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
	box-sizing: border-box;
}
.pcac-modal-overlay.pcac-open { display: flex; }
.pcac-modal {
	position: relative;
	background: #fff;
	border-radius: 18px;
	max-width: 440px;
	width: 100%;
	/* Fits in one glance, no inner scrolling: capped well under the
	   viewport height, with the overlay itself (align-items:center)
	   keeping it perfectly centered both ways. */
	max-height: calc( 100vh - 40px );
	overflow-y: auto;
	box-shadow: 0 24px 64px rgba(0,0,0,0.35);
	animation: pcacPop .18s ease;
}
@keyframes pcacPop {
	from { transform: scale(0.95); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* Professional circular close button — sits INSIDE the card's own
   corner (not floating outside it), so it can never be clipped by the
   card's overflow and is always fully, clearly visible. */
button.pcac-modal-close {
	position: absolute !important;
	top: 14px !important;
	right: 14px !important;
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	background: #f3f4f6 !important;
	border: none !important;
	box-shadow: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 18px !important;
	line-height: 1 !important;
	color: #4b5563 !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	text-indent: 0 !important;
	transition: background .15s ease, color .15s ease, transform .15s ease !important;
	z-index: 2;
}
button.pcac-modal-close:hover {
	background: var(--pcac-accent-dark) !important;
	color: #ffffff !important;
	transform: scale(1.08) !important;
}

.pcac-empty { color: #666; font-style: italic; }

/* A single embedded COA card (e.g. [coa_protected id=".."] or the
   ACF-powered [coa_acf] on a product page) shouldn't stretch full-width
   inside a wide content column — cap it to a tidy, card-like size. */
.pcac-single-wrap {
	max-width: 320px;
}

/* ===== Responsiveness ===== */
@media (max-width: 480px) {
	.pcac-gallery { gap: 14px; }
	.pcac-lockbox { padding: 30px 18px; }
	.pcac-lockbox h3 { font-size: 19px; }
	.pcac-lock-actions { flex-direction: column; }
	.pcac-lock-actions .pcac-btn { width: 100%; }
	.pcac-modal-close { top: 10px !important; right: 10px !important; width: 28px !important; height: 28px !important; font-size: 16px !important; }
}
