/**
 * Bloc Offres Exclusives Styles
 *
 * Styles for the [bloc_offres_exclusives] shortcode with tabs, filters, and pagination.
 *
 * @package JMV_Child
 */

/* ==========================================================================
   1. CONTAINER
   ========================================================================== */

.boe-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: Montserrat, "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   2. PANEL INTRO
   ========================================================================== */

.boe-panel-intro {
	background: linear-gradient(135deg, #f8faff 0%, #eef3ff 100%);
	padding: 28px 32px;
	border-radius: 16px;
	margin-bottom: 24px;
}

.boe-panel-intro__eyebrow {
	margin: 0 0 8px 0;
	font-size: 12px;
	font-weight: 600;
	color: #3366ff;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.boe-panel-intro__title {
	margin: 0 0 8px 0;
	font-size: 26px;
	font-weight: 700;
	color: #0a1a66;
	line-height: 1.3;
}

.boe-panel-intro__subtitle {
	margin: 0;
	font-size: 15px;
	color: #5060a8;
	line-height: 1.5;
}

/* ==========================================================================
   3. TABS
   ========================================================================== */

.boe-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	padding: 6px;
	background: #f0f4ff;
	border-radius: 12px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.boe-tabs__tab {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #45518a;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all 200ms ease;
	white-space: nowrap;
}

.boe-tabs__tab:hover {
	background: rgba(255, 255, 255, 0.6);
	color: #1f2f6f;
}

.boe-tabs__tab:focus-visible {
	outline: 2px solid #3366ff;
	outline-offset: 2px;
}

.boe-tabs__tab--active {
	background: #ffffff;
	color: #0a1a66;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(8, 35, 115, 0.12);
}

.boe-tabs__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.boe-tabs__icon svg {
	width: 100%;
	height: 100%;
}

.boe-tabs__label {
	display: inline;
}

/* ==========================================================================
   4. CONTROLS (Filters + Sort)
   ========================================================================== */

.boe-controls {
	margin-bottom: 24px;
	padding: 24px;
	background: #ffffff;
	border: 1px solid #e5e9f4;
	border-radius: 16px;
	box-shadow: 0 2px 8px rgba(8, 35, 115, 0.04);
}

.boe-controls__header {
	margin-bottom: 20px;
}

.boe-controls__title {
	margin: 0 0 4px 0;
	font-size: 14px;
	font-weight: 700;
	color: #0a1a66;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.boe-controls__subtitle {
	margin: 0;
	font-size: 13px;
	color: #5060a8;
}

.boe-controls__body {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-start;
	justify-content: space-between;
}

.boe-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	flex: 1;
}

.boe-filter,
.boe-sort {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.boe-filter__label,
.boe-sort__label {
	font-size: 12px;
	font-weight: 600;
	color: #5060a8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ==========================================================================
   4b. CUSTOM DROPDOWNS
   ========================================================================== */

.boe-dropdown {
	position: relative;
	min-width: 200px;
}

.boe-dropdown__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
	background: #f5f7fc;
	border: 1px solid #e5e9f4;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.18s ease;
	font-family: inherit;
	text-align: left;
}

.boe-dropdown__trigger:hover {
	background: #eef1f9;
	border-color: #d0d8ed;
}

.boe-dropdown__trigger:focus {
	outline: none;
	border-color: #3366ff;
	box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.15);
}

.boe-dropdown__trigger--open {
	border-color: #3366ff;
	box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.15);
}

.boe-dropdown__content {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}

.boe-dropdown__value {
	font-size: 14px;
	font-weight: 500;
	color: #1f2f6f;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.boe-dropdown__hint {
	font-size: 11px;
	font-weight: 500;
	color: #7889c0;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.boe-dropdown__chevron {
	width: 18px;
	height: 18px;
	color: #5060a8;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.boe-dropdown__trigger--open .boe-dropdown__chevron {
	transform: rotate(180deg);
}

.boe-dropdown__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 100;
	padding: 0;
	background: #ffffff;
	border: 1px solid #e5e9f4;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(8, 35, 115, 0.15);
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: all 0.22s ease;
}

.boe-dropdown__menu--open {
	max-height: 320px;
	overflow-y: auto;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.boe-dropdown__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	font-size: 14px;
	color: #1f2f6f;
	cursor: pointer;
	transition: all 0.2s ease;
	list-style: none;
	border-left: 3px solid transparent;
	position: relative;
}

.boe-dropdown__option:first-child {
	border-radius: 11px 11px 0 0;
}

.boe-dropdown__option:last-child {
	border-radius: 0 0 11px 11px;
}

/* Séparateurs entre options */
.boe-dropdown__option:not(:last-child) {
	border-bottom: 1px solid #f0f4ff;
}

.boe-dropdown__option:hover {
	background: linear-gradient(90deg, #f5f8ff 0%, #ffffff 100%);
	border-left-color: #3366ff;
}

.boe-dropdown__option--selected {
	background: linear-gradient(90deg, #eef3ff 0%, #f8faff 100%);
	border-left-color: #3366ff;
	font-weight: 600;
	color: #0a1a66;
}

.boe-dropdown__option--selected:hover {
	background: linear-gradient(90deg, #e5ebf7 0%, #f0f4ff 100%);
}

/* Checkmark pour l'option sélectionnée */
.boe-dropdown__option--selected::after {
	content: '';
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233366ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	flex-shrink: 0;
	margin-left: 12px;
}

/* Structure pour options avec hint (dropdown tri) */
.boe-dropdown__option-content {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1;
	min-width: 0;
}

.boe-dropdown__option-label {
	font-size: 14px;
	font-weight: 500;
	color: #1f2f6f;
}

.boe-dropdown__option--selected .boe-dropdown__option-label {
	font-weight: 600;
	color: #0a1a66;
}

.boe-dropdown__option-hint {
	font-size: 11px;
	font-weight: 500;
	color: #7889c0;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Sort dropdown specific */
.boe-dropdown--sort {
	min-width: 260px;
}

/* ==========================================================================
   4. PAGINATION SUMMARY
   ========================================================================== */

.boe-pagination-summary {
	margin-bottom: 16px;
	padding: 0 4px;
}

.boe-pagination-summary__text {
	font-size: 14px;
	color: #5060a8;
}

.boe-pagination-summary__text strong {
	color: #0a1a66;
	font-weight: 600;
}

/* ==========================================================================
   5. CARDS CONTAINER
   ========================================================================== */

.boe-cards-container {
	min-height: 400px;
	position: relative;
}

.boe-cards-container--loading {
	opacity: 0.6;
	pointer-events: none;
}

/* The actual card grid uses bloc-voyage styles (.bv-wrapper) */

/* ==========================================================================
   6. PAGINATION CONTROLS
   ========================================================================== */

.boe-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
	padding: 16px 0;
}

.boe-pagination__btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: 1px solid #d0d8ed;
	border-radius: 8px;
	background: #ffffff;
	color: #1f2f6f;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 150ms ease;
}

.boe-pagination__btn:hover:not(:disabled) {
	background: #f0f4ff;
	border-color: #a8b5d6;
}

.boe-pagination__btn:focus-visible {
	outline: 2px solid #3366ff;
	outline-offset: 2px;
}

.boe-pagination__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.boe-pagination__btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.boe-pagination__btn-text {
	display: inline;
}

.boe-pagination__pages {
	display: flex;
	align-items: center;
	gap: 4px;
}

.boe-pagination__page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: #45518a;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 150ms ease;
}

.boe-pagination__page:hover:not(.boe-pagination__page--active) {
	background: #f0f4ff;
	color: #1f2f6f;
}

.boe-pagination__page:focus-visible {
	outline: 2px solid #3366ff;
	outline-offset: 2px;
}

.boe-pagination__page--active {
	background: #0a1a66;
	color: #ffffff;
	cursor: default;
}

/* ==========================================================================
   7. LOADING STATE
   ========================================================================== */

.boe-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	gap: 16px;
}

.boe-loading__spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e9f4;
	border-top-color: #3366ff;
	border-radius: 50%;
	animation: boe-spin 0.8s linear infinite;
}

@keyframes boe-spin {
	to {
		transform: rotate(360deg);
	}
}

.boe-loading__text {
	font-size: 14px;
	color: #5060a8;
}

/* ==========================================================================
   8. NO RESULTS STATE
   ========================================================================== */

.boe-no-results {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	gap: 16px;
	padding: 40px;
	text-align: center;
}

.boe-no-results__icon {
	width: 64px;
	height: 64px;
	color: #a8b5d6;
}

.boe-no-results__icon svg {
	width: 100%;
	height: 100%;
}

.boe-no-results__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1f2f6f;
}

.boe-no-results__text {
	margin: 0;
	font-size: 14px;
	color: #5060a8;
	max-width: 400px;
}

.boe-no-results__reset {
	margin-top: 8px;
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	background: #3366ff;
	color: #ffffff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.boe-no-results__reset:hover {
	background: #2952cc;
}

.boe-no-results__reset:focus-visible {
	outline: 2px solid #3366ff;
	outline-offset: 2px;
}

/* ==========================================================================
   9. ERROR STATE
   ========================================================================== */

.boe-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	gap: 16px;
	padding: 40px;
	text-align: center;
	background: #fff5f5;
	border: 1px solid #fecaca;
	border-radius: 10px;
}

.boe-error__icon {
	width: 48px;
	height: 48px;
	color: #dc2626;
}

.boe-error__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #991b1b;
}

.boe-error__text {
	margin: 0;
	font-size: 14px;
	color: #dc2626;
}

.boe-error__retry {
	margin-top: 8px;
	padding: 10px 20px;
	border: 1px solid #dc2626;
	border-radius: 8px;
	background: #ffffff;
	color: #dc2626;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 150ms ease;
}

.boe-error__retry:hover {
	background: #dc2626;
	color: #ffffff;
}

/* ==========================================================================
   10. RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
	.boe-container {
		padding: 16px;
	}

	/* Panel intro responsive */
	.boe-panel-intro {
		padding: 20px;
		margin-bottom: 16px;
	}

	.boe-panel-intro__title {
		font-size: 22px;
	}

	.boe-panel-intro__subtitle {
		font-size: 14px;
	}

	/* Tabs become scrollable on mobile */
	.boe-tabs {
		gap: 6px;
		padding: 4px;
		margin-bottom: 16px;
	}

	.boe-tabs__tab {
		padding: 10px 14px;
		font-size: 14px;
	}

	.boe-tabs__icon {
		width: 18px;
		height: 18px;
	}

	/* Controls stack on mobile */
	.boe-controls {
		padding: 16px;
	}

	.boe-controls__body {
		flex-direction: column;
		gap: 16px;
	}

	.boe-filters {
		flex-direction: column;
		width: 100%;
	}

	.boe-filter,
	.boe-sort {
		width: 100%;
	}

	.boe-dropdown {
		min-width: auto;
		width: 100%;
	}

	.boe-dropdown--sort {
		min-width: auto;
	}

	/* Pagination simplification on mobile */
	.boe-pagination {
		flex-wrap: wrap;
		gap: 6px;
	}

	.boe-pagination__btn-text {
		display: none;
	}

	.boe-pagination__btn {
		padding: 10px 12px;
	}

	.boe-pagination__pages {
		order: 2;
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
	}

	.boe-pagination__page {
		min-width: 36px;
		height: 36px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	/* Hide some page numbers on very small screens */
	.boe-pagination__page:not(.boe-pagination__page--active):not(:first-child):not(:last-child) {
		display: none;
	}

	/* Show ellipsis indicator */
	.boe-pagination__pages::before {
		content: '...';
		display: flex;
		align-items: center;
		padding: 0 8px;
		color: #5060a8;
		font-size: 14px;
	}

	.boe-pagination__pages::after {
		content: '...';
		display: flex;
		align-items: center;
		padding: 0 8px;
		color: #5060a8;
		font-size: 14px;
	}
}

/* ==========================================================================
   11. TRANSITIONS FOR JS UPDATES
   ========================================================================== */

.boe-cards-container .bv-wrapper {
	transition: opacity 200ms ease;
}

.boe-fade-enter {
	opacity: 0;
}

.boe-fade-enter-active {
	opacity: 1;
	transition: opacity 200ms ease;
}

.boe-fade-exit {
	opacity: 1;
}

.boe-fade-exit-active {
	opacity: 0;
	transition: opacity 200ms ease;
}

/* ==========================================================================
   12. FOCUS STATE OVERRIDES (Reset.css fix)

   The parent theme hello-elementor defines in reset.css:
   button:focus, button:hover { background-color: #c36; color: #fff; }

   These overrides prevent that pink/magenta color from appearing
   on our shortcode buttons.
   ========================================================================== */

/* General override for all buttons in the shortcode container */
.boe-container button:focus,
.boe-container button:hover {
	background-color: inherit !important;
	color: inherit !important;
}

/* Tabs focus/hover overrides */
.boe-tabs__tab:focus,
.boe-tabs__tab:hover {
	background-color: rgba(255, 255, 255, 0.6) !important;
	color: #1f2f6f !important;
}

.boe-tabs__tab:focus-visible {
	background-color: transparent !important;
	outline: 2px solid #3366ff;
	outline-offset: 2px;
}

.boe-tabs__tab--active:focus,
.boe-tabs__tab--active:hover {
	background-color: #ffffff !important;
	color: #0a1a66 !important;
}

/* Dropdown trigger focus/hover overrides */
.boe-dropdown__trigger:focus,
.boe-dropdown__trigger:hover {
	background-color: #eef1f9 !important;
	color: #1f2f6f !important;
}

.boe-dropdown__trigger--open,
.boe-dropdown__trigger--open:focus,
.boe-dropdown__trigger--open:hover {
	background-color: #f5f7fc !important;
	color: #1f2f6f !important;
}

/* Dropdown option focus (keyboard navigation) */
.boe-dropdown__option:focus,
.boe-dropdown__option:focus-visible {
	background: linear-gradient(90deg, #f5f8ff 0%, #ffffff 100%) !important;
	border-left-color: #3366ff !important;
	outline: none;
}

/* Pagination button overrides */
.boe-pagination__btn:focus,
.boe-pagination__btn:hover:not(:disabled) {
	background-color: #f0f4ff !important;
	color: #1f2f6f !important;
	border-color: #a8b5d6 !important;
}

.boe-pagination__page:focus,
.boe-pagination__page:hover:not(.boe-pagination__page--active) {
	background-color: #f0f4ff !important;
	color: #1f2f6f !important;
}

.boe-pagination__page--active:focus,
.boe-pagination__page--active:hover {
	background-color: #0a1a66 !important;
	color: #ffffff !important;
}

/* No results reset button override */
.boe-no-results__reset:focus,
.boe-no-results__reset:hover {
	background-color: #2952cc !important;
	color: #ffffff !important;
}

/* Error retry button override */
.boe-error__retry:focus,
.boe-error__retry:hover {
	background-color: #dc2626 !important;
	color: #ffffff !important;
}
