/*
Theme Name: T3P Maroc
Theme URI: https://t3p.ma
Author: T3P
Description: Thème bloc léger pour T3P Maroc (distributeur VMK : machines et pièces de rechange). Aucun constructeur de pages requis : tout se modifie dans l'éditeur de site WordPress. Compatible WooCommerce en mode catalogue / demande de devis.
Version: 1.0.5
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: t3p
*/

/* ---------- En-tête ---------- */
.t3p-topbar { background: #2c3338; color: #f0f0f1; font-size: .85rem; }
.t3p-topbar a { color: #fff; text-decoration: none; }
.t3p-header { border-bottom: 1px solid #d8d8d8; background: linear-gradient(180deg,#ffffff 0%,#e9e9e9 100%); position: sticky; top: 0; z-index: 50; }
.t3p-header .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--primary); font-weight: 800; letter-spacing: .04em; }
.t3p-logo { display: block; line-height: 0; }
.t3p-logo img { height: 64px; width: auto; display: block; }
.t3p-header .wp-block-navigation { font-family: var(--wp--preset--font-family--montserrat); text-transform: uppercase; font-size: .95rem; }
.t3p-header .wp-block-navigation a { color: #4c4c4c; }
.t3p-header .wp-block-navigation a:hover, .t3p-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary); }
.t3p-header .wp-block-navigation a { text-decoration: none; font-weight: 600; }
.t3p-header .wp-block-search { max-width: 280px; }
.t3p-quote-btn .wp-block-button__link { white-space: nowrap; }

/* ---------- Sections de la page d'accueil ---------- */
.t3p-hero { background: linear-gradient(180deg, #cc0109 0%, #cc0109 100%); color: #fff; }
.t3p-hero h1, .t3p-hero p { color: #fff; }
.t3p-section-alt { background: var(--wp--preset--color--light); }
.t3p-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 28px; padding: 1.5rem; height: 100%; }
.t3p-slogan { background: var(--wp--preset--color--primary); color: #fff; text-align: center; }
.t3p-slogan h2, .t3p-slogan p { color: #fff; }

/* Liste des catégories (bloc WooCommerce « Catégories de produits ») */
.wc-block-product-categories-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.wc-block-product-categories-list-item { margin: 0; }
.wc-block-product-categories-list-item > a { display: block; padding: .9rem 1.1rem; background: #fff; border: 1px solid #e0e0e0; border-left: 4px solid var(--wp--preset--color--primary); border-radius: 6px; text-decoration: none; font-weight: 600; }
.wc-block-product-categories-list-item > a:hover { background: var(--wp--preset--color--light); }
.wc-block-product-categories-list-item-count { float: right; color: var(--wp--preset--color--steel); font-weight: 400; }

/* ---------- Catalogue ---------- */
.t3p-quote-link { display: inline-block; }
.woocommerce .wp-block-woocommerce-product-collection .wc-block-components-product-name { font-size: 1rem; }

/* ---------- Pied de page ---------- */
.t3p-footer { background: #1d2125; color: #c3c4c7; }
.t3p-footer a { color: #fff; }
.t3p-footer h3, .t3p-footer h2 { color: #fff; }

/* ---------- Formulaire Contact Form 7 ---------- */
.wpcf7 form label { display: block; font-weight: 600; margin-bottom: 1rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid #b8c2cc; border-radius: 4px; font: inherit; margin-top: .3rem;
}
.wpcf7 input[type="submit"] {
  background: var(--wp--preset--color--primary); color: #fff; border: 0; border-radius: 4px; padding: .8rem 1.8rem; font-weight: 700; cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { filter: brightness(.92); }

/* ---------- Titres ---------- */
h1, h2, h3, h4 { font-family: var(--wp--preset--font-family--raleway); }

/* ---------- Produits sans photo (image par défaut = logo T3P) ---------- */
.wc-block-components-product-image img[src*="produit-sans-photo"],
.woocommerce-product-gallery__image--placeholder img,
img.woocommerce-placeholder { object-fit: contain; background: #f2f2f2; border-radius: 6px; }
.wc-block-components-product-image, .wp-block-woocommerce-product-image { border-radius: 6px; overflow: hidden; }

/* =====================================================================
   v1.2.0 — réglages validés sur le site en ligne (anciennement CSS global)
   Les images de fond sont à téléverser dans la médiathèque (voir LISEZ-MOI)
   ===================================================================== */
body .t3p-header{background:linear-gradient(90deg,rgba(255,255,255,.55) 0%,#fff 100%),url(/wp-content/uploads/2026/11/inox.jpg) center top/cover no-repeat}
body .t3p-hero{background:linear-gradient(150deg,#cc0109 0%,rgba(16,104,48,.88) 100%),url(/wp-content/uploads/2026/11/poissons.jpg) center/cover no-repeat}
body .t3p-section-alt{background:linear-gradient(rgba(255,255,255,.71),rgba(255,255,255,.71)),url(/wp-content/uploads/2026/11/inox.jpg) center/cover no-repeat}
/* Catégories : tuiles carrées avec miniature, 3 par ligne */
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item{position:relative;aspect-ratio:1/1;overflow:hidden;border-radius:12px;background:#fff;border:1px solid #e0e0e0}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item>a{display:block;position:absolute;inset:0;padding:0;border:0;border-radius:0;background:transparent}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image{width:100%!important;height:100%!important;max-width:none!important;margin:0!important;display:block!important}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image img{width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;display:block;margin:0}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__name{position:absolute;left:0;right:0;bottom:0;padding:.6rem .5rem;text-align:center;font-weight:700;font-size:.95rem;line-height:1.25;color:#4c4c4c;background:rgba(255,255,255,.82)}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item>a:hover .wc-block-product-categories-list-item__name{color:#cc0109;background:rgba(255,255,255,.95)}
body .wc-block-product-categories-list--has-images .wc-block-product-categories-list-item-count{position:absolute;top:8px;right:8px;float:none;background:rgba(204,1,9,.9);color:#fff;border-radius:999px;padding:.1rem .55rem;font-size:.8rem;font-weight:600;pointer-events:none}
body .wc-block-product-categories-list--depth-0{gap:20px!important;padding:0!important;margin:0!important}
body .wc-block-product-categories-list--depth-0>li{margin:0!important;width:100%!important;max-width:none!important}
@media (min-width:600px){body .wc-block-product-categories-list--depth-0{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media (max-width:599px){body .wc-block-product-categories-list--depth-0{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
/* Cadre bleu du haut : texte centré, recherche */
body .t3p-hero{text-align:center}
body .t3p-hero .wp-block-buttons{justify-content:center}
body .t3p-hero p{font-size:1.05rem!important;line-height:1.5}
body .t3p-hero .t3p-hero-search{max-width:400px;margin:1.75rem auto 0}
body .t3p-hero .t3p-hero-search .wp-block-search__inside-wrapper{background:#fff;border-radius:6px;overflow:hidden}
body .t3p-hero .t3p-hero-search .wp-block-search__input{border:0;color:#0a0a0a;background:#fff;padding:.5rem .8rem;font-size:.9rem;min-height:0}
body .t3p-hero .t3p-hero-search .wp-block-search__button{background:#cc0109;color:#fff;border:0;border-radius:0;margin:0;padding:.35rem .8rem}
/* En-tête : textes gris, loupe seule, une seule ligne, groupé à droite */
body .t3p-header .wp-block-navigation,body .t3p-header .wp-block-navigation a,body .t3p-header .wp-block-navigation .wp-block-navigation-item__label,body .t3p-header .wp-block-navigation-submenu__toggle,body .t3p-header .wp-block-search__button,body .t3p-header .wp-block-search__button svg{color:#4c4c4c!important;fill:#4c4c4c}
body .t3p-header .wp-block-navigation a:hover,body .t3p-header .wp-block-navigation a:hover .wp-block-navigation-item__label,body .t3p-header .wp-block-search__button:hover,body .t3p-header .wp-block-search__button:hover svg{color:#cc0109!important;fill:#cc0109}
body .t3p-header .wp-block-search__button{background:transparent;border:0;box-shadow:none}
body .t3p-header .wp-block-search{max-width:none;margin:0;position:relative;width:auto!important;flex:0 0 auto}
body .t3p-header .wp-block-search__inside-wrapper{border:0}
body .t3p-header .wp-block-search__input{color:#4c4c4c;border:1px solid #b8b8b8;background:#fff}
body .t3p-header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper{position:absolute;right:0;top:calc(100% + 6px);width:300px;max-width:80vw;background:#fff;box-shadow:0 4px 14px rgba(0,0,0,.18);border-radius:6px;padding:4px;z-index:70}
body .t3p-header>.wp-block-group{flex-wrap:nowrap!important;gap:1.25rem;justify-content:flex-end!important}
body .t3p-header .t3p-logo{flex:0 0 auto;margin-right:auto}
body .t3p-header .wp-block-navigation{flex:0 1 auto;min-width:0;justify-content:flex-end}
body .t3p-header .wp-block-navigation__container{flex-wrap:nowrap!important;white-space:nowrap}
body .t3p-header .t3p-quote-btn{flex:0 0 auto}
@media (max-width:781px){
 body .t3p-header>.wp-block-group{gap:.5rem}
 body .t3p-logo img{height:44px}
 body .t3p-header .t3p-quote-btn .wp-block-button__link{padding:.45rem .65rem;font-size:.8rem}
 body .t3p-header .wp-block-navigation{font-size:.85rem}
}
/* Cadre bleu du bas */
body .t3p-slogan h2{font-family:var(--wp--preset--font-family--raleway);font-size:var(--wp--preset--font-size--x-large);line-height:1.15;font-weight:800;color:#fff}
body .t3p-slogan p{font-size:1.05rem!important;line-height:1.5;color:#fff}
/* Trois cartes : boutons centrés et alignés en bas */
body .t3p-section-alt .wp-block-columns{align-items:stretch}
body .t3p-section-alt .wp-block-column{display:flex;flex-direction:column}
body .t3p-section-alt .t3p-card{display:flex;flex-direction:column;flex:1 1 auto;height:100%}
body .t3p-section-alt .t3p-card .wp-block-buttons{margin-top:auto!important;padding-top:1.25rem;justify-content:center}
/* Pied de page gris, polices réduites, deux blocs */
body .t3p-footer{background:#4f4f4f;color:#f0f0f1}
body .t3p-footer a{color:#fff}
body .t3p-footer h3,body .t3p-footer h2{color:#fff}
body .t3p-footer p,body .t3p-footer a{font-size:.875rem!important;line-height:1.55}
body .t3p-footer h3{font-size:1.1rem;font-weight:800}
body .t3p-footer .has-small-font-size{font-size:.8rem!important}
@media (min-width:782px){
 body .t3p-footer .wp-block-columns{flex-wrap:nowrap}
 body .t3p-footer .wp-block-column:first-child{flex-basis:64%!important;flex-grow:0}
 body .t3p-footer .wp-block-column:last-child{flex-basis:36%!important;flex-grow:0}
}
/* Marges latérales */
body .t3p-footer,body .t3p-header>.wp-block-group,body .t3p-topbar>.wp-block-group,body .wp-block-group.alignfull{padding-left:1.25rem;padding-right:1.25rem}
body main>.wp-block-post-content>.wp-block-group.alignfull{padding-left:1.25rem;padding-right:1.25rem}
/* Fiche pièce : SKU et catégorie masqués */
body .wp-block-woocommerce-product-meta,body.single-product .wp-block-woocommerce-product-sku,body.single-product .product_meta,body.single-product .taxonomy-product_cat{display:none!important}
/* v1.3.0 — fiche pièce sans onglets, photo -20 % ; demande de devis (panier sans prix) */
body .wp-block-woocommerce-product-details,body.single-product .woocommerce-tabs,body.single-product .wc-tabs-wrapper,body.single-product .woocommerce-Reviews,body.single-product .wp-block-woocommerce-product-reviews{display:none!important}
body.single-product .wp-block-woocommerce-product-image-gallery{width:80%!important;max-width:80%!important}
body .woocommerce-cart-form .product-price,body .woocommerce-cart-form .product-subtotal,body .cart_totals,body .woocommerce-cart-form .coupon{display:none!important}
body .woocommerce-cart-form table.cart{width:100%;border-collapse:collapse;margin-bottom:1rem}
body .woocommerce-cart-form table.cart th,body .woocommerce-cart-form table.cart td{padding:.75rem .5rem;border-bottom:1px solid #d8d8d8;text-align:left;vertical-align:middle}
body .woocommerce-cart-form .product-thumbnail img{width:64px;height:auto}
body .woocommerce-cart-form .product-remove a{font-size:1.4rem;text-decoration:none}
body .woocommerce-cart-form .quantity input{width:4.5rem}
body .t3p-devis-title{margin-top:2.5rem}
body .wpcf7 label{display:block;margin-bottom:1rem}
body .wpcf7 input[type=text],body .wpcf7 input[type=email],body .wpcf7 input[type=tel],body .wpcf7 textarea{width:100%;max-width:640px}
/* v1.4.0 — catégories 3 par ligne (espacement 20 px), page Produits, boutons de listes alignés */
@media (min-width:600px){body .wc-block-product-categories-list--depth-0{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media (max-width:599px){body .wc-block-product-categories-list--depth-0{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
body .wc-block-product-categories-list--depth-0{gap:20px!important;padding:0!important;margin:0!important}
body .wc-block-product-categories-list--depth-0>li{margin:0!important;width:100%!important;max-width:none!important}
body.page-pieces-vmk h1.wp-block-post-title,body.page-machines-vmk h1.wp-block-post-title{display:none}
body .wc-block-product-template>li.wc-block-product{display:flex;flex-direction:column;height:auto!important;align-self:stretch}
body .wc-block-product-template>li.wc-block-product .t3p-quote-link{margin-top:auto!important;padding-top:1rem;justify-content:center;display:flex}
body .wc-block-product-template>li.wc-block-product .wp-block-post-title{margin-bottom:0}
body .wc-block-product-template.is-flex-container{align-items:stretch}

/* Cartes (machines / pièces) : mise en page identique quelle que soit la taille de l'image */
.wp-block-columns { align-items: stretch; }
.wp-block-column:has(> .t3p-card) { display: flex; }
.t3p-card { display: flex; flex-direction: column; width: 100%; text-align: center; }
.t3p-card .wp-block-image { aspect-ratio: 3 / 2; margin: 0 0 1rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.t3p-card .wp-block-image img { width: 100%; height: 100%; object-fit: contain; }
.t3p-card h3 { min-height: 3em; display: flex; align-items: center; justify-content: center; margin: 0 0 .75rem; }
.t3p-card p { margin: 0 0 1rem; }
.t3p-card .wp-block-buttons { margin-top: auto; justify-content: center; }
