/*
Theme Name:   CVVB
Description:  Thème du Centre de Vol à Voile de Villefranche en Beaujolais (enfant de Twenty Twenty-Five).
Template:     twentytwentyfive
Version:      1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain:  cvvb
*/

/* ── En-tête collant ─────────────────────────────────────────────────────── */
.cvvb-entete {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: saturate(160%) blur(8px);
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent) !important;
	border-bottom: 1px solid var(--wp--preset--color--ligne);
}
.admin-bar .cvvb-entete { top: var(--wp-admin--admin-bar--height, 32px); }
.cvvb-entete__barre { margin-top: 0.7rem !important; }
.cvvb-logo > figure { flex-shrink: 0; }   /* le logo reste rond quand la place manque */

/* Bandeau « Vous avez un bon ? » en haut de toutes les pages */
.cvvb-bandeau-bon {
	background: var(--wp--preset--color--nuit);
	color: #fff;
	gap: 0.4rem 1rem !important;
	padding: 0.45rem 1rem;
	font-size: 0.95rem;
	margin-top: 0 !important;
}
.cvvb-bandeau-bon p { margin: 0; }
.cvvb-bandeau-bon__lien {
	display: inline-block;
	padding: 0.2rem 0.9rem;
	border-radius: 999px;
	background: var(--wp--preset--color--ocre);
	color: var(--wp--preset--color--nuit) !important;
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 600;
	text-decoration: none;
}
.cvvb-bandeau-bon__lien:hover, .cvvb-bandeau-bon__lien:focus-visible { background: var(--wp--preset--color--ocre-clair); }
@media (max-width: 600px) {
	.cvvb-bandeau-bon { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
	.cvvb-sauf-mobile { display: none; }   /* sur téléphone : « Vous avez un bon ? » */
}

.cvvb-entete .wp-block-navigation__submenu-container {
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--ligne) !important;
	box-shadow: var(--wp--preset--shadow--douce);
	padding: 0.4rem !important;
	min-width: 230px !important;
}
.cvvb-entete .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	border-radius: 8px;
	padding: 0.55rem 0.8rem !important;
}
.cvvb-entete .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--ciel-pale);
}
.cvvb-entete .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--ciel); }

/* Menu mobile plein écran, lisible */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem !important;
	background: var(--wp--preset--color--base) !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.15rem;
	padding: 0.35rem 0 !important;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.wp-element-button,
.wp-block-button__link {
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgb(18 48 77 / .18);
}
.is-style-cvvb-ocre .wp-block-button__link {
	background: var(--wp--preset--color--ocre) !important;
	color: var(--wp--preset--color--nuit) !important;
}
.is-style-cvvb-ocre .wp-block-button__link:hover { background: var(--wp--preset--color--ocre-clair) !important; }
.is-style-cvvb-contour-clair .wp-block-button__link {
	background: transparent !important;
	color: #fff !important;
	border: 2px solid rgb(255 255 255 / .85) !important;
}
.is-style-cvvb-contour-clair .wp-block-button__link:hover { background: rgb(255 255 255 / .12) !important; }

/* ── Cartes ──────────────────────────────────────────────────────────────── */
.is-style-cvvb-carte {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--douce);
	transition: transform .2s ease, box-shadow .2s ease;
}
.is-style-cvvb-carte:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--portee); }
.is-style-cvvb-carte > .wp-block-image { margin: 0; }
.is-style-cvvb-carte > .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* Pastille numérotée des étapes */
.cvvb-etape-numero {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--ocre);
	color: var(--wp--preset--color--nuit);
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 700;
	font-size: 1.2rem;
	margin: 0;
	flex-shrink: 0; /* reste rond quand le texte voisin est long */
}

/* Chiffres clés */
.cvvb-chiffre { font-family: var(--wp--preset--font-family--outfit); line-height: 1; }

/* Le club en chiffres : grille 2 × 2, cases de même taille */
.cvvb-chiffres {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: var(--wp--preset--spacing--30);
}
.cvvb-chiffres > * { margin: 0 !important; }

/* Bandeau d'accueil : texte lisible sur la photo */
.cvvb-hero h1, .cvvb-hero p { text-shadow: 0 2px 18px rgb(0 0 0 / .35); }

/* Barre d'infos sous le bandeau */
.cvvb-infos { margin-top: -2.5rem !important; position: relative; z-index: 2; }

/* ── Pages intérieures ───────────────────────────────────────────────────── */
.cvvb-titre-page { border-bottom: 1px solid var(--wp--preset--color--ligne); }

/* Anciennes pages : tableaux de tarifs lisibles */
.entry-content table, .wp-block-post-content table {
	border-collapse: collapse;
	width: 100%;
	font-size: .95rem;
}
.wp-block-post-content table td, .wp-block-post-content table th {
	border: 1px solid var(--wp--preset--color--ligne) !important;
	padding: .6rem .8rem;
}
.wp-block-post-content table tr:nth-child(even) td { background: var(--wp--preset--color--sable); }
.wp-block-post-content .wp-block-table { overflow-x: auto; }

/* ── Boutique WooCommerce ────────────────────────────────────────────────── */
.woocommerce-product-gallery img,
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image-gallery img { border-radius: 16px; }
.wc-block-components-product-price,
.wp-block-woocommerce-product-price .amount { color: var(--wp--preset--color--nuit); font-weight: 700; }
.single_add_to_cart_button,
.wc-block-components-button:not(.is-link) {
	background: var(--wp--preset--color--ocre) !important;
	color: var(--wp--preset--color--nuit) !important;
	border-radius: 999px !important;
	font-weight: 700 !important;
}
.woocommerce .quantity .qty { border-radius: 999px; padding: .55rem; }
.wc-block-components-notice-banner { border-radius: 12px; }

/* ── Divers ──────────────────────────────────────────────────────────────── */
:where(.wp-site-blocks) :focus-visible {
	outline: 3px solid var(--wp--preset--color--ocre);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* ── En-tête : logo, actions, mobile ─────────────────────────────────────── */
.cvvb-logo img { display: block; }
.cvvb-logo .wp-block-site-title a { color: var(--wp--preset--color--nuit); }
@media (max-width: 1100px) {
	.cvvb-logo p { display: none; }
}
@media (max-width: 600px) {
	.cvvb-logo .wp-block-site-title { font-size: 1rem !important; }
}

/* ── Pied de page ────────────────────────────────────────────────────────── */
.is-style-cvvb-sans-puces { list-style: none; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; color: var(--wp--preset--color--ocre-clair) !important; }

/* Bandeau d'accueil : hauteur plafonnée sur les très grands écrans */
.cvvb-hero.wp-block-cover { min-height: min(82vh, 820px) !important; }

/* Pages à formulaire (réservation, panier, commande, compte, tarifs) : contenu plus large */
body:is(.page-id-10007, .page-id-10008, .page-id-10013, .page-id-10021, .page-id-10022, .page-id-10023, .page-id-79)
	:is(.cvvb-contenu-page > .wp-block-post-content, .cvvb-contenu-page .wp-block-post-content > *) { max-width: 1100px; }

/* Fiche produit : on garde l'essentiel */
.single-product .product_meta,
.single-product .stock,
.single-product .wp-block-woocommerce-product-meta { display: none; }
.single-product .woocommerce-product-details__short-description ul { padding-left: 0; list-style: none; }
.single-product .woocommerce-product-details__short-description li { padding-left: 1.6rem; position: relative; margin: .35rem 0; }
.single-product .woocommerce-product-details__short-description li::before {
	content: "✓"; position: absolute; left: 0; color: var(--wp--preset--color--vigne); font-weight: 700;
}
.cvvb-rassurance {
	margin-top: 1.25rem; padding: 1rem 1.2rem; border-radius: 14px;
	background: var(--wp--preset--color--ciel-pale); color: var(--wp--preset--color--nuit); font-size: .95rem;
}

/* Formulaire de demande d'inscription (inscription.php) */
.cvvb-formulaire { display: grid; gap: var(--wp--preset--spacing--40); }
.cvvb-formulaire fieldset {
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 18px;
	display: grid;
	gap: 0.75rem;
}
.cvvb-formulaire legend {
	padding: 0 0.5rem;
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 600;
	font-size: 1.15rem;
	color: var(--wp--preset--color--nuit);
}
.cvvb-champs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.25rem; }
@media (max-width: 600px) { .cvvb-champs-2 { grid-template-columns: 1fr; } }
.cvvb-champ { margin: 0; display: grid; gap: 0.3rem; align-content: start; }
.cvvb-champ > label { font-weight: 600; color: var(--wp--preset--color--nuit); }
.cvvb-aide { font-weight: 400; font-size: 0.9em; color: var(--wp--preset--color--gris); }
.cvvb-formulaire input[type="text"], .cvvb-formulaire input[type="email"], .cvvb-formulaire input[type="tel"],
.cvvb-formulaire input[type="number"], .cvvb-formulaire textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	border: 1px solid #B9C2CA;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	color: var(--wp--preset--color--nuit);
}
.cvvb-formulaire input:focus, .cvvb-formulaire textarea:focus {
	outline: 2px solid var(--wp--preset--color--ciel);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--ciel);
}
.cvvb-option { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.cvvb-option input { margin-top: 0.3rem; accent-color: var(--wp--preset--color--ciel); flex-shrink: 0; }
.cvvb-formulaire [aria-invalid="true"] { border-color: #B3261E; }
.cvvb-erreur { color: #B3261E; font-size: 0.9rem; }
.cvvb-erreur-generale {
	margin: 0;
	padding: 0.9rem 1.1rem;
	border-radius: 12px;
	background: #FCEEEE;
	color: #8C1D18;
	font-weight: 600;
}
.cvvb-champ > label.cvvb-option { font-weight: 400; }
.cvvb-formulaire button { border: 0; cursor: pointer; font-family: var(--wp--preset--font-family--outfit); font-weight: 600; font-size: inherit; }
/* Champ piège pour les robots : invisible pour les personnes */
.cvvb-piege { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Menu en icône (☰) jusqu'à 1023 px au lieu de 599 px : sur tablette, le menu complet
   et les boutons ne tiennent pas sur une ligne */
@media (min-width: 600px) and (max-width: 1023px) {
	.cvvb-entete .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.cvvb-entete .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 380px) { .cvvb-sauf-tres-petit { display: none; } }
body.page-id-10007 .cvvb-bandeau-bon { display: none; }   /* déjà sur la page de réservation */

/* Fiche du bon : encadrés « Licence découverte » et « C'est un cadeau » du plugin RésaPlaneur
   (« .single-product » pour passer devant le style que le plugin écrit après chaque encadré) */
.single-product :is(.vd-insurance-option, .vd-gift-option) {
	display: grid;
	gap: 0.7rem;
	margin: 0 0 1rem;
	padding: 0.8rem 1rem;
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 12px;
	background: var(--wp--preset--color--sable);
}
.single-product :is(.vd-insurance-option, .vd-gift-option) legend { padding: 0 0.4rem; font-family: var(--wp--preset--font-family--outfit); font-weight: 600; color: var(--wp--preset--color--nuit); }
.single-product .vd-insurance-option label,
.single-product .vd-gift-option > label { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0; cursor: pointer; }
.single-product :is(.vd-insurance-option, .vd-gift-option) input:is([type="radio"], [type="checkbox"]) { margin-top: 0.3rem; flex-shrink: 0; accent-color: var(--wp--preset--color--ciel); width: 1.1rem; height: 1.1rem; }
.single-product :is(.vd-insurance-help, .vd-gift-help) { font-size: 0.9em; opacity: 1; color: var(--wp--preset--color--gris); }
.single-product .vd-gift-fields { display: grid; gap: 0.6rem; }
.single-product .vd-gift-option:not(:has(input[name="vd_gift"]:checked)) .vd-gift-fields { display: none; }
.single-product .vd-gift-fields p { margin: 0; }
.single-product .vd-gift-fields label { font-weight: 600; color: var(--wp--preset--color--nuit); }
.single-product .vd-gift-fields :is(input[type="text"], textarea) {
	width: 100%; box-sizing: border-box; padding: 0.55rem 0.75rem; border: 1px solid #B9C2CA; border-radius: 10px;
	background: #fff; font: inherit; color: var(--wp--preset--color--nuit);
}

/* Compteur du mini-panier : couleurs explicites (sinon chiffre et fond de même couleur) */
.cvvb-actions .wc-block-mini-cart__badge {
	background-color: var(--wp--preset--color--ocre) !important;
	color: var(--wp--preset--color--nuit) !important;
	font-weight: 700;
}

/* Vol au coucher du soleil : places restantes visibles */
.single-product .stock.cvvb-stock-visible {
	display: block;
	font-weight: 600;
	color: var(--wp--preset--color--vigne);
}
.single-product .stock.cvvb-stock-visible.out-of-stock { color: #B3261E; }

/* Page « Offrir un vol » (offrir.php) : une carte par vol */
.cvvb-offrir { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--wp--preset--spacing--50); }
.cvvb-offrir__carte {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--douce);
}
.cvvb-offrir__visuel { display: block; }
.cvvb-offrir__image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.cvvb-offrir__texte { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) var(--wp--preset--spacing--50); }
.cvvb-offrir__titre { margin: 0; font-size: var(--wp--preset--font-size--x-large); }
.cvvb-offrir__titre a { color: var(--wp--preset--color--nuit); text-decoration: none; }
.cvvb-offrir__prix { margin: 0; font-family: var(--wp--preset--font-family--outfit); font-weight: 700; font-size: 1.5rem; color: var(--wp--preset--color--ciel); }
.cvvb-offrir__resume p { margin: 0; color: var(--wp--preset--color--gris); }
.cvvb-offrir .stock { margin: 0; font-weight: 600; color: var(--wp--preset--color--vigne); }
.cvvb-offrir .wp-block-buttons { margin-top: auto; padding-top: 0.5rem; }
.cvvb-offrir .cvvb-offrir__texte > * { margin-block: 0 !important; }   /* l'écart vient du « gap » de la carte */
.cvvb-offrir__carte > * { margin: 0 !important; }   /* marge de bloc héritée du thème parent sous l'image */
.cvvb-offrir .cvvb-offrir__texte > .wp-block-buttons { margin-top: auto !important; }   /* boutons alignés en bas des cartes */
.cvvb-insecable { white-space: nowrap; }   /* expression à ne pas couper (phrase d'accroche) */
