/* ==========================================================
   DECO HOME B2B - Boutique, fiche produit, panier, commande
   Habillage sur-mesure du theme Blocksy
   ========================================================== */

:root {
    --dh-shop-bg: #f5f5f6;
    --dh-shop-card-bg: #fff;
    --dh-shop-border: #e6e6e8;
    --dh-shop-text: #1c1c1e;
    --dh-shop-muted: #777;
}

/* Conteneur general : largeur et fond coherents avec le portail */
body.woocommerce-page:not(.dh-home) #content,
body.single-product #content {
    background: var(--dh-shop-bg);
    padding: 30px 0 60px;
}

/* ---------- Boutique : grille produits ---------- */

ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

ul.products li.product {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transition: border-color .2s, transform .2s;
}

ul.products li.product:hover {
    border-color: #c9c9cd;
    transform: translateY(-2px);
}

ul.products li.product a {
    text-decoration: none;
    color: inherit;
}

ul.products li.product img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: #f9f9fa;
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 13.5px;
    font-weight: 600;
    padding: 14px 14px 4px;
    margin: 0;
    line-height: 1.35;
    color: var(--dh-shop-text);
}

ul.products li.product .price {
    display: block;
    padding: 0 14px 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dh-shop-text);
}

ul.products li.product .price del {
    color: var(--dh-shop-muted);
    font-weight: 500;
    font-size: 12px;
    margin-right: 6px;
}

ul.products li.product .price ins {
    text-decoration: none;
}

ul.products li.product .button {
    display: block;
    margin: 0 14px 14px;
    padding: 9px 12px;
    background: var(--dh-sidebar-bg, #1c1c1e);
    color: #fff !important;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    text-align: center;
    border: none;
}

ul.products li.product .button:hover {
    background: #000;
}

/* Bouton "Se connecter" ou "Choix des options" (variable) : meme style */
ul.products li.product .dh-button-login,
ul.products li.product .added_to_cart {
    display: block;
    margin: 0 14px 14px;
}

/* Prix masque cote boutique (herite du style deja defini dans front.css,
   on ajuste juste le padding pour la grille) */
ul.products li.product .dh-prix-masque {
    display: block;
    padding: 0 14px 14px;
    font-size: 12.5px;
}

/* Badge promo/nouveau en loop, coherent avec la palette du portail */
ul.products li.product .onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--dh-accent, #b23b2e);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 4px 9px;
    border-radius: 3px;
    z-index: 2;
}

ul.products li.product { position: relative; }

/* En-tete boutique : titre categorie + description */
.woocommerce-products-header {
    margin-bottom: 24px;
}

.woocommerce-products-header__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dh-shop-text);
}

/* Tri et resultats */
.woocommerce-result-count,
.woocommerce-ordering {
    font-size: 13px;
    color: var(--dh-shop-muted);
}

.woocommerce-ordering select {
    border: 1px solid var(--dh-shop-border);
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 13px;
}

/* Pagination */
.woocommerce-pagination ul.page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 30px 0 0;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--dh-shop-border);
    font-size: 13px;
    color: var(--dh-shop-text);
    text-decoration: none;
}

.woocommerce-pagination .page-numbers li .current {
    background: var(--dh-sidebar-bg, #1c1c1e);
    color: #fff;
    border-color: var(--dh-sidebar-bg, #1c1c1e);
}

/* ---------- Fiche produit ---------- */

.single-product div.product {
    background: var(--dh-shop-card-bg);
    border-radius: 8px;
    padding: 34px;
    border: 1px solid var(--dh-shop-border);
}

.single-product .woocommerce-product-gallery img {
    border-radius: 6px;
    background: #f9f9fa;
}

.single-product .product_title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dh-shop-text);
    margin: 0 0 8px;
}

.single-product .price {
    font-size: 26px;
    font-weight: 700;
    color: var(--dh-shop-text);
    margin: 0 0 4px;
}

.single-product .price .dh-ht {
    font-size: 13px;
    color: var(--dh-shop-muted);
    font-weight: 400;
}

.single-product .dh-label-conseille {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--dh-shop-muted);
    margin-bottom: 18px;
}

.single-product .stock {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 3px;
    margin-bottom: 18px;
}

.single-product .stock.in-stock {
    background: #edfaef;
    color: #2e7d32;
}

.single-product .stock.out-of-stock {
    background: #fcf0f1;
    color: var(--dh-accent, #b23b2e);
}

.single-product form.cart {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--dh-shop-border);
}

.single-product .quantity input.qty {
    width: 64px;
    padding: 10px;
    border: 1px solid var(--dh-shop-border);
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.single-product button.single_add_to_cart_button,
.single-product .button.dh-button-login {
    background: var(--dh-sidebar-bg, #1c1c1e);
    color: #fff !important;
    border: none;
    padding: 13px 28px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
}

.single-product button.single_add_to_cart_button:hover {
    background: #000;
}

.single-product .dh-cta-connexion {
    background: var(--dh-shop-bg);
    border-radius: 6px;
    padding: 18px 20px;
    margin-top: 20px;
}

/* Onglets fiche produit (description, avis...) */
.woocommerce-tabs ul.tabs {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 34px 0 0;
    border-bottom: 1px solid var(--dh-shop-border);
}

.woocommerce-tabs ul.tabs li {
    margin: 0;
}

.woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dh-shop-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.woocommerce-tabs ul.tabs li.active a {
    color: var(--dh-shop-text);
    border-bottom-color: var(--dh-accent, #b23b2e);
}

.woocommerce-tabs .panel {
    padding: 26px 4px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.dh-fiche-technique {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dh-fiche-technique li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13.5px;
}

.dh-fiche-technique li:last-child { border-bottom: none; }

/* Produits similaires */
.related.products {
    margin-top: 50px;
    padding-top: 34px;
    border-top: 1px solid var(--dh-shop-border);
}

.related.products > h2 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* ---------- Panier ---------- */

.woocommerce-cart table.shop_table {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    border-collapse: collapse;
    width: 100%;
    overflow: hidden;
}

.woocommerce-cart table.shop_table th {
    background: var(--dh-shop-bg);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--dh-shop-muted);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
}

.woocommerce-cart table.shop_table td {
    padding: 16px 14px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.woocommerce-cart table.shop_table td img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.woocommerce-cart .quantity input.qty {
    width: 56px;
    padding: 8px;
    border: 1px solid var(--dh-shop-border);
    border-radius: 4px;
    text-align: center;
}

.woocommerce-cart .cart-collaterals .cart_totals {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    padding: 22px;
}

.woocommerce-cart .cart_totals h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
}

.woocommerce-cart .cart_totals table {
    width: 100%;
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
    padding: 10px 0;
    font-size: 13.5px;
    border-bottom: 1px solid #f0f0f1;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--dh-sidebar-bg, #1c1c1e);
    color: #fff !important;
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-decoration: none;
    margin-top: 14px;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
    background: #000;
}

/* ---------- Commande (checkout) ---------- */

.woocommerce-checkout form.checkout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: start;
}

.woocommerce-checkout #customer_details,
.woocommerce-checkout .dh-champs-b2b {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    padding: 24px;
}

.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    padding: 24px;
}

.woocommerce-checkout .form-row label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dh-shop-text);
    margin-bottom: 5px;
    display: block;
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--dh-shop-border);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.woocommerce-checkout table.shop_table {
    width: 100%;
    font-size: 13.5px;
}

.woocommerce-checkout table.shop_table th,
.woocommerce-checkout table.shop_table td {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.woocommerce-checkout #place_order {
    width: 100%;
    background: var(--dh-sidebar-bg, #1c1c1e);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    margin-top: 16px;
}

.woocommerce-checkout #place_order:hover {
    background: #000;
}

.woocommerce-checkout .payment_methods {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
}

.woocommerce-checkout .payment_methods li {
    padding: 14px;
    background: var(--dh-shop-bg);
    border-radius: 5px;
    font-size: 13.5px;
}

/* Page de remerciement */
.woocommerce-order-received .woocommerce-thankyou-order-received {
    background: #edfaef;
    color: #2e7d32;
    padding: 18px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.woocommerce-order-received table.shop_table {
    background: var(--dh-shop-card-bg);
    border: 1px solid var(--dh-shop-border);
    border-radius: 7px;
    width: 100%;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    ul.products { grid-template-columns: repeat(3, 1fr); }
    .woocommerce-checkout form.checkout { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    ul.products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .single-product div.product { padding: 20px; }
    .single-product .product_title { font-size: 20px; }
    .single-product .price { font-size: 22px; }
    .woocommerce-tabs ul.tabs { overflow-x: auto; flex-wrap: nowrap; }
    .woocommerce-cart table.shop_table { font-size: 12.5px; }
    .woocommerce-cart table.shop_table td { padding: 10px 8px; }
}

@media (max-width: 480px) {
    ul.products { grid-template-columns: 1fr 1fr; }
}
