/*
Theme Name: MAYA Child
Theme URI: https://mayaconfort.com
Description: Thème enfant d'Astra pour la boutique MAYA (identité, WooCommerce, en-tête et pied de page).
Author: MAYA
Template: astra
Version: 1.0.0
Text Domain: maya-child
*/

/* ---------- Police Nunito, hébergée localement ---------- */
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 200 1000;
	font-display: swap;
	src: url('fonts/nunito-latin-wght-normal.woff2') format('woff2');
}

/* ---------- Variables d'identité (CLAUDE.md §6) ---------- */
:root {
	--maya-navy: #1F3A5F;
	--maya-coral: #B5533A;
	--maya-coral-dark: #9C4630;
	--maya-sand: #F7F2EC;
	--maya-sage: #DCE7DD;
	--maya-text: #22262B;
	--maya-muted: #5B6470;
	--maya-border: #E4DED5;
	--maya-radius: 12px;
}

body,
button,
input,
select,
textarea,
.ast-button,
.button {
	font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--maya-text);
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.woocommerce-loop-product__title {
	font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--maya-navy);
	font-weight: 800;
}

a { color: var(--maya-navy); }
a:hover, a:focus { color: var(--maya-coral); }

/* ---------- En-tête ---------- */
.site-header,
.main-header-bar,
.ast-primary-header-bar {
	background: #fff;
	border-bottom: 1px solid var(--maya-border);
}

/* Mot-symbole MAYA (texte) */
.site-title,
.site-title a {
	font-family: 'Nunito', system-ui, sans-serif;
	font-weight: 800;
	letter-spacing: 0.08em;
	color: var(--maya-navy);
	text-transform: uppercase;
	font-size: 28px;
	line-height: 1;
}
.site-title a:hover { color: var(--maya-navy); }
.ast-site-identity .site-description { display: none; }

/* Logo image (3.C) : 48 px de haut sur ordinateur, 40 px sur mobile. L'image est rognée aux bords du dessin,
   donc la hauteur de l'image est la hauteur visible. Le titre texte reste dans la page (SEO) mais n'est
   affiché que si l'image ne charge pas (classe maya-logo-failed ajoutée par un petit script). */
.site-header .custom-logo-link img,
.ast-site-identity .custom-logo {
	height: 48px;
	width: auto;
	max-width: none;
	max-height: 48px;
	display: block;
}
@media (max-width: 767px) {
	.site-header .custom-logo-link img,
	.ast-site-identity .custom-logo { height: 40px; max-height: 40px; }
}
body:not(.maya-logo-failed) .ast-site-identity .site-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.ast-site-identity { display: flex; align-items: center; }
body.maya-logo-failed .site-header .custom-logo-link { display: none; }

/* Menu principal sur une seule ligne malgré le logo plus large (ordinateur et tablette large). */
@media (min-width: 1240px) {
	.ast-builder-menu-1 .main-header-menu { flex-wrap: nowrap; }
	.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
		white-space: nowrap;
		padding-left: 0.75em;
		padding-right: 0.75em;
		font-size: 15px;
	}
}
/* Entre 922 et 1239 px : pas assez de place pour une seule ligne, le menu peut passer sur deux lignes (sans débordement). */
@media (min-width: 922px) and (max-width: 1239px) {
	.ast-builder-menu-1 .main-header-menu { flex-wrap: wrap; justify-content: center; }
	.ast-builder-menu-1 .main-header-menu > .menu-item { height: auto; }
	.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
		padding-left: 0.55em;
		padding-right: 0.55em;
		font-size: 14px;
		line-height: 36px;
		height: 36px;
	}
}

/* Copyright du pied de page lisible sur le fond bleu nuit */
.site-footer .ast-footer-copyright,
.site-footer .ast-footer-copyright p,
.site-footer .ast-footer-copyright a { color: #fff; }

/* Icône du panier : boîte compacte (la hauteur de ligne héritée du menu l'étirait à plus de 55 px). */
.site-header .ast-site-header-cart .cart-container { line-height: 1; }
.site-header .ast-site-header-cart .ast-addon-cart-wrap { line-height: 1; }
.site-header .ast-site-header-cart .ast-addon-cart-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 40px;
	min-width: 40px;
	padding: 0 8px;
}

/* Pied de page : marge de 20 px de chaque côté (le texte touchait le bord de l'écran). */
.site-footer .ast-builder-grid-row {
	padding-left: 20px;
	padding-right: 20px;
	box-sizing: border-box;
}

/* Logo blanc du pied de page */
.maya-footer-logo-wrap { text-align: center; }
.maya-footer-logo { height: 40px; width: auto; max-width: 100%; display: inline-block; vertical-align: middle; }

.main-header-menu a,
.ast-header-account-wrap a,
.ast-header-html-1 a {
	color: var(--maya-navy);
	font-weight: 700;
}
.main-header-menu a:hover,
.main-header-menu .current-menu-item > a { color: var(--maya-coral); }

.maya-header-account {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
}
.maya-header-account svg { width: 22px; height: 22px; }

/* ---------- Pied de page ---------- */
.site-footer,
.site-footer .site-primary-footer-wrap,
.site-footer .site-below-footer-wrap,
.site-footer .site-above-footer-wrap {
	background: var(--maya-navy) !important;
	background-color: var(--maya-navy) !important;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.15);
}
.site-footer .ast-builder-grid-row-container-inner { background: transparent; }
.site-footer { padding-bottom: 72px; } /* laisse la place au bouton WhatsApp flottant */
.site-footer .site-below-footer-wrap { border-top: 1px solid rgba(255, 255, 255, 0.15); }

/* Icône panier et recherche : bleu nuit */
.ast-site-header-cart a,
.ast-site-header-cart .ast-cart-menu-wrap,
.ast-header-search .ast-search-icon { color: var(--maya-navy); }
.ast-site-header-cart .ast-cart-menu-wrap .count { border-color: var(--maya-navy); color: var(--maya-navy); }
.site-footer a,
.site-footer .widget-title,
.site-footer h2,
.site-footer h3 { color: #fff; }
.site-footer a:hover { color: var(--maya-sage); }
.site-footer .widget_nav_menu ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget_nav_menu li { margin: 0 0 8px; }
.maya-footer-contact { text-align: center; font-size: 15px; }
.maya-footer-contact a { text-decoration: underline; }

/* ---------- WooCommerce ---------- */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	background: #fff;
	border: 1px solid var(--maya-border);
	border-radius: var(--maya-radius);
	padding: 12px;
	box-shadow: none;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 16px;
	line-height: 1.3;
}
.woocommerce ul.products li.product img { border-radius: 8px; }
.woocommerce .price,
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	font-weight: 800;
	color: var(--maya-navy);
}

/* Boutons d'achat : corail foncé, texte blanc */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.ast-button,
.single_add_to_cart_button {
	background: var(--maya-coral);
	color: #fff;
	border: 0;
	border-radius: var(--maya-radius);
	font-weight: 800;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.single_add_to_cart_button:hover {
	background: var(--maya-coral-dark);
	color: #fff;
}

/* Champs de formulaire */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	border: 1px solid var(--maya-border);
	border-radius: var(--maya-radius);
	padding: 12px 14px;
}

/* Pastilles de variantes arrondies */
.woocommerce .variations .swatch,
.woocommerce .variations .cfvsw-swatches-option,
.cfvsw-swatches-option {
	border-radius: 999px !important;
}

/* ---------- Hero de l'accueil (image + texte sur la moitié gauche vide) ---------- */
.maya-hero { position: relative; overflow: hidden; isolation: isolate; }
.maya-hero .maya-hero-bg { margin: 0; }
.maya-hero .maya-hero-bg img { display: block; width: 100%; height: auto; }
@media (min-width: 782px) {
	.maya-hero { min-height: 480px; display: flex; align-items: center; }
	.maya-hero .maya-hero-bg { position: absolute; inset: 0; z-index: -1; max-width: none; }
	.maya-hero .maya-hero-bg img { height: 100%; object-fit: cover; object-position: right 62%; }
	.maya-hero .wp-block-columns { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
	.maya-hero .wp-block-column { flex-basis: 44% !important; flex-grow: 0; }
}
/* Largeurs intermédiaires : les meubles de l'image commencent à 38 % de la largeur, la colonne de texte reste en deçà. */
@media (min-width: 782px) and (max-width: 1239px) {
	.maya-hero .wp-block-column { flex-basis: calc(36vw - 36px) !important; }
}

/* Bouton secondaire du hero : bleu nuit sur fond légèrement blanc (le corail sur le mur beige n'atteignait pas 4,5:1). */
.maya-hero .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--maya-navy) !important;
	border-color: var(--maya-navy) !important;
	background: rgba(255, 255, 255, 0.6) !important;
}
.maya-hero .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--maya-navy) !important;
	color: #fff !important;
}

/* Mobile : le texte d'abord, puis l'image avec les meubles visibles (cadrage sur la moitié droite de l'image). */
@media (max-width: 781px) {
	.maya-hero { display: flex; flex-direction: column; }
	.maya-hero .maya-hero-bg { order: 2; margin-top: 24px; }
	.maya-hero .wp-block-columns { order: 1; }
	.maya-hero .maya-hero-bg img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 82% 62%; border-radius: var(--maya-radius); }
}

/* ---------- Page d'accueil ---------- */
.maya-hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin-bottom: 16px; }
.maya-hero .wp-block-buttons { margin-top: 24px; gap: 12px; }
.maya-hero-photo {
	min-height: 280px;
	border-radius: var(--maya-radius);
	background: var(--maya-sage);
}
.wp-block-button__link { border-radius: var(--maya-radius); font-weight: 800; padding: 12px 22px; background: var(--maya-coral); color: #fff; }
.wp-block-button__link:hover { background: var(--maya-coral-dark); color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--maya-navy);
	border: 2px solid var(--maya-navy);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--maya-navy); color: #fff; }
.maya-reassure-icon { text-align: center; }
.maya-reassure p { margin-top: 8px; font-weight: 700; color: var(--maya-navy); }
.maya-cats { gap: 12px; }
.maya-best-section ul.products,
.maya-sleep-section ul.products { margin-top: 24px; }
.wp-block-details { border: 1px solid var(--maya-border); border-radius: var(--maya-radius); background: #fff; padding: 14px 18px; margin-bottom: 12px; }
.wp-block-details summary { font-weight: 800; color: var(--maya-navy); cursor: pointer; }
@media (max-width: 781px) {
	.maya-reassure { flex-wrap: wrap !important; }
	.maya-reassure > .wp-block-column { flex-basis: calc(50% - 16px) !important; flex-grow: 0; }
	.maya-hero-photo { min-height: 180px; }
}

/* Sections de fond sable ou sauge (blocs de l'accueil) */
.has-maya-sand-background-color { background-color: var(--maya-sand); }
.has-maya-sage-background-color { background-color: var(--maya-sage); }

/* Mobile : pastilles de variantes (Couleur, Dimensions, Forme).
   Retour à la ligne autorisé, 8 px entre chaque pastille, boutons texte d'au moins 44 px de haut,
   aucun chevauchement (l'extension les colle bord à bord et interdit le retour à la ligne). */
@media (max-width: 767px) {
	.woocommerce div.product form.variations_form .tawcvs-swatches {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		width: 100%;
		max-width: 100%;
	}
	.woocommerce div.product form.variations_form .tawcvs-swatches .swatch-item-wrapper {
		margin: 0;
		max-width: 100%;
	}
	.woocommerce div.product form.variations_form .tawcvs-swatches .swatch-item-wrapper .swatch.swatch-type-label,
	.woocommerce div.product form.variations_form .tawcvs-swatches .swatch-item-wrapper .swatch.swatch-label {
		box-sizing: border-box;
		min-height: 44px;
		height: auto;
		min-width: 44px;
		padding: 8px 14px;
		margin: 0;
		line-height: 1.25;
		white-space: normal;
		text-align: center;
		justify-content: center;
		align-items: center;
	}
}

/* Mobile : Astra gère déjà 2 colonnes (grille). Ne pas forcer de largeur sur les cartes
   (une ancienne règle width:48% réduisait chaque carte à 48 % de sa colonne). */
@media (max-width: 544px) {
	.woocommerce ul.products li.product { width: auto; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 15px; }
}
