/* ================================================================
   DIVI 5 LIVRES MODULE — Premium Book Showcase styling
   ================================================================ */

/* ── Container ── */
.divi-livres-container {
	font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	margin: 25px 0;
	color: #1f2937;
}

/* ── 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: 14px 20px;
	background: #1f2937;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: 20px;
	text-align: left;
	transition: background 0.3s ease, transform 0.2s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.dt-filter-toggle:hover {
	background: #374151;
}

/* ── Sidebar Filter Panel ── */
.dt-sidebar {
	flex: 0 0 260px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	position: sticky;
	top: 90px;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
}

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

.dt-sidebar-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 800;
	color: #1f2937;
	letter-spacing: -0.5px;
}

.dt-sidebar-close {
	display: none;
	background: none;
	border: none;
	font-size: 24px;
	color: #9ca3af;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s ease;
}
.dt-sidebar-close:hover {
	color: #1f2937;
}

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

.dt-filter-group label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: #4b5563;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 8px;
}

.dt-filter-group select,
.dt-filter-group input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
	color: #374151;
	background: #f9fafb;
	transition: all 0.2s ease;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.dt-filter-group select:focus,
.dt-filter-group input:focus {
	outline: none;
	border-color: #1f2937;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.08);
}

/* Sorting order layout */
.dt-order-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.dt-radio-label {
	display: flex !important;
	align-items: center;
	gap: 8px;
	font-size: 13px !important;
	font-weight: 500 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: #374151 !important;
	cursor: pointer;
}
.dt-radio-label input[type="radio"] {
	margin: 0;
	width: 16px;
	height: 16px;
	accent-color: #1f2937;
	cursor: pointer;
}

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

/* Apply button styling */
.dt-apply-btn {
	width: 100%;
	padding: 12px;
	background: #1f2937;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 4px 12px rgba(31, 41, 55, 0.15);
}
.dt-apply-btn:hover {
	background: #374151;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(31, 41, 55, 0.2);
}
.dt-apply-btn:active {
	transform: scale(0.98);
}

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

/* Results counters bar */
.dt-results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
	background: #f9fafb;
	padding: 12px 20px;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
}

.dt-results-count {
	font-size: 14px;
	color: #4b5563;
	font-weight: 600;
}

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

.dt-perpage-selector select {
	padding: 6px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	color: #374151;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease;
}
.dt-perpage-selector select:hover {
	border-color: #9ca3af;
}

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

/* ── Book Card Portrait Layout ── */
.divi-book-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01), 0 2px 4px -1px rgba(0,0,0,0.01);
}
.divi-book-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
	border-color: #d1d5db;
}

/* Card image wrapper with specific portrait book aspect ratio */
.divi-book-card .divi-timbre-media {
	position: relative;
	height: 280px; /* Taller height for beautiful book portraits */
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-bottom: 1px solid #f3f4f6;
}

.divi-book-card .divi-timbre-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 16px;
	transition: transform 0.4s ease;
	filter: drop-shadow(0 6px 12px rgba(0,0,0,0.08));
}
.divi-book-card:hover .divi-timbre-media img {
	transform: scale(1.04) rotate(1deg);
}

.dt-no-image {
	font-size: 52px;
	color: #9ca3af;
	user-select: none;
}

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

.dt-condition-badge.neuf {
	background: #065f46 !important;
	color: #ffffff !important;
	border: 1px solid #047857 !important;
}

.dt-condition-badge.occasion {
	background: #374151 !important;
	color: #ffffff !important;
	border: 1px solid #4b5563 !important;
}

/* Card text content */
.divi-book-card .divi-timbre-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

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

.collection-tag {
	background: #f3f4f6;
	color: #4b5563;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: 1px solid #e5e7eb;
}

/* Truncated card titles */
.divi-book-card .dt-card-title {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 800;
	color: #111827;
	line-height: 1.4;
	max-height: calc(15px * 1.4 * 3);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
	letter-spacing: -0.2px;
}

.divi-book-card .dt-card-meta {
	margin: 0 0 10px;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.4;
	font-weight: 500;
}

.divi-book-card .dt-card-ref {
	margin: auto 0 0 0; /* Push to bottom of content block */
	font-size: 12px;
	color: #6b7280;
}
.divi-book-card .dt-card-ref strong {
	color: #374151;
}

/* ── Empty Results State ── */
.dt-no-results {
	text-align: center;
	padding: 80px 40px;
	color: #6b7280;
}
.dt-no-results p:first-child {
	font-size: 20px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 8px;
}

/* ── Custom pagination layout ── */
.divi-timbres-pagination {
	margin-top: 50px;
	text-align: center;
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}
.divi-timbres-pagination .page-numbers {
	display: inline-block;
	padding: 10px 16px;
	background: #fff;
	color: #1f2937;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.divi-timbres-pagination .page-numbers:hover {
	background: #1f2937;
	color: #fff;
	border-color: #1f2937;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.divi-timbres-pagination .page-numbers.current {
	background: #1f2937;
	color: #fff;
	border-color: #1f2937;
	cursor: default;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.divi-timbres-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	color: #9ca3af;
}

/* ══════════════════════════════════════════
   PREMIUM DETAILED LIGHTBOX
   ══════════════════════════════════════════ */
.divi-lightbox {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0; top: 0; width: 100%; height: 100%;
	background-color: rgba(17, 24, 39, 0.88);
	backdrop-filter: blur(10px);
	align-items: center;
	justify-content: center;
	animation: dtFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.divi-lightbox-inner {
	background: #ffffff;
	width: 94%;
	max-width: 980px;
	max-height: 88vh;
	border-radius: 24px;
	position: relative;
	overflow-y: auto;
	box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
	animation: dtZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	padding: 36px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.close-lightbox {
	position: absolute;
	top: 20px; right: 24px;
	background: #f3f4f6;
	border: none;
	font-size: 24px;
	color: #4b5563;
	cursor: pointer;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: all 0.2s ease;
	line-height: 1;
}
.close-lightbox:hover {
	background: #e5e7eb;
	color: #111827;
	transform: scale(1.05);
}

/* Image gallery column */
.divi-lightbox-img-col {
	flex: 0 0 340px;
}
.dt-lb-img-wrapper {
	position: relative;
	width: 100%;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	height: 440px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.divi-lightbox-img-col img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	cursor: zoom-in;
	padding: 16px;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.divi-lightbox-img-col img:hover {
	transform: scale(1.02);
}

/* Lightbox navigation arrows */
.dt-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: #ffffff;
	border: 1px solid #e5e7eb;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #111827;
	font-size: 16px;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 5;
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dt-lb-nav:hover {
	background: #111827;
	color: #ffffff;
	border-color: #111827;
	transform: translateY(-50%) scale(1.08);
}
.dt-lb-nav.prev { left: 14px; }
.dt-lb-nav.next { right: 14px; }

/* Image index counter indicator */
.dt-lb-counter {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(17, 24, 39, 0.75);
	backdrop-filter: blur(4px);
	color: #ffffff;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	display: none;
	pointer-events: none;
	letter-spacing: 0.5px;
}

/* Lightbox info details column */
.divi-lightbox-info-col {
	flex: 1;
}
.divi-lightbox-info-col h2 {
	margin: 0 0 12px 0;
	font-size: 1.8rem;
	color: #111827;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.5px;
}

/* Action share row */
.dt-lb-action-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.dt-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background: #1f2937;
	color: #fff !important;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	font-family: inherit;
	box-shadow: 0 2px 6px rgba(31, 41, 55, 0.1);
}
.dt-action-btn:hover {
	background: #374151;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(31, 41, 55, 0.2);
}
.dt-action-btn:active {
	transform: scale(0.97);
}

/* Toast popup messages */
.dt-toast {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: #059669;
	color: #fff;
	padding: 14px 26px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	z-index: 99999999;
	animation: dtSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid rgba(255,255,255,0.1);
}
.dt-toast.error {
	background: #dc2626;
}

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

/* ══════════════════════════════════════════
   FULLSCREEN IMAGE ZOOM
   ══════════════════════════════════════════ */
.dt-zoom-overlay {
	display: none;
	position: fixed;
	z-index: 9999999;
	left: 0; top: 0;
	width: 100%; height: 100%;
	background: rgba(17, 24, 39, 0.96);
	backdrop-filter: blur(8px);
	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: 8px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes dtFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes dtZoomIn {
	from { transform: scale(0.94); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE DESIGN ADAPTATIONS
   ══════════════════════════════════════════ */
@media (max-width: 1100px) {
	.divi-livres-list {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 20px;
	}
}

@media (max-width: 768px) {
	/* Sidebar becomes sliding 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 16px 16px 0;
		box-shadow: 10px 0 40px rgba(0, 0, 0, 0.25);
		animation: dtSlideRight 0.3s ease;
		border-left: none;
	}
	.dt-sidebar.open {
		display: block;
	}
	.dt-sidebar-close {
		display: block;
	}

	/* Card Grid adjustments */
	.divi-livres-list {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 16px;
	}
	.divi-book-card .divi-timbre-media {
		height: 230px; /* Slightly shorter cover column on tablets */
	}

	/* Lightbox adapt */
	.divi-lightbox-inner {
		padding: 24px;
		max-height: 90vh;
	}
	.divi-lightbox-body {
		flex-direction: column;
		gap: 20px;
	}
	.divi-lightbox-img-col {
		flex: none !important;
		width: 100%;
		max-width: 280px;
		margin: 0 auto;
	}
	.dt-lb-img-wrapper {
		height: 320px;
	}
	.divi-lightbox-info-col h2 {
		font-size: 1.4rem !important;
		margin-top: 10px;
	}
}

@media (max-width: 480px) {
	.divi-livres-list {
		grid-template-columns: 1fr !important;
	}
	.divi-book-card .divi-timbre-media {
		height: 280px; /* Return to beautiful size on portrait phones */
	}
}

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