/*
Theme Name: Les Bas Nylon
Theme URI: https://lesbasnylon.fr
Description: Thème bloc (FSE) sur mesure pour Les Bas Nylon — vintage et pin-up, « Le Vintage Intemporel ». Léger, piloté par theme.json et des patterns de blocs natifs.
Author: Les Bas Nylon
Version: 0.4.2
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: lesbasnylon
Tags: full-site-editing, block-patterns, e-commerce
*/

/* ========================================================================
   Tokens locaux (dérivés de theme.json) — rayons, ombres, transitions
   ===================================================================== */
:root{
	--lbn-radius: 4px;
	--lbn-radius-lg: 8px;
	--lbn-shadow-sm: 0 6px 18px -14px rgba(60,35,20,.55);
	--lbn-shadow-md: 0 16px 38px -22px rgba(60,35,20,.55);
	--lbn-ease: .18s cubic-bezier(.2,.6,.3,1);
	--lbn-card-ratio: 4/5;
}

/* ========================================================================
   Base & accessibilité
   ===================================================================== */
html{ scroll-behavior:smooth; }
img{ max-width:100%; height:auto; }
::selection{ background:var(--wp--preset--color--primary); color:#fff; }
:where(a,button,input,select,textarea,summary,.wp-block-button__link,.cfvsw-swatches-option):focus-visible{
	outline:2px solid var(--wp--preset--color--primary); outline-offset:2px; border-radius:2px;
}
@media (prefers-reduced-motion: reduce){ *{ animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; } }

/* ========================================================================
   En-tête : navigation, icônes, logo, collant & compact au défilement
   ===================================================================== */
.lbn-nav .lbn-sig a{ color:var(--wp--preset--color--primary); font-weight:600; }
.lbn-topbar p{ margin:0; }
.wp-block-navigation .wp-block-navigation-item__label{ letter-spacing:.06em; }
.wp-block-navigation a:where(:hover,:focus){ color:var(--wp--preset--color--primary); }

.lbn-header{ position:sticky; top:0; z-index:100; transition:padding var(--lbn-ease), box-shadow var(--lbn-ease); }
.lbn-compact .lbn-header{ padding-top:.4rem!important; padding-bottom:.4rem!important; box-shadow:var(--lbn-shadow-sm); }
.lbn-header .custom-logo{ height:auto; max-width:196px; transition:max-width var(--lbn-ease); }
.lbn-compact .lbn-header .custom-logo{ max-width:132px; }

.lbn-icons{ gap:1.1rem; }
.lbn-icons svg{ width:26px!important; height:26px!important; }
.lbn-icons .wp-block-search__button,.lbn-icons .wc-block-mini-cart__button,.lbn-icons .wp-block-woocommerce-customer-account a,.lbn-icons a.wc-block-components-button{ background:transparent; border:0; box-shadow:none; padding:.3rem; color:var(--wp--preset--color--primary); transition:transform var(--lbn-ease); }
.lbn-icons :where(.wp-block-search__button,.wc-block-mini-cart__button):hover{ transform:translateY(-1px); }
.lbn-icons svg,.lbn-icons svg path,.lbn-icons svg circle,.lbn-icons svg rect{ fill:var(--wp--preset--color--primary); color:var(--wp--preset--color--primary); }
.lbn-icons .wc-block-mini-cart__badge{ background:var(--wp--preset--color--primary); color:#fff; }

/* ========================================================================
   Boutons : uniformes, avec états survol / focus / actif / désactivé
   ===================================================================== */
.wp-block-button__link,
.wc-block-components-button,
.single_add_to_cart_button,
.wp-element-button,
button.wc-block-components-button{
	font-family:var(--wp--preset--font-family--body);
	font-weight:600; border-radius:var(--lbn-radius);
	min-height:2.9rem; line-height:1.1;
	display:inline-flex; align-items:center; justify-content:center; gap:.4rem;
	transition:background-color var(--lbn-ease), transform .08s ease, box-shadow var(--lbn-ease), color var(--lbn-ease);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.single_add_to_cart_button:hover,
.wc-block-components-button.contained:hover{ transform:translateY(-1px); box-shadow:var(--lbn-shadow-sm); }
.wp-block-button__link:active,.single_add_to_cart_button:active{ transform:translateY(0); box-shadow:none; }
.is-style-outline .wp-block-button__link{ border:1.5px solid var(--wp--preset--color--primary); color:var(--wp--preset--color--primary); background:transparent; }
.is-style-outline .wp-block-button__link:hover{ background:var(--wp--preset--color--primary); color:#fff; }
/* désactivé (ex: variation non choisie) */
.single_add_to_cart_button.disabled,.single_add_to_cart_button:disabled,
.wc-block-components-button:disabled,.wp-element-button:disabled{
	background:var(--wp--preset--color--gold-soft)!important; color:var(--wp--preset--color--contrast-soft)!important;
	opacity:1; cursor:not-allowed; transform:none; box-shadow:none;
}

/* ========================================================================
   Cartes produit (Product Collection) : hauteurs égales, prix+bouton en bas
   ===================================================================== */
.wp-block-woocommerce-product-template{ align-items:stretch; }
.wp-block-woocommerce-product-template > li,
.wc-block-product{ display:flex; flex-direction:column; height:100%; margin:0; }
.wc-block-product .wp-block-woocommerce-product-image,
.wc-block-product .wc-block-components-product-image{ margin:0 0 .5rem; overflow:hidden; border-radius:var(--lbn-radius); position:relative; }
.wc-block-product .wp-block-woocommerce-product-image img,
.wc-block-product .wc-block-components-product-image img{ width:100%; aspect-ratio:var(--lbn-card-ratio); object-fit:cover; display:block; transition:transform .5s cubic-bezier(.2,.6,.3,1); }
.wc-block-product:hover .wp-block-woocommerce-product-image img{ transform:scale(1.05); }
.wc-block-product .wp-block-post-title{ font-family:var(--wp--preset--font-family--heading); font-size:1rem; line-height:1.3; margin:.1rem 0 0; }
.wc-block-product .wp-block-post-title a{ color:var(--wp--preset--color--contrast); text-decoration:none; }
.wc-block-product .wp-block-post-title a:hover{ color:var(--wp--preset--color--primary); }
.wc-block-product .cfvsw-swatches-container{ justify-content:center; margin:.45rem 0 0; }
.wc-block-product .wp-block-woocommerce-product-price{ margin-top:auto; padding-top:.5rem; font-weight:600; color:var(--wp--preset--color--contrast); }
.wc-block-product .wp-block-woocommerce-product-button,
.wc-block-product .wp-block-button{ margin-top:.55rem; }
.wc-block-product .wp-block-woocommerce-product-button .wp-block-button__link{ width:100%; }

/* prix soldés */
.wc-block-components-product-price__value.is-discounted,.wc-block-components-product-price ins{ color:var(--wp--preset--color--primary); text-decoration:none; font-weight:700; }
.wc-block-components-product-price del{ opacity:.55; font-weight:400; }
/* badge promo */
.wc-block-components-product-sale-badge{ background:var(--wp--preset--color--primary); color:#fff; border:0; border-radius:2px; letter-spacing:.04em; font-weight:600; font-size:.7rem; padding:.25rem .5rem; }

/* ========================================================================
   Pastilles de variation (Variation Swatches / cfvsw) : uniformes + états
   ===================================================================== */
:root{ --cfvsw-swatches-border-color:var(--wp--preset--color--gold-soft); --cfvsw-swatches-border-color-hover:var(--wp--preset--color--primary); }
.cfvsw-swatches-container{ display:flex; flex-wrap:wrap; gap:.35rem; margin:.6rem 0; }
.cfvsw-swatches-option{
	min-width:2.2rem; height:2.2rem; padding:0 .45rem; box-sizing:border-box;
	border-radius:var(--lbn-radius); border:1.5px solid var(--wp--preset--color--gold-soft);
	display:inline-flex; align-items:center; justify-content:center;
	font-size:.8rem; font-weight:500; line-height:1; cursor:pointer; overflow:hidden;
	background:var(--wp--preset--color--white); color:var(--wp--preset--color--contrast);
	transition:border-color var(--lbn-ease), box-shadow var(--lbn-ease), transform .08s ease;
}
.cfvsw-swatches-option:hover{ border-color:var(--wp--preset--color--primary); transform:translateY(-1px); }
.cfvsw-swatches-option.cfvsw-selected,.cfvsw-swatches-option[aria-checked="true"]{ border-color:var(--wp--preset--color--primary); box-shadow:inset 0 0 0 1.5px var(--wp--preset--color--primary); }
.cfvsw-swatches-option.cfvsw-disabled,.cfvsw-swatches-option.cfvsw-no-stock{ opacity:.4; cursor:not-allowed; }
.cfvsw-swatches-option.cfvsw-disabled::after,.cfvsw-swatches-option.cfvsw-no-stock::after{ content:""; position:absolute; width:140%; height:1.5px; background:currentColor; transform:rotate(-45deg); opacity:.5; }
.cfvsw-swatch-inner{ width:100%; height:100%; min-width:1.4rem; border-radius:3px; display:block; }

/* ========================================================================
   Boutique : tri, compteur, pagination
   ===================================================================== */
.wp-block-woocommerce-catalog-sorting select{ border:1px solid var(--wp--preset--color--gold-soft); border-radius:var(--lbn-radius); padding:.5rem 2rem .5rem .7rem; background-color:var(--wp--preset--color--white); font-size:.9rem; min-height:2.6rem; }
.wp-block-woocommerce-product-results-count{ color:var(--wp--preset--color--contrast-soft); font-size:.92rem; }
.wp-block-query-pagination .wp-block-query-pagination-numbers .page-numbers{ padding:.4rem .7rem; border-radius:var(--lbn-radius); }
.wp-block-query-pagination .page-numbers.current{ background:var(--wp--preset--color--primary); color:#fff; }

/* ========================================================================
   Colonne filtres
   ===================================================================== */
.lbn-filters-col{ position:sticky; top:5.5rem; align-self:flex-start; }
.lbn-filters h2,.lbn-filters h3{ font-family:var(--wp--preset--font-family--heading); }
.lbn-filters h3{ margin:0 0 .55rem; font-size:.95rem; }
.lbn-filters .wp-block-woocommerce-product-filter-attribute,
.lbn-filters .wp-block-woocommerce-product-filter-price,
.lbn-filters .wp-block-woocommerce-product-filter-status{ padding:1rem 0; border-bottom:1px solid var(--wp--preset--color--gold-soft); }
.lbn-filters .wc-block-product-filter-checkbox-list label{ font-size:.9rem; }
.lbn-filters input[type="range"]{ accent-color:var(--wp--preset--color--primary); }
.lbn-filters .wc-block-components-price-slider__range-input-progress{ --range-color:var(--wp--preset--color--primary); }
@media (max-width:781px){ .lbn-filters-col{ position:static; } }

/* ========================================================================
   Fiche produit
   ===================================================================== */
.woocommerce-product-gallery,.wp-block-woocommerce-product-image-gallery{ margin-bottom:1rem; }
.wp-block-woocommerce-product-image-gallery img{ border-radius:var(--lbn-radius-lg); }
.single_add_to_cart_button{ background:var(--wp--preset--color--primary); color:#fff; border:0; }
.lbn-sizeguide a{ color:var(--wp--preset--color--primary); font-weight:600; }
.lbn-reassurance p{ margin:.2rem 0; }
.wp-block-woocommerce-product-meta{ font-size:.92rem; color:var(--wp--preset--color--contrast-soft); }
.woocommerce-Tabs-panel,.wp-block-woocommerce-product-details{ margin-top:1.5rem; }
.wc-tab h2,.wp-block-woocommerce-product-details h2{ font-size:1.3rem; }
/* onglets */
.wc-tabs li a{ text-decoration:none; }
.wc-tabs li.active a{ color:var(--wp--preset--color--primary); border-bottom:2px solid var(--wp--preset--color--primary); }

/* ========================================================================
   Héros rétro & sections d'accueil
   ===================================================================== */
.lbn-hero h1 em,.lbn-hero h2 em,.lbn-subhead em{ color:var(--wp--preset--color--primary); font-style:italic; }
.lbn-flourish{ height:20px; background:no-repeat left center/auto 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='20' viewBox='0 0 180 20'%3E%3Cpath d='M4 11C40 3 62 3 82 10M98 10C118 3 140 3 176 11' fill='none' stroke='%239a6f1e' stroke-width='1.6'/%3E%3Cpath d='M90 5l4.5 5-4.5 5-4.5-5z' fill='%23c0272d'/%3E%3C/svg%3E"); }

/* Emplacements photo vintage (placeholders) */
.lbn-photo{ position:relative; background:linear-gradient(140deg,#e7d0a9,#9a7749); overflow:hidden; display:grid; place-items:end start; }
.lbn-photo::after{ content:""; position:absolute; inset:0; background-image:radial-gradient(rgba(60,35,20,.12) 1px,transparent 1px); background-size:4px 4px; pointer-events:none; }
.lbn-photo .lbn-ph-note{ position:relative; z-index:1; margin:0; padding:12px 14px; color:rgba(255,253,248,.92); font-family:var(--wp--preset--font-family--heading); font-style:italic; font-size:.9rem; }

.lbn-hero-media{ position:relative; }
.lbn-accent{ font-family:var(--wp--preset--font-family--script); color:var(--wp--preset--color--primary); line-height:1.15; text-align:center; font-size:1.3rem; margin:0 0 .5rem; }
.lbn-polaroid{ background:var(--wp--preset--color--white); padding:14px 14px 18px; box-shadow:var(--lbn-shadow-md); transform:rotate(-2deg); border:1px solid var(--wp--preset--color--gold-soft); transition:transform .4s ease; }
.lbn-polaroid:hover{ transform:rotate(-1deg) translateY(-3px); }
.lbn-polaroid .lbn-photo{ aspect-ratio:4/4.5; }
.lbn-stamp{ position:absolute; right:-6px; bottom:4px; width:118px; height:118px; border-radius:50%; border:2px dashed var(--wp--preset--color--primary); background:rgba(255,253,248,.94); display:grid; place-items:center; text-align:center; transform:rotate(-9deg); z-index:3; }
.lbn-stamp p{ margin:0; color:var(--wp--preset--color--primary); font-family:var(--wp--preset--font-family--heading); font-weight:700; line-height:1; }
.lbn-stamp .s{ font-size:.58rem; letter-spacing:.2em; }
.lbn-stamp .b{ font-size:1.5rem; }

/* Décennies : tuiles photo */
.lbn-decade{ position:relative; background:var(--wp--preset--color--white); padding:10px 10px 12px; border:1px solid var(--wp--preset--color--gold-soft); box-shadow:var(--lbn-shadow-sm); transition:transform var(--lbn-ease), box-shadow var(--lbn-ease); }
.lbn-decade:hover{ transform:translateY(-3px); box-shadow:var(--lbn-shadow-md); }
.lbn-decade .lbn-photo{ aspect-ratio:3/3.7; }
.lbn-decade-label{ display:block; text-align:center; margin-top:10px; }
.lbn-decade-label a{ color:var(--wp--preset--color--primary); font-weight:600; letter-spacing:.14em; text-transform:uppercase; font-size:.82rem; text-decoration:none; }

/* Réassurance accueil */
.lbn-reassurance-strip p{ margin:0; }

/* ========================================================================
   Tables : tailles, horaires
   ===================================================================== */
.wp-block-table.lbn-sizetable{ overflow-x:auto; }
.lbn-sizetable table{ font-size:.92rem; }
.lbn-sizetable th{ background:var(--wp--preset--color--brown); color:var(--wp--preset--color--base); }
.lbn-sizetable.is-style-stripes tbody tr:nth-child(odd){ background:var(--wp--preset--color--base-2); }
.lbn-hours table{ width:auto; min-width:min(420px,100%); }
.lbn-hours td:first-child{ font-weight:600; padding-right:1.5rem; }
.lbn-hours td{ border:0; padding:.4rem .5rem; border-bottom:1px solid var(--wp--preset--color--gold-soft); }

/* Squelettes légaux */
.lbn-todo{ color:var(--wp--preset--color--primary); background:var(--wp--preset--color--gold-soft); display:inline-block; padding:.1rem .5rem; border-radius:2px; font-size:.85rem; }

/* ========================================================================
   Pied de page
   ===================================================================== */
.lbn-footer .wp-block-column{ min-width:0; }
.lbn-footlinks a{ text-decoration:none; }
.lbn-footlinks a:hover{ text-decoration:underline; }

/* ========================================================================
   Panier / Commande (blocs) : cohérence
   ===================================================================== */
.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout{ --wc-form-border-radius:var(--lbn-radius); }
.wc-block-components-text-input input,.wc-block-components-select select{ border-radius:var(--lbn-radius); }

/* ========================================================================
   Responsive (mobile d'abord : ajustements)
   ===================================================================== */
@media (max-width:781px){
	.lbn-header .custom-logo{ max-width:150px; }
}
@media (max-width:600px){
	.lbn-polaroid{ transform:none; }
	.lbn-polaroid:hover{ transform:translateY(-2px); }
	.lbn-stamp{ width:92px; height:92px; }
	.lbn-stamp .b{ font-size:1.2rem; }
	.wc-block-product .wp-block-post-title{ font-size:.95rem; }
	.cfvsw-swatches-option{ min-width:2rem; height:2rem; }
}

/* ========================================================================
   Correctifs audit : titres sur 2 lignes, contraste pied, icônes
   ===================================================================== */
/* Titre carte réservé sur 2 lignes (aligne pastilles/prix) */
.wc-block-product .wp-block-post-title{
	display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical;
	overflow:hidden; min-height:2.6em;
}
/* Liens du pied lisibles sur brun (WCAG AA) */
.lbn-footer a{ color:var(--wp--preset--color--gold-soft); text-decoration:none; }
.lbn-footer a:hover,.lbn-footer a:focus-visible{ color:#fff; text-decoration:underline; }
.lbn-footer .lbn-footlinks a{ color:var(--wp--preset--color--gold-soft); }

/* Icônes de réassurance monochromes (SVG en fond, indépendantes de l'OS) */
.lbn-ico{ width:26px; height:26px; margin:0 auto; background:no-repeat center/22px 22px; }
.lbn-reass-item::before{
	content:""; display:inline-block; width:1.15em; height:1.15em; margin-right:.5em;
	vertical-align:-.2em; background:no-repeat center/contain;
}
.lbn-ico-truck,.lbn-reass-item.lbn-ico-truck::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0272d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5h11v9.5H2zM13 9.5h4.5L21 13v3h-8z'/%3E%3Ccircle cx='6.5' cy='17.5' r='1.7'/%3E%3Ccircle cx='17' cy='17.5' r='1.7'/%3E%3C/svg%3E"); }
.lbn-ico-shop,.lbn-reass-item.lbn-ico-shop::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0272d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v9h16v-9M2.5 10 4.5 5h15l2 5a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0z'/%3E%3C/svg%3E"); }
.lbn-ico-return,.lbn-reass-item.lbn-ico-return::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0272d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h11a6 6 0 0 1 0 12H8M3 8l4-4M3 8l4 4'/%3E%3C/svg%3E"); }
.lbn-ico-lock,.lbn-reass-item.lbn-ico-lock::before{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0272d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7a4 4 0 0 1 8 0v3.5'/%3E%3C/svg%3E"); }

/* Réassurance fiche : flux vertical robuste (indépendant du flex généré) */
.lbn-reassurance{ display:block; }
.lbn-reassurance .lbn-reass-item{ display:block; margin:.35rem 0; color:var(--wp--preset--color--contrast); }
.lbn-reassurance .lbn-reass-item strong{ color:var(--wp--preset--color--contrast); }
