/* ================================================================
   DIVI TIMBRES MODULE v2 — Stamp Catalog with Sidebar Filters
   ================================================================ */

/* ── Container ── */
.divi-timbres-container {
	font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	margin: 20px 0;
}

/* ── Layout: Sidebar + Grid ── */
.dt-layout {
	display: flex;
	gap: 30px;
	align-items: flex-start;
}

/* ── Filter Toggle (mobile only) ── */
.dt-filter-toggle {
	display: none;
	width: 100%;
	padding: 12px 20px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: 15px;
	text-align: left;
	transition: background 0.3s ease;
}
.dt-filter-toggle:hover {
	background: #005f8a;
}

/* ── Sidebar ── */
.dt-sidebar {
	flex: 0 0 250px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px;
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
}

.dt-sidebar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid #e5e7eb;
}

.dt-sidebar-header h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: #1f2937;
}

.dt-sidebar-close {
	display: none;
	background: none;
	border: none;
	font-size: 22px;
	color: #6b7280;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

/* ── Filter Groups ── */
.dt-filter-group {
	margin-bottom: 16px;
}

.dt-filter-group label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #374151;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.dt-filter-group select,
.dt-filter-group input[type="text"],
.dt-filter-group input[type="number"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	color: #374151;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dt-filter-group select:focus,
.dt-filter-group input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Order radio group */
.dt-order-group {
	display: flex;
	gap: 10px;
}
.dt-radio-label {
	display: flex !important;
	align-items: center;
	gap: 5px;
	font-size: 13px !important;
	font-weight: 400 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: #4b5563 !important;
	cursor: pointer;
}
.dt-radio-label input[type="radio"] {
	width: auto;
	margin: 0;
	accent-color: #0073aa;
}

/* Divider */
.dt-filter-divider {
	border: none;
	border-top: 1px solid #e5e7eb;
	margin: 16px 0;
}

/* Apply button */
.dt-apply-btn {
	width: 100%;
	padding: 10px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.3s ease, transform 0.1s ease;
}
.dt-apply-btn:hover {
	background: #005f8a;
}
.dt-apply-btn:active {
	transform: scale(0.98);
}

/* ── Grid Area ── */
.dt-grid-area {
	flex: 1;
	min-width: 0;
}

/* Results bar */
.dt-results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 15px;
	flex-wrap: wrap;
	gap: 10px;
}

.dt-results-count {
	font-size: 14px;
	color: #6b7280;
	font-weight: 500;
}

.dt-perpage-selector {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #6b7280;
}

.dt-perpage-selector select {
	padding: 4px 8px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 13px;
	color: #374151;
	background: #fff;
	cursor: pointer;
}

/* ── Stamp Grid ── */
.divi-timbres-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

/* ── Stamp Card ── */
.divi-timbre-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	display: flex;
	flex-direction: column;
}
.divi-timbre-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* Card Image */
.divi-timbre-media {
	position: relative;
	height: 200px;
	background: #f3f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.divi-timbre-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 10px;
	transition: transform 0.3s ease;
}
.divi-timbre-card:hover .divi-timbre-media img {
	transform: scale(1.05);
}
.dt-no-image {
	font-size: 48px;
	color: #d1d5db;
}

/* Condition Badge */
.dt-condition-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 5px 14px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.25);
	z-index: 5;
}

.dt-condition-badge.neuf,
.dt-condition-badge.mint {
	background: #10b981 !important;
	color: #fff !important;
	border: 1px solid #065f46 !important;
}

.dt-condition-badge.oblitere,
.dt-condition-badge.used {
	background: #1f2937 !important;
	color: #ffffff !important;
	border: 1px solid #000 !important;
}

/* Card Content */
.divi-timbre-content {
	padding: 15px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.meta-top {
	margin-bottom: 8px;
}

.collection-tag {
	background: #e1f0fa;
	color: #0073aa;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Title truncated at 3 lines */
.dt-card-title {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.4;
	max-height: calc(14px * 1.4 * 3);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
}

.dt-card-meta {
	margin: 0 0 6px;
	font-size: 12px;
	color: #6b7280;
}

.dt-card-ref {
	margin: 0;
	font-size: 12px;
	color: #6b7280;
}
.dt-card-ref strong {
	color: #374151;
}

/* ── No Results ── */
.dt-no-results {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
}
.dt-no-results p:first-child {
	font-size: 18px;
	font-weight: 600;
}

/* ── Pagination ── */
.divi-timbres-pagination {
	margin-top: 40px;
	text-align: center;
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}
.divi-timbres-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	background: #fff;
	color: #0073aa;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.2s ease;
}
.divi-timbres-pagination .page-numbers:hover {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}
.divi-timbres-pagination .page-numbers.current {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
	cursor: default;
}
.divi-timbres-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	color: #9ca3af;
}

/* ══════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════ */
.divi-lightbox {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0; top: 0; width: 100%; height: 100%;
	background-color: rgba(0,0,0,0.85);
	backdrop-filter: blur(5px);
	align-items: center;
	justify-content: center;
	animation: dtFadeIn 0.25s ease;
}

.divi-lightbox-inner {
	background: #fff;
	width: 92%;
	max-width: 950px;
	max-height: 90vh;
	border-radius: 14px;
	position: relative;
	overflow-y: auto;
	box-shadow: 0 25px 60px rgba(0,0,0,0.4);
	animation: dtZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	padding: 30px;
}

.divi-lightbox-body {
	display: flex;
	gap: 30px;
}

.close-lightbox {
	position: absolute;
	top: 12px; right: 18px;
	background: none;
	border: none;
	font-size: 28px;
	color: #9ca3af;
	cursor: pointer;
	z-index: 10;
	line-height: 1;
	transition: color 0.2s ease;
}
.close-lightbox:hover {
	color: #1f2937;
}

/* Lightbox image column */
.divi-lightbox-img-col {
	flex: 0 0 300px;
}
.dt-lb-img-wrapper {
	position: relative;
	width: 100%;
}
.divi-lightbox-img-col img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	cursor: zoom-in;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	object-fit: contain;
	transition: opacity 0.2s ease;
}
.divi-lightbox-img-col img:hover {
	opacity: 0.9;
}

/* Gallery navigation arrows */
.dt-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.7);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #1f2937;
	font-size: 18px;
	transition: all 0.2s ease;
	z-index: 5;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dt-lb-nav:hover {
	background: #fff;
	color: #0073aa;
	transform: translateY(-50%) scale(1.1);
}
.dt-lb-nav.prev { left: 10px; }
.dt-lb-nav.next { right: 10px; }

/* Image counter */
.dt-lb-counter {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	display: none;
	pointer-events: none;
}

/* Lightbox info column */
.divi-lightbox-info-col {
	flex: 1;
}
.divi-lightbox-info-col h2 {
	margin: 0 0 10px 0;
	font-size: 1.6rem;
	color: #1f2937;
	font-weight: 700;
}

/* Action buttons row in lightbox */
.dt-lb-action-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

/* Unified action buttons (Colnect + Share) */
.dt-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 16px;
	background: #0073aa;
	color: #fff !important;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.1s ease;
	font-family: inherit;
}
.dt-action-btn:hover {
	background: #005f8a;
	transform: translateY(-1px);
}
.dt-action-btn:active {
	transform: scale(0.97);
}

/* Toast notification */
.dt-toast {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: #059669;
	color: #fff;
	padding: 14px 24px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
	z-index: 99999999;
	animation: dtSlideUp 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}
.dt-toast.error {
	background: #ef4444;
}

@keyframes dtSlideUp {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}


/* ══════════════════════════════════════════
   ZOOM OVERLAY
   ══════════════════════════════════════════ */
.dt-zoom-overlay {
	display: none;
	position: fixed;
	z-index: 9999999;
	left: 0; top: 0;
	width: 100%; height: 100%;
	background: rgba(0, 0, 0, 0.95);
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
	animation: dtFadeIn 0.2s ease;
}
.dt-zoom-overlay img {
	max-width: 95%;
	max-height: 95vh;
	object-fit: contain;
	border-radius: 4px;
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes dtFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes dtZoomIn {
	from { transform: scale(0.92); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
	.divi-timbres-list {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 768px) {
	/* Sidebar becomes drawer */
	.dt-filter-toggle {
		display: block;
	}
	.dt-layout {
		flex-direction: column;
	}
	.dt-sidebar {
		display: none;
		position: fixed;
		top: 0; left: 0;
		width: 85%;
		max-width: 320px;
		height: 100vh;
		max-height: 100vh;
		z-index: 999998;
		border-radius: 0 12px 12px 0;
		box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
		animation: dtSlideRight 0.3s ease;
	}
	.dt-sidebar.open {
		display: block;
	}
	.dt-sidebar-close {
		display: block;
	}

	/* Grid */
	.divi-timbres-list {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	/* Lightbox */
	.divi-lightbox-body {
		flex-direction: column;
	}
	.divi-lightbox-img-col {
		flex: none !important;
		width: 100%;
		max-width: 250px;
		margin: 0 auto;
	}
	.divi-lightbox-info-col h2 {
		font-size: 1.3rem !important;
		margin-top: 10px;
	}
}

@media (max-width: 480px) {
	.divi-timbres-list {
		grid-template-columns: 1fr !important;
	}
}

@keyframes dtSlideRight {
	from { transform: translateX(-100%); }
	to { transform: translateX(0); }
}
