/* ==========================================================================
   Rideluck : styles globaux
   Les styles propres à chaque bloc sont dans blocks/<bloc>/style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens (couleurs et polices déduites des maquettes, à ajuster ici)
   -------------------------------------------------------------------------- */
:root {
	--rl-beige: #e7daca;
	--rl-noir: #282828;
	--rl-rouge: #982316;
	--rl-rouge-hover: #7c1c12;
	--rl-blanc: #fff;
	--rl-gris: #595959; /* 4,9:1 sur le beige, 7:1 sur le blanc (WCAG AA) */
	--rl-border: rgba(40, 40, 40, .25);

	--rl-font-title: "Oswald", "Arial Narrow", sans-serif;
	--rl-font-text: "DM Sans", system-ui, sans-serif;

	--rl-container: 1200px;
	--rl-section-y: clamp(3.5rem, 7vw, 6rem);
	--rl-header-h: 84px;
	--rl-radius: 0;

	/* Surcharge des variables Bootstrap */
	--bs-body-bg: var(--rl-beige);
	--bs-body-color: var(--rl-noir);
	--bs-body-font-family: var(--rl-font-text);
	--bs-body-font-size: .9375rem;
	--bs-body-line-height: 1.7;
	--bs-link-color: var(--rl-rouge);
	--bs-link-color-rgb: 152, 35, 22;
	--bs-link-hover-color: var(--rl-rouge-hover);
	--bs-link-hover-color-rgb: 124, 28, 18;
	--bs-border-radius: 0;
	--bs-primary: var(--rl-rouge);
	--bs-primary-rgb: 152, 35, 22;
	--bs-focus-ring-color: rgba(152, 35, 22, .35);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

/* Ancres (#avis, #newsletter…) : ne pas passer sous le header collant */
[id] { scroll-margin-top: calc(var(--rl-header-h) + 1rem); }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body {
	background: var(--rl-beige);
	color: var(--rl-noir);
	-webkit-font-smoothing: antialiased;
}

/* .container {
	max-width: calc(var(--rl-container) + 2 * 1rem);
} */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--rl-font-title);
	font-weight: 500;
	line-height: 1.15;
	color: inherit;
}

img { max-width: 100%; height: auto; }

a { text-underline-offset: .15em; }

:focus-visible {
	outline: 2px solid var(--rl-rouge);
	outline-offset: 2px;
}

/* Cible du lien d'évitement (tabindex=-1) : focus programmatique, sans contour */
#main:focus { outline: none; }

.rl-skip-link {
	position: absolute;
	z-index: 2000;
	top: .5rem;
	left: .5rem;
	padding: .5rem 1rem;
	background: var(--rl-blanc);
	color: var(--rl-noir);
}

/* --------------------------------------------------------------------------
   3. Typographie éditoriale (sur-titre, titre, mot surligné)
   -------------------------------------------------------------------------- */
.rl-eyebrow {
	margin-bottom: .5rem;
	font-family: var(--rl-font-title);
	font-size: clamp(1.25rem, 2vw, 1.5rem);
	font-weight: 400;
	line-height: 1.2;
}

.rl-title {
	margin-bottom: 1rem;
	font-family: var(--rl-font-title);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 500;
	line-height: 1.25;
	text-transform: uppercase;
}

.rl-title--xl {
	font-size: clamp(2.75rem, 7vw, 5rem);
	line-height: 1.25;
}

.hl {
	padding: 0 .15em;
	background: var(--rl-rouge);
	color: var(--rl-blanc);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.rl-lead { max-width: 34rem; }

/* Composant heading (template-parts/components/heading.php) */
.rl-heading--center { text-align: center; }

.rl-heading .rl-title:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Boutons
   -------------------------------------------------------------------------- */
.rl-btn {
	--bs-btn-padding-x: 1.75rem;
	--bs-btn-padding-y: .65rem;
	--bs-btn-font-family: var(--rl-font-text);
	--bs-btn-font-size: .8125rem;
	--bs-btn-font-weight: 500;
	--bs-btn-border-radius: 0;
	--bs-btn-border-width: 1px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.rl-btn--primary {
	--bs-btn-color: var(--rl-blanc);
	--bs-btn-bg: var(--rl-rouge);
	--bs-btn-border-color: var(--rl-rouge);
	--bs-btn-hover-color: var(--rl-blanc);
	--bs-btn-hover-bg: var(--rl-rouge-hover);
	--bs-btn-hover-border-color: var(--rl-rouge-hover);
	--bs-btn-active-bg: var(--rl-rouge-hover);
	--bs-btn-active-border-color: var(--rl-rouge-hover);
	--bs-btn-active-color: var(--rl-blanc);
}

.rl-btn--outline {
	--bs-btn-color: var(--rl-rouge);
	--bs-btn-bg: transparent;
	--bs-btn-border-color: var(--rl-rouge);
	--bs-btn-hover-color: var(--rl-blanc);
	--bs-btn-hover-bg: var(--rl-rouge);
	--bs-btn-hover-border-color: var(--rl-rouge);
	--bs-btn-active-bg: var(--rl-rouge);
	--bs-btn-active-color: var(--rl-blanc);
}

/* Contour sur fond sombre (hero) */
.rl-btn.rl-btn--on-dark {
	--bs-btn-color: var(--rl-blanc);
	--bs-btn-border-color: var(--rl-blanc);
}

/* Focus clavier : Bootstrap remplace le contour par une ombre basée sur --bs-btn-focus-shadow-rgb,
   que nos variantes ne définissent pas (ombre invalide = aucun focus visible). */
.rl-btn:focus-visible {
	outline: 2px solid var(--rl-rouge);
	outline-offset: 2px;
	box-shadow: none;
}

/* Contour de focus blanc sur les fonds sombres (rouge sur noir : contraste insuffisant) */
.rl-header :focus-visible,
.rl-section--dark :focus-visible,
.rl-block--hero :focus-visible,
.rl-block--newsletter-cta :focus-visible,
.rl-block--video-carousel :focus-visible { outline-color: var(--rl-blanc); }

/* Variante « sans majuscules » (ex. « Voir tous les produits ») */
.rl-btn--small {
	--bs-btn-padding-x: 1.25rem;
	--bs-btn-padding-y: .5rem;
	--bs-btn-font-size: .8125rem;
	letter-spacing: 0;
	text-transform: none;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.rl-header {
	position: sticky;
	z-index: 1030;
	top: 0;
	background: var(--rl-noir);
	color: var(--rl-blanc);
}

.admin-bar .rl-header { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .rl-header { top: 0; }
}

.rl-header__inner {
	display: flex;
	align-items: center;
	gap: 2rem;
	min-height: var(--rl-header-h);
}

.rl-logo {
	display: inline-flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.rl-logo__img {
	width: auto;
	max-height: 58px;
}

.rl-logo__text {
	font-family: var(--rl-font-title);
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.rl-nav__list,
.rl-header__actions,
.rl-offcanvas__list,
.rl-footer__list,
.rl-socials {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rl-nav__list {
	display: flex;
	gap: 1.75rem;
}

.rl-nav__list a,
.rl-header__action {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .5rem 0;
	color: var(--rl-blanc);
	font-family: var(--rl-font-title);
	font-size: .875rem;
	font-weight: 500;
	letter-spacing: .02em;
	text-decoration: none;
	text-transform: uppercase;
}

.rl-nav__list a:hover,
.rl-nav__list .current-menu-item > a,
.rl-nav__list .current_page_item > a,
.rl-header__action:hover {
	color: var(--rl-beige);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: .4em;
}

.rl-header__actions {
	display: flex;
	gap: 1.5rem;
	margin-left: auto;
}

.rl-header__action .rl-icon {
	width: 18px;
	height: 18px;
}

.rl-header__cart { position: relative; }

.rl-cart-badge {
	position: absolute;
	top: 0;
	right: -.6rem;
	min-width: 1rem;
	height: 1rem;
	padding: 0 .25rem;
	border-radius: 1rem;
	background: var(--rl-rouge);
	color: var(--rl-blanc);
	font-family: var(--rl-font-text);
	font-size: .625rem;
	font-weight: 700;
	line-height: 1rem;
	text-align: center;
}

.rl-cart-badge.is-empty { display: none; }

.rl-header__burger,
.rl-offcanvas__close {
	padding: .25rem;
	border: 0;
	background: none;
	color: inherit;
}

@media (max-width: 991.98px) {
	:root { --rl-header-h: 64px; }

	.rl-header__inner { gap: 1rem; }
	.rl-logo__img { max-height: 44px; }
	.rl-header__label { display: none; }
	.rl-header__actions { gap: 1.25rem; }
}

/* Menu mobile */
.rl-offcanvas {
	--bs-offcanvas-bg: var(--rl-noir);
	--bs-offcanvas-color: var(--rl-blanc);
	--bs-offcanvas-width: min(320px, 85vw);
}

.rl-offcanvas__close { margin-left: auto; }

.rl-offcanvas__list a {
	display: block;
	padding: .75rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, .15);
	color: var(--rl-blanc);
	font-family: var(--rl-font-title);
	font-size: 1.25rem;
	text-decoration: none;
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.rl-footer {
	padding: 4rem 0 3rem;
	background: var(--rl-beige);
	font-size: .875rem;
}

.rl-logo--footer .rl-logo__img { max-height: 110px; }

.rl-socials {
	display: flex;
	gap: .6rem;
	margin-top: 1.25rem;
}

.rl-socials a {
	display: inline-flex;
	color: var(--rl-noir);
}

.rl-socials a:hover { color: var(--rl-rouge); }

.rl-socials .rl-icon {
	width: 20px;
	height: 20px;
}

.rl-footer__title {
	margin-bottom: 1rem;
	font-family: var(--rl-font-text);
	font-size: .875rem;
	font-weight: 700;
	text-transform: uppercase;
}

.rl-footer__list li + li { margin-top: .6rem; }

.rl-footer__list a {
	color: var(--rl-noir);
	text-decoration: none;
}

.rl-footer__list a:hover {
	color: var(--rl-rouge);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. Pages et contenu Gutenberg
   -------------------------------------------------------------------------- */
.rl-section { padding-block: var(--rl-section-y); }

.rl-section--dark {
	background: var(--rl-noir);
	color: var(--rl-blanc);
}

.rl-page__header { padding-top: var(--rl-section-y); }

.rl-page__title {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	text-transform: uppercase;
}

/* Le contenu texte (hors blocs Rideluck) est contraint en largeur et aligné à gauche du
   conteneur (même bord que le titre de page et les blocs : marge latérale du .container) */
.entry-content > :not([class*="rl-block"]):not(.alignfull):not(.alignwide) {
	max-width: calc(820px + 1.5rem);
	margin-inline: max(0px, calc((100% - var(--rl-container) - 2rem) / 2)) auto;
	padding-inline: .75rem;
}

.entry-content > ul:not([class*="rl-block"]):not(.alignfull):not(.alignwide),
.entry-content > ol:not([class*="rl-block"]):not(.alignfull):not(.alignwide) { padding-left: 2.25rem; }

.entry-content > .wp-block-buttons { margin-bottom: 1.5rem; }

.entry-content > .alignwide {
	max-width: var(--rl-container);
	margin-inline: auto;
	padding-inline: 1rem;
}

.entry-content > :not([class*="rl-block"]):last-child { margin-bottom: var(--rl-section-y); }

.entry-content > h2:not([class*="rl-block"]),
.entry-content > h3:not([class*="rl-block"]) {
	margin-top: 2.5rem;
	text-transform: uppercase;
}

/* Bloc Détails (core/details) : questions de la FAQ, même esprit que l'accordéon produit */
.entry-content > .wp-block-details {
	margin-block: 0;
	border-top: 1px solid var(--rl-noir);
}

.entry-content > .wp-block-details:not(:has(+ .wp-block-details)) {
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--rl-noir);
}

.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
	font-weight: 500;
	list-style: none;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker { display: none; }

.wp-block-details > summary::after {
	flex-shrink: 0;
	width: .55rem;
	height: .55rem;
	margin-right: .25rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	content: "";
	transform: translateY(-25%) rotate(45deg);
	transition: transform .2s;
}

.wp-block-details[open] > summary::after { transform: translateY(25%) rotate(-135deg); }

.wp-block-details > summary:hover { color: var(--rl-rouge); }

.wp-block-details > :not(summary) { margin-bottom: 1rem; }

/* Boutons Gutenberg (core/buttons) : même style que les boutons du thème */
.entry-content .wp-block-button__link {
	padding: .8rem 1.75rem;
	border: 1px solid var(--rl-rouge);
	border-radius: 0;
	background: var(--rl-rouge);
	color: var(--rl-blanc);
	font-size: .8125rem;
	font-weight: 500;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.entry-content .wp-block-button__link:hover {
	border-color: var(--rl-rouge-hover);
	background: var(--rl-rouge-hover);
	color: var(--rl-blanc);
}

.entry-content .wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: var(--rl-rouge);
	background: transparent;
	color: var(--rl-rouge);
}

.entry-content .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--rl-rouge);
	color: var(--rl-blanc);
}

.rl-404 { padding-block: calc(var(--rl-section-y) * 1.5); }

/* --------------------------------------------------------------------------
   8. WooCommerce (base, affinée en phase 4)
   -------------------------------------------------------------------------- */
.rl-woo .woocommerce-products-header__title,
.woocommerce-account .rl-page__title,
.woocommerce-cart .rl-page__title,
.woocommerce-checkout .rl-page__title {
	text-transform: uppercase;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	border-radius: 0;
	background: var(--rl-noir);
	color: var(--rl-blanc);
	font-weight: 500;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce :where(a.button, button.button).checkout-button {
	background: var(--rl-rouge);
	color: var(--rl-blanc);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--rl-rouge-hover);
	color: var(--rl-blanc);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-top-color: var(--rl-rouge);
	background: var(--rl-blanc);
}

.woocommerce-message::before,
.woocommerce-info::before { color: var(--rl-rouge); }

/* Woo donne le focus aux notices (tabindex=-1) pour les lecteurs d'écran : pas de contour visuel */
.woocommerce-notices-wrapper [tabindex="-1"]:focus,
.woocommerce-message[tabindex="-1"]:focus { outline: none; }

/* Champ quantité avec boutons − / + (woocommerce/global/quantity-input.php) */
.woocommerce .quantity.rl-qty {
	display: inline-flex;
	align-items: stretch;
	height: 3rem;
	border: 1px solid var(--rl-noir);
	background: var(--rl-blanc);
}

.woocommerce .quantity.rl-qty .qty {
	width: 3rem;
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--rl-noir);
	font-weight: 500;
	text-align: center;
	-moz-appearance: textfield;
}

.woocommerce .quantity.rl-qty .qty::-webkit-inner-spin-button,
.woocommerce .quantity.rl-qty .qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.rl-qty__btn {
	display: inline-grid;
	width: 2.5rem;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--rl-noir);
}

.rl-qty__btn:hover { color: var(--rl-rouge); }

.rl-qty__btn .rl-icon {
	width: 16px;
	height: 16px;
}

/* --------------------------------------------------------------------------
   9. Carrousels : navigation partagée (template-parts/components/slider-nav.php)
   -------------------------------------------------------------------------- */
.rl-slider-nav {
	--rl-nav-color: var(--rl-noir);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 2rem;
}

.rl-slider-nav--light { --rl-nav-color: var(--rl-blanc); }

.rl-slider-nav__btn {
	display: inline-grid;
	width: 2.75rem;
	height: 2.75rem;
	place-items: center;
	padding: 0;
	border: 1px solid var(--rl-nav-color);
	border-radius: 50%;
	background: transparent;
	color: var(--rl-nav-color);
	transition: background-color .15s, color .15s;
}

.rl-slider-nav__btn:hover:not(:disabled) {
	border-color: var(--rl-rouge);
	background: var(--rl-rouge);
	color: var(--rl-blanc);
}

.rl-slider-nav__btn:disabled { opacity: .35; }

.rl-slider-nav__btn .rl-icon {
	width: 18px;
	height: 18px;
}

.rl-slider-nav__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
	width: auto !important; /* Swiper force width:100% sur .swiper-pagination-horizontal */
}

.rl-slider-nav__dots .swiper-pagination-bullet {
	width: .625rem;
	height: .625rem;
	margin: 0 !important;
	border: 1px solid var(--rl-nav-color);
	background: transparent;
	opacity: 1;
}

.rl-slider-nav__dots .swiper-pagination-bullet-active {
	border-color: var(--rl-rouge);
	background: var(--rl-rouge);
}

/* Navigation inutile (une seule page de slides) */
.rl-slider-nav .swiper-button-lock,
.rl-slider-nav .swiper-pagination-lock { display: none; }

/* Étoiles de notation (témoignages, avis produits) */
.rl-stars {
	display: inline-flex;
	gap: .15rem;
	color: var(--rl-rouge);
}

.rl-stars .rl-icon {
	width: 18px;
	height: 18px;
}

.rl-stars .is-empty { color: rgba(40, 40, 40, .2); }

/* --------------------------------------------------------------------------
   10. Carte produit (template-parts/components/product-card.php)
   -------------------------------------------------------------------------- */
.rl-product-card {
	position: relative;
	height: 100%;
}

.rl-product-card__media {
	position: relative;
	overflow: hidden;
	margin-bottom: 1rem;
	background: var(--rl-blanc);
}

.rl-product-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: contain;
	transition: transform .4s ease;
}

.rl-product-card:hover .rl-product-card__img { transform: scale(1.04); }

.rl-product-card.is-out-of-stock .rl-product-card__img { opacity: .6; }

.rl-product-card__badge {
	position: absolute;
	top: .75rem;
	left: .75rem;
	padding: .2rem .6rem;
	background: var(--rl-rouge);
	color: var(--rl-blanc);
	font-size: .75rem;
	font-weight: 500;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.rl-product-card__badge--muted { background: var(--rl-noir); }

.rl-product-card__title {
	margin-bottom: .25rem;
	font-family: var(--rl-font-title);
	font-size: 1.125rem;
	font-weight: 500;
	text-transform: uppercase;
}

.rl-product-card__link {
	color: inherit;
	text-decoration: none;
}

.rl-product-card__link:hover { color: var(--rl-rouge); }

.rl-product-card__variant {
	margin-bottom: .25rem;
	color: var(--rl-gris);
	font-size: .875rem;
}

.rl-product-card__price {
	margin: 0;
	font-weight: 700;
}

.rl-product-card__price del {
	margin-right: .35rem;
	color: var(--rl-gris);
	font-weight: 400;
}

.rl-product-card__price ins { text-decoration: none; }

/* --------------------------------------------------------------------------
   11. Boutique (woocommerce/archive-product.php)
   -------------------------------------------------------------------------- */
.rl-shop .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 2rem; }
