/*
Theme Name: StoryMagie
Theme URI: https://storymagie.com
Author: StoryMagie
Description: Thème sur mesure pour StoryMagie, livres personnalisés pour enfants. Compatible WooCommerce et TranslatePress (français / arabe).
Version: 1.1.7
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: storymagie
License: GPLv2 or later
*/

/* ---------- Couleurs et polices (charte StoryMagie) ---------- */
:root {
	--sm-teal: #2FA8A3;
	--sm-teal-dark: #1E7F7B;
	--sm-teal-pale: #E3F5F3;
	--sm-rose: #C93F6E;
	--sm-rose-dark: #A8305A;
	--sm-rose-pale: #FCE7EE;
	--sm-navy: #0E3558;
	--sm-yellow: #F5C24A;
	--sm-cream: #FFF8EE;
	--sm-peach: #FFF3EC;
	--sm-line: #F2E4D4;
	--sm-white: #FFFFFF;
	--sm-display: 'Fraunces', 'Tajawal', Georgia, serif;
	--sm-body: 'Quicksand', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--sm-radius: 26px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--sm-cream);
	color: var(--sm-navy);
	font-family: var(--sm-body);
	font-size: 17px;
	line-height: 1.6;
	font-weight: 500;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sm-navy); }
a:hover { color: var(--sm-rose); }
h1, h2, h3 { font-family: var(--sm-display); font-weight: 800; line-height: 1.1; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sm-teal); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.sm-skip { position: absolute; top: 8px; left: 16px; background: var(--sm-white); padding: 10px 16px; border-radius: 12px; z-index: 100; transform: translateY(-200%); }
.sm-skip:focus { transform: none; }
html, body { overflow-x: hidden; }
.sm-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sm-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sm-narrow { max-width: 820px; }
.sm-center { text-align: center; }
.sm-c-rose { color: var(--sm-rose); }
.sm-c-teal { color: var(--sm-teal-dark); }

/* ---------- Boutons ---------- */
.sm-btn,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 12px 26px; border-radius: 999px; border: 2px solid transparent;
	font-family: var(--sm-body); font-weight: 700; font-size: 17px; line-height: 1.2;
	text-decoration: none; cursor: pointer; transition: background-color .15s ease;
}
.sm-btn--rose,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt {
	background: var(--sm-rose); color: var(--sm-white);
}
.sm-btn--rose:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover {
	background: var(--sm-rose-dark); color: var(--sm-white);
}
.sm-btn--outline { border-color: var(--sm-navy); color: var(--sm-navy); background: transparent; }
.sm-btn--outline:hover { background: var(--sm-white); color: var(--sm-navy); }
.sm-btn--lg { min-height: 60px; padding: 16px 36px; font-size: 20px; }

/* ---------- Bandeau et en-tête ---------- */
.sm-announcement { background: var(--sm-rose); color: var(--sm-white); text-align: center; padding: 10px 16px; font-weight: 700; font-size: 15px; }
.sm-header-wrap { padding: 24px 24px 0; }
.sm-header-wrap--hero { background: var(--sm-peach); }
.sm-header {
	max-width: 1200px; margin: 0 auto; background: var(--sm-white); border: 1px solid #F3E2D8;
	border-radius: 999px; padding: 8px 14px 8px 28px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 5;
}
.sm-logo img, .custom-logo, .sm-header .custom-logo-link img { height: 60px !important; max-height: 60px; width: auto !important; max-width: 200px; object-fit: contain; }
.custom-logo-link { display: block; }
.sm-nav { display: flex; align-items: center; gap: 22px; }
.sm-menu, .sm-nav .menu { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.sm-menu a, .sm-nav .menu a { text-decoration: none; font-weight: 600; font-size: 17px; }
.sm-lang a { text-decoration: none; font-weight: 700; }
.sm-lang .trp-language-switcher { width: auto; }
.sm-cart { display: inline-flex; align-items: center; gap: 8px; padding: 6px; text-decoration: none; font-weight: 700; }
.sm-cart__icon { position: relative; display: inline-flex; }
.sm-cart__label { display: none; }
.sm-cart--mobile { display: none; margin-left: auto; }
.sm-langs { display: inline-flex; background: var(--sm-cream); border: 1px solid var(--sm-line); border-radius: 999px; padding: 3px; }
.sm-langs__item { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.sm-langs__item.is-active { background: var(--sm-navy); color: var(--sm-white); }
.sm-langs__item.is-active:hover { color: var(--sm-white); }
.sm-cart-count { position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--sm-yellow); color: var(--sm-navy); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.sm-menu-toggle { display: none; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.sm-menu-toggle__bars, .sm-menu-toggle__bars::before, .sm-menu-toggle__bars::after { display: block; width: 24px; height: 2.5px; background: var(--sm-navy); border-radius: 2px; margin: 0 auto; position: relative; content: ""; }
.sm-menu-toggle__bars::before { position: absolute; top: -8px; }
.sm-menu-toggle__bars::after { position: absolute; top: 8px; }

/* ---------- Hero ---------- */
.sm-hero { position: relative; overflow: hidden; background: var(--sm-peach); padding: 80px 24px 96px; text-align: center; }
.sm-hero__text { position: relative; max-width: 980px; margin: 0 auto; }
.sm-pill { display: inline-flex; align-items: center; gap: 8px; border: 2px solid #F3D7CF; background: #FFF8F4; padding: 10px 20px; border-radius: 999px; font-weight: 600; color: #8A3A55; }
.sm-hero__title { margin-top: 30px; font-size: clamp(42px, 6vw, 74px); line-height: 1.05; }
.sm-hero__lead { margin: 26px auto 0; max-width: 680px; font-size: 21px; }
.sm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }
.sm-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 26px 0 0; padding: 0; list-style: none; font-weight: 600; font-size: 15px; }
.sm-trust li { display: flex; align-items: center; gap: 8px; }
.sm-trust li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sm-teal); }

.sm-deco { position: absolute; }
.sm-deco--1 { top: 60px; left: 7%; }
.sm-deco--2 { top: 240px; right: 9%; }
.sm-deco--3 { top: 470px; left: 13%; }
.sm-deco--4 { top: 110px; right: 22%; }
.sm-deco--5 { bottom: 120px; right: 16%; }

.sm-covers { position: relative; max-width: 1000px; margin: 64px auto 0; display: flex; justify-content: center; align-items: flex-end; gap: 24px; }
.sm-cover { width: 230px; aspect-ratio: 1 / 1; border-radius: 10px 20px 20px 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; flex: none; }
.sm-cover img { width: 100%; height: 100%; object-fit: cover; }
.sm-cover--1 { transform: rotate(-5deg); }
.sm-cover--2 { width: 280px; }
.sm-cover--3 { transform: rotate(5deg); }
.sm-cover--teal { background: var(--sm-teal); }
.sm-cover--navy { background: var(--sm-navy); }
.sm-cover--yellow { background: var(--sm-yellow); }
.sm-cover__avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--sm-rose-pale); border: 4px solid var(--sm-yellow); }

/* ---------- Sections ---------- */
.sm-section { padding: 90px 0; }
.sm-bg-teal-pale { background: var(--sm-teal-pale); }
.sm-bg-rose-pale { background: var(--sm-rose-pale); }
.sm-h2 { font-size: clamp(32px, 4vw, 44px); }
.sm-lead { margin-top: 14px; font-size: 19px; }
.sm-center.sm-lead { margin-left: auto; margin-right: auto; max-width: 620px; }

.sm-split { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.sm-split__text { flex: 1 1 400px; min-width: 0; }
.sm-split__text .sm-btn { margin-top: 26px; }
.sm-beforeafter { flex: 1 1 460px; min-width: 0; display: flex; align-items: center; gap: 16px; }
.sm-beforeafter__card { flex: 1; aspect-ratio: 3 / 4; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sm-beforeafter__card--before { background: var(--sm-white); }
.sm-beforeafter__card--after { background: var(--sm-teal); color: #0B3B39; }

.sm-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; margin-top: 44px; }
.sm-story { background: var(--sm-white); border: 1px solid var(--sm-line); border-radius: var(--sm-radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; }
.sm-story:hover { border-color: var(--sm-rose); color: var(--sm-navy); }
.sm-story__img img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.sm-story__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.sm-story__title { font-family: var(--sm-display); font-weight: 800; font-size: 22px; line-height: 1.2; }
.sm-story__desc { font-size: 15px; }
.sm-story__price { margin-top: 6px; font-weight: 700; color: var(--sm-rose); }
.sm-empty { grid-column: 1 / -1; text-align: center; background: var(--sm-white); border: 2px dashed var(--sm-line); border-radius: var(--sm-radius); padding: 32px; }

.sm-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 44px 0 0; padding: 0; list-style: none; }
.sm-step { background: var(--sm-white); border-radius: var(--sm-radius); padding: 30px; }
.sm-step h3 { margin-top: 18px; font-size: 24px; }
.sm-step p { margin-top: 8px; }
.sm-step__num { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--sm-display); font-weight: 800; font-size: 24px; color: var(--sm-white); }
.sm-step__num--teal { background: var(--sm-teal-dark); }
.sm-step__num--rose { background: var(--sm-rose); }
.sm-step__num--yellow { background: var(--sm-yellow); color: var(--sm-navy); }
/* Guide en 6 étapes : 3 colonnes sur ordinateur, 2 sur tablette, 1 sur téléphone */
.sm-steps--6 { grid-template-columns: repeat(3, 1fr); }
.sm-steps--6 .sm-step h3 { font-size: 21px; }
@media (max-width: 980px) { .sm-steps--6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .sm-steps--6 { grid-template-columns: 1fr; } }

.sm-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; margin-top: 40px; text-align: center; }
.sm-values svg { margin: 0 auto; }
.sm-values h3 { margin-top: 12px; font-size: 24px; }
.sm-values p { margin-top: 6px; }

.sm-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 40px; }
.sm-zone { background: var(--sm-white); border-radius: var(--sm-radius); padding: 28px; }
.sm-zone h3 { font-size: 26px; }
.sm-zone p { margin-top: 10px; }
.sm-zone__delay { font-weight: 700; color: var(--sm-teal-dark); }

.sm-faq { display: flex; flex-direction: column; gap: 14px; margin-top: 36px; }
.sm-faq details { background: var(--sm-white); border: 1px solid var(--sm-line); border-radius: 20px; padding: 18px 22px; }
.sm-faq summary { font-weight: 700; font-size: 18px; cursor: pointer; }
.sm-faq details p { margin-top: 10px; }

.sm-final { background: var(--sm-peach); padding: 80px 24px; text-align: center; }
.sm-final .sm-btn { margin-top: 26px; }

/* ---------- Pied de page ---------- */
.sm-footer { background: var(--sm-white); color: var(--sm-navy); padding: 48px 0 28px; border-top: 6px solid var(--sm-teal); }
.sm-footer a { color: var(--sm-navy); }
.sm-footer a:hover { color: var(--sm-rose); }
.sm-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; }
.sm-footer__brand { display: flex; flex-direction: column; gap: 12px; }
.sm-footer__logo { display: inline-block; align-self: flex-start; }
.sm-footer__logo img, .sm-footer__logo .custom-logo { height: 70px; }
.sm-footer__menu { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; margin: 0; padding: 0; font-weight: 600; }
.sm-footer__social { display: flex; align-items: center; }
.sm-social { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.sm-social svg { flex-shrink: 0; }
.sm-footer__copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--sm-line); font-size: 14px; }

/* ---------- Pages et boutique ---------- */
.sm-page { padding-top: 56px; padding-bottom: 90px; }
.sm-page__title, .woocommerce-products-header__title { font-size: clamp(32px, 4vw, 46px); margin-bottom: 28px; }
.sm-content { max-width: 820px; }
.sm-content h2 { font-size: 30px; margin: 32px 0 12px; }
.sm-content p { margin-bottom: 16px; }

.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
	background: var(--sm-white); border: 1px solid var(--sm-line); border-radius: var(--sm-radius); padding: 0 0 20px; overflow: hidden; text-align: center;
}
.woocommerce ul.products li.product a img { margin: 0 0 14px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-family: var(--sm-display); font-weight: 800; font-size: 20px; color: var(--sm-navy); padding: 0 16px; }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--sm-rose); font-weight: 700; font-size: 18px; }
.woocommerce div.product .product_title { font-size: clamp(32px, 4vw, 46px); }
.woocommerce div.product div.images img { border-radius: var(--sm-radius); }
.woocommerce span.onsale { background: var(--sm-yellow); color: var(--sm-navy); font-weight: 700; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, .woocommerce .quantity .qty {
	border: 1.5px solid #D9CBBB; border-radius: 14px; padding: 12px 14px; background: var(--sm-white); font-family: var(--sm-body); font-size: 16px;
}
.woocommerce-message, .woocommerce-info { border-top-color: var(--sm-teal); background: var(--sm-white); border-radius: 0 0 14px 14px; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--sm-teal); }
.woocommerce-error { border-top-color: var(--sm-rose); }

/* Panier : champ code promo et miniature */
.woocommerce-cart table.cart td.actions .coupon .input-text { width: 200px; min-height: 48px; border: 1.5px solid #D9CBBB; border-radius: 999px; padding: 10px 18px; font-family: var(--sm-body); font-size: 16px; margin-right: 8px; }
.woocommerce-cart table.cart img, .woocommerce table.shop_table img { width: 96px; border-radius: 12px; }
.woocommerce table.shop_table { border-radius: 20px; background: var(--sm-white); }

/* Pages boutique en pleine largeur */
.woocommerce-account .sm-content, .woocommerce-cart .sm-content, .woocommerce-checkout .sm-content { max-width: none; }

/* Espace client */
.woocommerce-account .woocommerce { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
.woocommerce-account .woocommerce-MyAccount-navigation, .woocommerce-account .woocommerce-MyAccount-content { float: none; width: auto; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 10px; background: var(--sm-white); border: 1px solid var(--sm-line); border-radius: 22px; }
.woocommerce-MyAccount-navigation li a { display: block; padding: 11px 16px; border-radius: 14px; text-decoration: none; font-weight: 600; }
.woocommerce-MyAccount-navigation li a:hover { background: var(--sm-cream); color: var(--sm-navy); }
.woocommerce-MyAccount-navigation li.is-active a { background: var(--sm-rose-pale); color: var(--sm-rose-dark); }
.woocommerce-MyAccount-content h2, .woocommerce-MyAccount-content h3, .woocommerce-account .woocommerce-column__title { font-size: 26px; margin: 28px 0 12px; }
.woocommerce-account .woocommerce-customer-details address { background: var(--sm-white); border: 1px solid var(--sm-line); border-radius: 18px; padding: 16px 20px; font-style: normal; }
.woocommerce-account .woocommerce-orders-table .button { min-height: 40px; padding: 8px 20px; font-size: 15px; }
.woocommerce-account .woocommerce > *:not(.woocommerce-MyAccount-navigation):not(.woocommerce-MyAccount-content) { grid-column: 1 / -1; }
.woocommerce-account .woocommerce-MyAccount-navigation { grid-column: 1; }
.woocommerce-account .woocommerce-MyAccount-content { grid-column: 2; }
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 860px) {
	.woocommerce-account .woocommerce { grid-template-columns: 1fr; }
	.woocommerce-account .woocommerce-MyAccount-navigation, .woocommerce-account .woocommerce-MyAccount-content { grid-column: 1; }
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info::before { display: none; }
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info { padding-left: 24px; }

/* Boutique : grille régulière et tri */
.woocommerce ul.products, .woocommerce-page ul.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin: 24px 0 0; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { width: auto !important; float: none !important; margin: 0 !important; }
.woocommerce .woocommerce-result-count { margin: 6px 0 0; }
.woocommerce .woocommerce-ordering select { min-height: 44px; border: 1.5px solid #D9CBBB; border-radius: 999px; padding: 8px 16px; background: var(--sm-white); color: var(--sm-navy); font-family: var(--sm-body); font-size: 15px; font-weight: 600; }
@media (max-width: 720px) {
	.woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { float: none; width: 100%; margin: 8px 0 0; }
	.woocommerce .woocommerce-ordering select { width: 100%; }
	.woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: 1fr; }
}

/* Tranches d'âge */
.sm-section--tight { padding-bottom: 20px; }
.sm-ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 40px; }
.sm-age { display: flex; flex-direction: column; gap: 10px; padding: 28px; border-radius: var(--sm-radius); text-decoration: none; border: 2px solid transparent; transition: border-color .15s ease; }
.sm-age:hover { border-color: var(--sm-navy); color: var(--sm-navy); }
.sm-age--2-4 { background: #FFF1CC; }
.sm-age--5-7 { background: var(--sm-teal-pale); }
.sm-age--8-10 { background: var(--sm-rose-pale); }
.sm-age__range { align-self: flex-start; background: var(--sm-white); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.sm-age__title { font-family: var(--sm-display); font-weight: 800; font-size: 26px; line-height: 1.15; }
.sm-age__text { font-size: 16px; }
.sm-age__cta { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--sm-rose); }
.sm-age-badge { display: inline-block; align-self: flex-start; margin: 0 0 8px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.sm-age-badge--2-4 { background: #FFF1CC; color: #6B4E00; }
.sm-age-badge--5-7 { background: var(--sm-teal-pale); color: #135C59; }
.sm-age-badge--8-10 { background: var(--sm-rose-pale); color: #8A2A4C; }
.woocommerce ul.products li.product .sm-age-badge { margin: 0 16px 8px; align-self: center; }
html[dir="rtl"] .sm-age__cta { direction: rtl; }

/* Choix de l'âge dans le haut de l'accueil */
.sm-agepick { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.sm-agepick__q { font-family: var(--sm-display); font-weight: 800; font-size: 26px; }
.sm-agepick__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.sm-agepick__btn { min-width: 150px; padding: 16px 26px; border-radius: 999px; font-weight: 700; font-size: 19px; text-decoration: none; border: 2px solid transparent; text-align: center; }
.sm-agepick__btn--2-4 { background: #FFF1CC; }
.sm-agepick__btn--5-7 { background: var(--sm-teal-pale); }
.sm-agepick__btn--8-10 { background: var(--sm-rose-pale); }
.sm-agepick__btn:hover { border-color: var(--sm-navy); color: var(--sm-navy); }
.sm-agepick__all { font-weight: 700; color: var(--sm-rose); }

/* Onglets d'âge dans la boutique */
.sm-agetabs { clear: both; display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 0 6px; }
.sm-agetabs__tab { padding: 10px 20px; border-radius: 999px; background: var(--sm-white); border: 1.5px solid var(--sm-line); font-weight: 700; text-decoration: none; }
.sm-agetabs__tab:hover { border-color: var(--sm-navy); color: var(--sm-navy); }
.sm-agetabs__tab.is-active { background: var(--sm-navy); border-color: var(--sm-navy); color: var(--sm-white); }

/* Cartes de la boutique : boutons alignés en bas */
.woocommerce ul.products li.product { display: flex; flex-direction: column; }
/* Le lien (image, badge, titre, prix) occupe toute la hauteur : le prix descend en bas,
   juste au-dessus du bouton. Prix et boutons restent alignés même si un titre fait 2 lignes. */
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link { display: flex; flex-direction: column; align-items: center; flex: 1 1 auto; }
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link img { width: 100%; }
.woocommerce ul.products li.product .price { display: block; margin-top: auto; margin-bottom: 16px; padding-top: 6px; }
.woocommerce ul.products li.product .button { margin-top: 0; align-self: center; }

/* ---------- Version arabe (droite à gauche) ---------- */
html[dir="rtl"] body { font-family: 'Tajawal', var(--sm-body); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .sm-story__title { font-family: 'Tajawal', var(--sm-display); }
html[dir="rtl"] .sm-header { padding: 8px 28px 8px 14px; }
html[dir="rtl"] .sm-beforeafter svg { transform: scaleX(-1); }
html[dir="rtl"] .sm-cart-count { right: auto; left: -10px; }
html[dir="rtl"] .sm-cart--mobile { margin-left: 0; margin-right: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
	.sm-header { border-radius: 28px; padding: 8px 10px 8px 18px; flex-wrap: wrap; }
	.sm-menu-toggle { display: block; }
	.sm-cart--mobile { display: inline-flex; }
	.sm-cart--desktop { display: none; }
	.sm-langs { align-self: flex-start; }
	.sm-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 14px; padding: 8px 4px 14px; }
	.sm-nav.is-open { display: flex; }
	.sm-menu, .sm-nav .menu { flex-direction: column; align-items: flex-start; gap: 4px; }
	.sm-menu a, .sm-nav .menu a { display: block; padding: 10px 4px; }
	.sm-logo img, .custom-logo, .sm-header .custom-logo-link img { height: 50px !important; max-height: 50px; }
}
@media (max-width: 720px) {
	body { font-size: 16px; }
	.sm-hero { padding: 48px 20px 64px; }
	.sm-hero__lead { font-size: 18px; }
	.sm-btn--lg { width: 100%; }
	.sm-agepick__btn { flex: 1 1 100%; }
	.sm-covers { gap: 10px; margin-top: 44px; }
	.sm-cover { width: 30%; }
	.sm-cover--2 { width: 36%; }
	.sm-cover__avatar { width: 54px; height: 54px; }
	.sm-deco--3, .sm-deco--5 { display: none; }
	.sm-section { padding: 64px 0; }
}

/* ---------- Animations légères (désactivées si l'appareil demande moins d'animations) ---------- */
@media (prefers-reduced-motion: no-preference) {
	/* Étoiles qui scintillent doucement */
	@keyframes sm-twinkle { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .45; scale: .8; } }
	.sm-deco { animation: sm-twinkle 3.6s ease-in-out infinite; }
	.sm-deco--2 { animation-delay: .7s; animation-duration: 4.2s; }
	.sm-deco--3 { animation-delay: 1.4s; }
	.sm-deco--4 { animation-delay: 2.1s; animation-duration: 3s; }
	.sm-deco--5 { animation-delay: 2.8s; animation-duration: 4.6s; }

	/* Livres de l'accueil qui flottent légèrement */
	@keyframes sm-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
	.sm-cover { animation: sm-float 6s ease-in-out infinite; }
	.sm-cover--2 { animation-delay: -2s; }
	.sm-cover--3 { animation-delay: -4s; }

	/* Cartes qui se soulèvent au survol, comme un livre qu'on prend en main */
	.sm-story, .sm-age, .woocommerce ul.products li.product { transition: translate .25s ease, border-color .25s ease, box-shadow .25s ease; }
	.sm-story:hover, .sm-age:hover, .woocommerce ul.products li.product:hover { translate: 0 -6px; box-shadow: 0 14px 28px rgba(14, 53, 88, .10); }

	/* Apparition en fondu au défilement (classes ajoutées par assets/animations.js) */
	.sm-anim .sm-reveal { opacity: 0; translate: 0 24px; transition: none; }
	.sm-anim .sm-reveal.is-visible { opacity: 1; translate: 0 0; transition: opacity .7s ease, translate .7s ease; transition-delay: var(--sm-delay, 0ms); }

	/* Les numéros des étapes « s'allument » à leur arrivée */
	@keyframes sm-pop { 0% { scale: .4; } 70% { scale: 1.15; } 100% { scale: 1; } }
	.sm-anim .sm-step.is-visible .sm-step__num { animation: sm-pop .6s ease-out both; animation-delay: var(--sm-delay, 0ms); }
}

/* 1.1.6 : bouton « aperçu gratuit » de l'accueil et images avant / après */
.sm-hero__cta { margin: 6px 0 18px; }
.sm-beforeafter__card { position: relative; overflow: hidden; }
.sm-beforeafter__card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-beforeafter__label { position: absolute; bottom: 12px; inset-inline-start: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.92); color: #0E3558; font-size: 14px; font-weight: 700; }
