/*
 * Technotel Theme — WooCommerce CSS
 * Surcharge des styles WooCommerce pour correspondre au design Technotel.
 */

/* ============================================================
   STRUCTURE GÉNÉRALE WOOCOMMERCE
============================================================ */
.woocommerce,
.woocommerce-page {
    font-family: var(--technotel-font-body, 'Poppins', sans-serif);
}

/* ============================================================
   BOUTONS WOOCOMMERCE
============================================================ */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .button {
    background: var(--technotel-primary, #FF324D);
    color: #fff;
    border-radius: 25px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
    background: #d42039;
    color: #fff;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background: var(--technotel-secondary, #292b2c);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
    background: #111;
}

/* ============================================================
   MESSAGES WOOCOMMERCE
============================================================ */
.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--technotel-primary, #FF324D);
    border-radius: 6px;
    font-size: 14px;
}

.woocommerce-error {
    border-top-color: #dc3545;
    border-radius: 6px;
    font-size: 14px;
}

/* ============================================================
   GRILLE PRODUITS (SHOP)
   Note: La grille est gérée via Bootstrap cols dans archive-product.php.
   Ces styles s'appliquent si WooCommerce affiche ses propres <ul.products>.
============================================================ */

/* Badge onsale WooCommerce natif */
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
    background: var(--technotel-primary, #FF324D);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    min-height: auto;
    min-width: auto;
    line-height: 1.6;
}

/* ============================================================
   FICHE PRODUIT UNIQUE
============================================================ */

/* ── Single product: Add to cart button (no .woocommerce ancestor in our template) ── */
body.single-product button.single_add_to_cart_button,
body.single-product .cart button {
    background: var(--technotel-primary, #FF324D) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 32px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    width: auto !important;
}

body.single-product button.single_add_to_cart_button:hover,
body.single-product .cart button:hover {
    background: #d42039 !important;
}

/* ── Quantity input ──
   style.css sets .quantity { display: table } with floated children → collapses to 0×0
   without a .woocommerce ancestor. Override to flex so it renders. */
body.single-product form.cart .quantity {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
    float: none !important;
}

body.single-product .quantity input.qty {
    display: block !important;
    float: none !important;
    border: 1.5px solid var(--technotel-border, #e5e5e5) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 15px !important;
    width: 70px !important;
    text-align: center !important;
    height: 44px !important;
    margin: 0 !important;
}

body.single-product form.cart {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-bottom: 20px !important;
}

/* ── Summary styling ── */
body.single-product div.product .product_title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--technotel-secondary, #292b2c) !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
}

body.single-product div.product p.price,
body.single-product div.product span.price {
    color: var(--technotel-primary, #FF324D) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    display: block !important;
    margin-bottom: 16px !important;
}

body.single-product div.product .woocommerce-product-details__short-description {
    font-size: 14px !important;
    color: #687188 !important;
    line-height: 1.7 !important;
    margin-bottom: 20px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid var(--technotel-border, #e5e5e5) !important;
}

body.single-product .product_meta {
    font-size: 13px !important;
    color: #687188 !important;
    margin-top: 16px !important;
}

body.single-product .product_meta span a,
body.single-product .product_meta span {
    color: #687188 !important;
}

body.single-product .product_meta span a:hover {
    color: var(--technotel-primary, #FF324D) !important;
}

/* ── 2-column layout: gallery left / summary right ── */
/* Note: our template has no .woocommerce wrapper — use body class selector */
body.single-product div.product,
.woocommerce div.product {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 40px !important;
    align-items: flex-start !important;
}

body.single-product div.product div.images,
.woocommerce div.product div.images {
    flex: 0 0 calc(50% - 20px) !important;
    max-width: calc(50% - 20px) !important;
    float: none !important;
    width: auto !important;
}

body.single-product div.product div.summary,
.woocommerce div.product div.summary {
    flex: 1 !important;
    min-width: 280px !important;
    float: none !important;
    width: auto !important;
}

/* ── Full-width elements that follow the summary ── */
body.single-product div.product .woocommerce-tabs,
body.single-product div.product #reviews,
body.single-product div.product .related.products,
body.single-product div.product .upsells.products,
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product #reviews,
.woocommerce div.product .related.products,
.woocommerce div.product .upsells.products {
    flex: 0 0 100% !important;
    width: 100% !important;
}

.woocommerce div.product .woocommerce-product-gallery__image img {
    border-radius: 10px;
    border: 1px solid var(--technotel-border, #e5e5e5);
}

.woocommerce div.product .product_title {
    font-size: 24px;
    font-weight: 700;
    color: var(--technotel-secondary, #292b2c);
    margin-bottom: 12px;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: var(--technotel-primary, #FF324D);
    font-size: 26px;
    font-weight: 700;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: #aaa;
    font-size: 18px;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    font-size: 14px;
    color: var(--technotel-text, #687188);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ── Gallery: constrain image height so thumbnails don't blow up the layout ── */
body.single-product .woocommerce-product-gallery {
    overflow: hidden !important;
}

body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image {
    max-height: 480px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    border: 1px solid var(--technotel-border, #e5e5e5) !important;
}

body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    max-height: 480px !important;
    width: 100% !important;
    object-fit: contain !important;
    border-radius: 10px !important;
    border: none !important;
}

body.single-product .flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 12px !important;
    padding: 0 !important;
    list-style: none !important;
}

body.single-product .flex-control-thumbs li {
    width: 72px !important;
    height: 72px !important;
    flex: 0 0 72px !important;
    margin: 0 !important;
}

body.single-product .flex-control-thumbs li img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    border: 2px solid var(--technotel-border, #e5e5e5) !important;
    cursor: pointer !important;
    background: #f8f9fa !important;
    max-height: none !important;
}

body.single-product .flex-control-thumbs li img.flex-active {
    border-color: var(--technotel-primary, #FF324D) !important;
}

/* ── Description tab panel: constrain h2 and prevent overflow ── */
body.single-product .woocommerce-Tabs-panel {
    padding: 24px !important;
    overflow: hidden !important;
    border: 1px solid var(--technotel-border, #e5e5e5) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    background: #fff !important;
}

body.single-product .woocommerce-Tabs-panel h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--technotel-secondary, #292b2c) !important;
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

body.single-product .woocommerce-Tabs-panel ul,
body.single-product .woocommerce-Tabs-panel ol {
    padding-left: 20px !important;
    line-height: 1.8 !important;
    font-size: 14px !important;
    color: #687188 !important;
    overflow: hidden !important;
    max-width: 100% !important;
}

body.single-product .woocommerce-Tabs-panel ul li,
body.single-product .woocommerce-Tabs-panel ol li {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* ── Produits similaires: framed card wrapper ── */
body.single-product .related.products,
body.single-product .upsells.products {
    background: #fff !important;
    border: 1px solid var(--technotel-border, #e5e5e5) !important;
    border-radius: 12px !important;
    padding: 28px !important;
    margin-top: 40px !important;
    padding-top: 28px !important;
    border-top: 1px solid var(--technotel-border, #e5e5e5) !important;
}

/* Onglets produit */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid var(--technotel-border, #e5e5e5);
    margin-bottom: 20px;
    padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: 1px solid var(--technotel-border, #e5e5e5);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
    margin-right: 4px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: #fff;
    border-bottom-color: #fff;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    color: var(--technotel-secondary, #292b2c);
    font-weight: 600;
    font-size: 14px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--technotel-primary, #FF324D);
}

/* Notation étoiles */
.woocommerce .star-rating span::before,
.woocommerce .star-rating::before {
    color: #ffc107;
}

/* ============================================================
   PANIER
============================================================ */
.woocommerce-cart table.cart td,
.woocommerce-cart table.cart th {
    padding: 15px;
    vertical-align: middle;
    border-color: var(--technotel-border, #e5e5e5);
    font-size: 14px;
}

.woocommerce-cart table.cart .product-name a {
    color: var(--technotel-secondary, #292b2c);
    font-weight: 600;
}

.woocommerce-cart table.cart .product-name a:hover {
    color: var(--technotel-primary, #FF324D);
}

.woocommerce-cart .cart-collaterals .cart_totals {
    background: #f8f9fa;
    border: 1px solid var(--technotel-border, #e5e5e5);
    border-radius: 10px;
    padding: 25px;
}

.woocommerce-cart .cart-collaterals .cart_totals h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--technotel-secondary, #292b2c);
    margin-bottom: 15px;
}

/* ============================================================
   CHECKOUT
============================================================ */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--technotel-secondary, #292b2c);
    border-bottom: 2px solid var(--technotel-primary, #FF324D);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    border: 1px solid var(--technotel-border, #e5e5e5);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.3s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--technotel-primary, #FF324D);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,50,77,.1);
}

/* ============================================================
   MON COMPTE
============================================================ */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 10px 15px;
    color: var(--technotel-secondary, #292b2c);
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-MyAccount-navigation ul li.is-active a {
    background: var(--technotel-primary, #FF324D);
    color: #fff;
}

/* ============================================================
   PAGINATION
============================================================ */
.woocommerce nav.woocommerce-pagination ul {
    border: none;
}

.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: var(--technotel-primary, #FF324D);
    color: #fff;
    border-color: var(--technotel-primary, #FF324D);
}

/* ============================================================
   BREADCRUMB WOOCOMMERCE
============================================================ */
.woocommerce .woocommerce-breadcrumb {
    font-size: 13px;
    color: var(--technotel-text, #687188);
    margin-bottom: 15px;
}

.woocommerce .woocommerce-breadcrumb a {
    color: var(--technotel-text, #687188);
}

.woocommerce .woocommerce-breadcrumb a:hover {
    color: var(--technotel-primary, #FF324D);
}

/* ============================================================
   PRODUITS SIMILAIRES (related / upsells)
   Note: pas d'ancêtre .woocommerce → on cible body.single-product
============================================================ */

/* ── Section heading ── */

body.single-product .related.products > h2,
body.single-product .upsells.products > h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--technotel-secondary, #292b2c);
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--technotel-primary, #FF324D);
    display: inline-block;
}

/* ── Grid ── */
body.single-product ul.products,
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
}

/* Kill clearfix pseudo-elements — they act as ghost grid items */
body.single-product ul.products::before,
body.single-product ul.products::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* ── Product card ── */
body.single-product ul.products li.product,
.woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    background: #fff;
    border: 1px solid var(--technotel-border, #e5e5e5);
    border-radius: 10px;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}

body.single-product ul.products li.product:hover,
.woocommerce ul.products li.product:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transform: translateY(-3px);
}

/* ── Product link / image ── */
body.single-product ul.products li.product a.woocommerce-LoopProduct-link,
body.single-product ul.products li.product a.woocommerce-loop-product__link,
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    text-decoration: none !important;
    color: inherit !important;
    padding: 12px 12px 8px !important;
}

body.single-product ul.products li.product img,
.woocommerce ul.products li.product img {
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    background: #f8f9fa !important;
    margin-bottom: 10px !important;
}

/* ── Title ── */
body.single-product ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--technotel-secondary, #292b2c) !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ── Price ── */
body.single-product ul.products li.product .price,
.woocommerce ul.products li.product .price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--technotel-primary, #FF324D) !important;
    margin: auto 0 10px !important;
}

body.single-product ul.products li.product .price del,
.woocommerce ul.products li.product .price del {
    color: #aaa !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    margin-right: 4px !important;
}

/* ── Add to cart button ── */
body.single-product ul.products li.product a.button,
.woocommerce ul.products li.product a.button {
    display: block !important;
    margin: 0 12px 12px !important;
    padding: 9px 14px !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    background: var(--technotel-primary, #FF324D) !important;
    color: #fff !important;
    transition: background 0.2s !important;
    border: none !important;
}

body.single-product ul.products li.product a.button:hover,
.woocommerce ul.products li.product a.button:hover {
    background: #c9001a !important;
}

/* ── Sale badge ── */
body.single-product ul.products li.product .onsale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: var(--technotel-primary, #FF324D) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    z-index: 2 !important;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 992px) {
    body.single-product ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {
    body.single-product ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    body.single-product ul.products,
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
}
