/* ==========================================================================
   WISA Downloads — Frontend Styles
   ========================================================================== */

.wisa-tab-content-wrapper {
	max-width: 680px;
}

.wisa-tab-intro {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 20px;
}

.wisa-download-wrapper {
	margin: 0;
}

.wisa-download-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #f7f7f7;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 150ms ease, border-color 150ms ease;
	line-height: 1.4;
}

.wisa-download-button:hover {
	background: #ebebeb;
	border-color: #b4b4b4;
	color: #333;
	text-decoration: none;
}

.wisa-download-button:focus {
	outline: none;
}

.wisa-download-button:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.wisa-download-icon {
	flex-shrink: 0;
}

.wisa-download-button--small {
	padding: 7px 14px;
	font-size: 12px;
}

/* ==========================================================================
   Werktekeningen Overzicht (Shortcode)
   ========================================================================== */

.wisa-overview {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header with search + count */
.wisa-overview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.wisa-overview-search-wrapper {
	position: relative;
	flex: 1;
	max-width: 400px;
}

.wisa-overview-search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: #a7aaad;
	pointer-events: none;
}

.wisa-overview-search-wrapper input.wisa-overview-search {
	width: 100%;
	height: 38px;
	padding: 0 12px 0 36px !important;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	font-size: 13px;
	color: #333;
	background: #fff;
	outline: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	box-sizing: border-box;
}

.wisa-overview-search:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.wisa-overview-search::placeholder {
	color: #a7aaad;
}

.wisa-overview-count {
	font-size: 12px;
	color: #8c8f94;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Product list — two column masonry */
.wisa-overview-list {
	columns: 2;
	column-gap: 12px;
}

.wisa-overview-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	background: #fff;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	break-inside: avoid;
	margin-bottom: 12px;
}

.wisa-overview-row:hover {
	border-color: #c5d9ed;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wisa-overview-row > .wisa-download-button--small {
	width: 150px;
	justify-content: center;
	flex-shrink: 0;
	box-sizing: border-box;
}

.wisa-handleiding-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.wisa-handleiding-actions .wisa-download-button--small {
	width: auto;
}

.wisa-overview-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	border: 1px solid #eee;
}

.wisa-overview-info {
	flex: 1;
	min-width: 0;
}

.wisa-overview-name {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wisa-overview-name:hover {
	color: #2271b1;
}

.wisa-overview-sku {
	display: block;
	font-size: 11px;
	color: #8c8f94;
	margin-top: 1px;
}

/* Empty / no results states */
.wisa-overview-empty,
.wisa-overview-none {
	text-align: center;
	padding: 32px 16px;
	color: #8c8f94;
	font-size: 13px;
}

/* ==========================================================================
   Frontend Tab Navigation (Shortcode)
   ========================================================================== */

.wisa-frontend-tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid #e8e8e8;
	margin-bottom: 20px;
}

.wisa-frontend-tab {
	padding: 10px 20px;
	border: none;
	background: transparent;
	font-size: 14px;
	font-weight: 600;
	color: #8c8f94;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all 120ms ease;
}

.wisa-frontend-tab:hover {
	color: #1d2327;
}

.wisa-frontend-tab.wisa-frontend-tab-active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.wisa-frontend-tab-panel {
	display: none;
}

.wisa-frontend-tab-panel.wisa-frontend-tab-active {
	display: block;
}

/* ==========================================================================
   Fotogalerij Frontend
   ========================================================================== */

/* Category cards grid — 4 columns on desktop */
.wisa-gallery-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.wisa-gallery-card {
	border: 1px solid #eaeaea;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.wisa-gallery-card:hover {
	border-color: #c5d9ed;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.wisa-gallery-card-thumb {
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	background: #f8f8f8;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c3c4c7;
}

.wisa-gallery-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.wisa-gallery-card:hover .wisa-gallery-card-thumb img {
	transform: scale(1.03);
}

.wisa-gallery-card-info {
	padding: 12px 14px;
}

.wisa-gallery-card-name {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wisa-gallery-card-count {
	display: block;
	font-size: 11px;
	color: #8c8f94;
	margin-top: 3px;
}

/* Detail panel — back bar */
.wisa-gallery-detail-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 20px;
	margin-bottom: 24px;
}

.wisa-gallery-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid #dcdcdc;
	border-radius: 6px;
	background: #f9f9f9;
	color: #333;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: background 150ms ease, border-color 150ms ease;
}

.wisa-gallery-back-btn:hover {
	background: #ebebeb;
	border-color: #b4b4b4;
}

.wisa-gallery-detail-name {
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
}

/* Photo grid — 4 columns on desktop */
.wisa-gallery-photo-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.wisa-gallery-photo-item {
	border: 1px solid #eaeaea;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.wisa-gallery-photo-item:hover {
	border-color: #c5d9ed;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.wisa-gallery-photo-img {
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	background: #f8f8f8;
}

.wisa-gallery-photo-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.wisa-gallery-photo-item:hover .wisa-gallery-photo-img img {
	transform: scale(1.03);
}

.wisa-gallery-photo-footer {
	padding: 10px 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Gallery download button — more modern style */
.wisa-gallery-photo-footer .wisa-download-button--small {
	padding: 6px 14px;
	font-size: 12px;
	border-radius: 6px;
	background: #06107a;
	border: 1px solid #06107a;
	color: #fff;
	font-weight: 500;
}

.wisa-gallery-photo-footer .wisa-download-button--small:hover {
	background: #040c5e;
	border-color: #040c5e;
	color: #fff;
}

.wisa-gallery-photo-footer .wisa-download-button--small:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.wisa-gallery-photo-footer .wisa-download-button--small .wisa-download-icon {
	stroke: #fff;
}

/* Safety net: CSS display overrides hidden attribute */
.wisa-gallery-cards[hidden],
.wisa-gallery-detail-panel[hidden] {
	display: none;
}

.wisa-gallery-no-photos {
	text-align: center;
	padding: 40px 16px;
	color: #8c8f94;
	font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
	.wisa-gallery-cards {
		grid-template-columns: repeat(3, 1fr);
	}

	.wisa-gallery-photo-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.wisa-overview-list {
		columns: 1;
	}

	.wisa-overview-header {
		flex-direction: column;
		align-items: stretch;
	}

	.wisa-overview-search-wrapper {
		max-width: none;
	}

	.wisa-overview-count {
		text-align: right;
	}

	.wisa-overview-row {
		flex-wrap: wrap;
		gap: 8px;
	}

	.wisa-overview-info {
		flex: 1 1 calc(100% - 52px);
	}

	.wisa-overview-row .wisa-download-button--small {
		width: 100%;
		justify-content: center;
	}

	.wisa-handleiding-actions {
		width: 100%;
		flex-direction: column;
	}

	.wisa-overview-downloads {
		width: 100%;
	}

	.wisa-downloads-modal {
		max-width: none;
		margin: 0;
		border-radius: 10px;
	}

	.wisa-downloads-modal-overlay {
		padding: 16px;
	}

	.wisa-gallery-cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.wisa-gallery-photo-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.wisa-gallery-detail-bar {
		flex-wrap: wrap;
	}
}

@media (max-width: 480px) {
	.wisa-gallery-cards {
		grid-template-columns: 1fr;
	}

	.wisa-gallery-photo-grid {
		grid-template-columns: 1fr;
	}

	.wisa-frontend-tabs {
		gap: 0;
	}

	.wisa-frontend-tab {
		padding: 8px 14px;
		font-size: 13px;
	}
}

/* ==========================================================================
   Downloads Modal (Product Page — Multiple Werktekeningen)
   ========================================================================== */

.wisa-download-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #2271b1;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	margin-left: 4px;
}

.wisa-downloads-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wisa-downloads-modal-overlay[hidden] {
	display: none;
}

.wisa-downloads-modal {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	max-width: 520px;
	width: 100%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}

.wisa-downloads-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e8e8e8;
}

.wisa-downloads-modal-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
}

.wisa-downloads-modal-close {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: #8c8f94;
	border-radius: 4px;
	transition: color 120ms ease, background 120ms ease;
}

.wisa-downloads-modal-close:hover {
	color: #1d2327;
	background: #f0f0f0;
}

.wisa-downloads-modal-body {
	padding: 12px 20px;
	overflow-y: auto;
}

.wisa-downloads-modal-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
}

.wisa-downloads-modal-row:last-child {
	border-bottom: none;
}

.wisa-downloads-modal-file-icon {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fef2f2;
	border-radius: 6px;
	flex-shrink: 0;
	color: #d63638;
}

.wisa-downloads-modal-filename {
	flex: 1;
	min-width: 0;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   Overview — Stacked Downloads (Multiple Werktekeningen)
   ========================================================================== */

.wisa-overview-downloads {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------
 * Kleurkaarten file icon (for PDFs in frontend)
 * ------------------------------------------------------------- */
.wisa-kleur-file-icon {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f9fafb;
	border: 1px solid #eee;
	border-radius: 4px;
	flex-shrink: 0;
	color: #d63638;
}
