/* ==========================================================================
   Effet Wellness — Checkout (B2B + B2C)
   Fixes the duplicate <select> rendering for country, tightens form layout,
   improves the order-review block, and matches the parent dark-green palette.
   ========================================================================== */

:root {
    --ew-green-900:   #1e3a35;
    --ew-green-700:   #2c544c;
    --ew-green-500:   #4a8775;
    --ew-cream:       #f6f1e6;
    --ew-cream-soft:  #faf7ef;
    --ew-border:      #e3dccd;
    --ew-text:        #1e3a35;
    --ew-text-soft:   #6b7775;
    --ew-radius:      14px;
    --ew-radius-sm:   10px;
}

/* ---------- Field reset & layout ---------- */

.woocommerce-checkout form .form-row {
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
}

.woocommerce-checkout form .form-row label {
    font-weight: 600;
    color: var(--ew-green-900);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.woocommerce-checkout form .form-row input.input-text,
.woocommerce-checkout form .form-row textarea,
.woocommerce-checkout form .form-row .select2-container--default .select2-selection--single,
.woocommerce-checkout form .form-row select {
    width: 100%;
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius-sm);
    padding: 0.9rem 1rem;
    font-size: 1rem;
    background: #fff;
    color: var(--ew-text);
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: none;
    min-height: 50px;
    line-height: 1.4;
}

.woocommerce-checkout form .form-row input.input-text:focus,
.woocommerce-checkout form .form-row textarea:focus,
.woocommerce-checkout form .form-row .select2-container--default.select2-container--focus .select2-selection--single,
.woocommerce-checkout form .form-row .select2-container--default.select2-container--open .select2-selection--single,
.woocommerce-checkout form .form-row select:focus {
    border-color: var(--ew-green-700);
    box-shadow: 0 0 0 3px rgba(44, 84, 76, 0.15);
    outline: none;
}

/* ---------- Country / state select fix ----------
   WC hides the native <select> after Select2 wraps it. On some plugin combos
   (Flexible Checkout Fields), Select2 fails to initialize and the bare select
   sits next to the visible widget. Force-hide the native input element and let
   Select2 own the visible UI. */

.woocommerce-checkout .country_to_state,
.woocommerce-checkout .state_select,
.woocommerce-checkout select.country_select,
.woocommerce-checkout select.state_select,
.woocommerce-checkout .select2-hidden-accessible + select,
.woocommerce-checkout input[name="billing_country"][type="hidden"] + select {
    display: none !important;
}

/* Select2 is the visible widget — make it match the inputs */
.woocommerce-checkout .select2-container--default .select2-selection--single {
    display: flex !important;
    align-items: center;
    height: 50px !important;
    padding: 0 1rem !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px !important;
    padding: 0 !important;
    color: var(--ew-text) !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 0.5rem !important;
}

.woocommerce-checkout .select2-dropdown {
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius-sm);
    overflow: hidden;
}

.woocommerce-checkout .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--ew-green-700);
    color: #fff;
}

/* ---------- Two-column for first/last name and similar ---------- */

.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
    width: 48%;
    display: inline-flex;
}
.woocommerce-checkout .form-row-first { float: left; margin-right: 4%; }
.woocommerce-checkout .form-row-last  { float: right; }
.woocommerce-checkout .form-row-wide  { width: 100%; display: block; clear: both; }

/* ---------- Section headings (Détails de facturation, etc.) ---------- */

.woocommerce-checkout h3 {
    font-family: "Libre Bodoni", Georgia, serif;
    color: var(--ew-green-900);
    font-size: 1.55rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--ew-cream);
}

/* ---------- Order review block (right column) ---------- */

.woocommerce-checkout-review-order {
    background: var(--ew-cream-soft);
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(30, 58, 53, 0.04);
}

.woocommerce-checkout-review-order h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--ew-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--ew-border);
    text-align: left;
    color: var(--ew-text);
    font-size: 0.95rem;
}

.woocommerce-checkout-review-order-table thead th {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ew-green-700);
    font-weight: 700;
}

.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td {
    font-weight: 700;
    color: var(--ew-green-900);
    font-size: 1rem;
}

.woocommerce-checkout-review-order-table tfoot .order-total td {
    font-size: 1.25rem;
}

/* Center product names cleanly (no centered text — left align) */
.woocommerce-checkout-review-order-table td.product-name,
.woocommerce-checkout-review-order-table td.product-total,
.woocommerce-checkout-review-order-table th.product-name,
.woocommerce-checkout-review-order-table th.product-total {
    text-align: left;
    vertical-align: middle;
}

.woocommerce-checkout-review-order-table td.product-total,
.woocommerce-checkout-review-order-table th.product-total {
    text-align: right;
}

/* Shipping radio rows */
.woocommerce-checkout-review-order-table .shipping ul#shipping_method {
    list-style: none;
    margin: 0;
    padding: 0;
}
.woocommerce-checkout-review-order-table .shipping ul#shipping_method li {
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Payment methods block ---------- */

#payment {
    background: transparent;
    border-radius: var(--ew-radius);
    margin-top: 1rem;
}

#payment ul.payment_methods {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border: none;
}

#payment ul.payment_methods li.wc_payment_method {
    background: #fff;
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

#payment ul.payment_methods li.wc_payment_method:hover {
    border-color: var(--ew-green-500);
}

#payment ul.payment_methods li.wc_payment_method input[type="radio"] {
    margin-right: 0.6rem;
    transform: scale(1.15);
    accent-color: var(--ew-green-700);
}

#payment ul.payment_methods li.wc_payment_method label {
    font-weight: 600;
    color: var(--ew-green-900);
    cursor: pointer;
}

#payment ul.payment_methods li.wc_payment_method .payment_box {
    background: var(--ew-cream-soft);
    border-radius: var(--ew-radius-sm);
    padding: 0.9rem 1rem;
    margin: 0.75rem 0 0;
    font-size: 0.92rem;
    color: var(--ew-text-soft);
    line-height: 1.5;
}

#payment ul.payment_methods li.wc_payment_method .payment_box:before { display: none; }

#payment .place-order .button[type="submit"],
#payment #place_order {
    background: var(--ew-green-900);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--ew-radius-sm);
    cursor: pointer;
    width: 100%;
    transition: background .15s ease, transform .05s ease;
    letter-spacing: 0.02em;
}

#payment .place-order .button[type="submit"]:hover,
#payment #place_order:hover {
    background: var(--ew-green-700);
}

#payment .place-order .button[type="submit"]:active,
#payment #place_order:active {
    transform: translateY(1px);
}

/* ---------- B2B-specific tweaks ---------- */

/* Highlight company field when user is pro */
body.role-professionnel #ew_billing_company_field input,
body.user-pro #ew_billing_company_field input {
    border-color: var(--ew-green-500);
    background: var(--ew-cream-soft);
}

/* LCR info block on thank-you page */
.ew-lcr-bank-info {
    background: var(--ew-cream-soft) !important;
    border: 1px solid var(--ew-border) !important;
    border-radius: var(--ew-radius) !important;
    padding: 1.5rem !important;
}
.ew-lcr-bank-info h3 {
    color: var(--ew-green-900);
    margin-top: 0;
}

/* ---------- Validation errors ---------- */

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
    border-radius: var(--ew-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: none;
}

.woocommerce-error {
    background: #fdecea;
    color: #8a1c1c;
    border-left: 4px solid #c83e3e;
}

.woocommerce-info {
    background: var(--ew-cream-soft);
    color: var(--ew-green-900);
    border-left: 4px solid var(--ew-green-700);
}

/* ---------- Coupon / promo code ---------- */

.woocommerce-form-coupon-toggle .woocommerce-info {
    background: var(--ew-cream-soft);
    color: var(--ew-green-900);
    border-left: 4px solid var(--ew-green-700);
    border-radius: var(--ew-radius);
    padding: 1.1rem 1.25rem;
    font-weight: 500;
}
.woocommerce-form-coupon-toggle .woocommerce-info a {
    color: var(--ew-green-700);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.checkout_coupon.woocommerce-form-coupon {
    background: #fff;
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius);
    padding: 1.5rem;
    margin: 0 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}
.checkout_coupon.woocommerce-form-coupon > p:first-child {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--ew-text);
    font-size: 0.95rem;
}
.checkout_coupon.woocommerce-form-coupon .form-row-first {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}
.checkout_coupon.woocommerce-form-coupon .form-row-last {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}
.checkout_coupon.woocommerce-form-coupon input[name="coupon_code"] {
    width: 100%;
    min-height: 50px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius-sm);
    font-size: 0.95rem;
    background: #fff;
}
.checkout_coupon.woocommerce-form-coupon input[name="coupon_code"]:focus {
    border-color: var(--ew-green-700);
    box-shadow: 0 0 0 3px rgba(44, 84, 76, 0.15);
    outline: none;
}
.checkout_coupon.woocommerce-form-coupon button[name="apply_coupon"] {
    background: var(--ew-green-900);
    color: #fff;
    border: none;
    padding: 0 1.75rem;
    height: 50px;
    border-radius: var(--ew-radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: background .15s ease;
}
.checkout_coupon.woocommerce-form-coupon button[name="apply_coupon"]:hover {
    background: var(--ew-green-700);
}

@media (max-width: 640px) {
    .checkout_coupon.woocommerce-form-coupon {
        grid-template-columns: 1fr;
    }
    .checkout_coupon.woocommerce-form-coupon button[name="apply_coupon"] {
        width: 100%;
    }
}

/* ==========================================================================
   PUBLIC CART PAGE (/panier/) — coupon row layout
   ========================================================================== */

.woocommerce-cart .shop_table.cart td.actions{
    background:#faf7ef !important;
    padding:18px 20px !important;
    border-top:1px solid #e9e2d5 !important;
}
.woocommerce-cart .shop_table.cart td.actions:after{
    content:"";display:table;clear:both;
}

.woocommerce-cart .coupon{
    float:left !important;
    display:inline-flex !important;
    align-items:center !important;
    gap:8px !important;
    margin:0 !important;
}
.woocommerce-cart .coupon label{
    display:none !important; /* label is redundant with placeholder */
}
.woocommerce-cart .coupon input#coupon_code{
    width:240px !important;
    height:44px !important;
    padding:0 14px !important;
    border:1.5px solid #d6e4e1 !important;
    border-radius:8px !important;
    font-size:14px !important;
    color:#0f4f52 !important;
    background:#fff !important;
}
.woocommerce-cart .coupon input#coupon_code:focus{
    border-color:#0f4f52 !important;
    outline:none !important;
    box-shadow:0 0 0 3px rgba(15,79,82,.1) !important;
}
.woocommerce-cart .coupon button[name="apply_coupon"]{
    background:#0f4f52 !important;
    color:#fff !important;
    border:0 !important;
    height:44px !important;
    padding:0 22px !important;
    border-radius:8px !important;
    font-size:13px !important;
    font-weight:700 !important;
    letter-spacing:.02em !important;
    cursor:pointer !important;
    transition:background .15s ease !important;
}
.woocommerce-cart .coupon button[name="apply_coupon"]:hover{
    background:#003841 !important;
}

.woocommerce-cart button[name="update_cart"]{
    float:right !important;
    background:#fff !important;
    color:#0f4f52 !important;
    border:1.5px solid #d6e4e1 !important;
    height:44px !important;
    padding:0 22px !important;
    border-radius:8px !important;
    font-size:13px !important;
    font-weight:600 !important;
    cursor:pointer !important;
    transition:border-color .15s ease,background .15s ease !important;
}
.woocommerce-cart button[name="update_cart"]:hover{
    border-color:#0f4f52 !important;
    background:#f9fdfb !important;
}

@media(max-width:768px){
    .woocommerce-cart .shop_table.cart td.actions{padding:14px !important;}
    .woocommerce-cart .coupon{
        float:none !important;
        display:flex !important;
        width:100% !important;
        gap:8px !important;
        margin-bottom:10px !important;
    }
    .woocommerce-cart .coupon input#coupon_code{flex:1 !important;width:auto !important;min-width:0 !important;}
    .woocommerce-cart button[name="update_cart"]{
        float:none !important;
        width:100% !important;
        margin-top:0 !important;
    }
}

/* ==========================================================================
   THANKYOU / ORDER RECEIVED — branded confirmation page
   ========================================================================== */

.ew-thankyou {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.ew-thankyou-hero {
    background: linear-gradient(135deg, #1e3a35 0%, #2c544c 100%);
    color: #fff;
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: 0 12px 32px rgba(30, 58, 53, 0.18);
    position: relative;
    overflow: hidden;
}
.ew-thankyou-icon {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #fff;
}
.ew-thankyou-icon-error { background: rgba(220, 38, 38, 0.18); color: #fca5a5; }

.ew-thankyou-hero h1 {
    color: #fff;
    font-family: "Libre Bodoni", Georgia, serif;
    font-size: 36px;
    line-height: 1.2;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
}
.ew-thankyou-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    margin: 0 0 24px;
    position: relative;
    z-index: 1;
}
.ew-thankyou-order-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
}

/* Order info grid */
.ew-thankyou-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.ew-thankyou-info-card {
    background: #fff;
    border: 1px solid #e3dccd;
    border-radius: 14px;
    padding: 20px;
    transition: border-color .15s ease, transform .15s ease;
}
.ew-thankyou-info-card:hover {
    border-color: #4a8775;
    transform: translateY(-2px);
}
.ew-thankyou-info-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7775;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.ew-thankyou-info-value {
    font-size: 15px;
    color: #1e3a35;
    font-weight: 600;
    word-break: break-word;
}
.ew-thankyou-info-total {
    font-size: 22px;
    font-weight: 700;
    color: #0f4f52;
}

/* Section headings inside the hooks (LCR box, order details, addresses) */
.ew-thankyou .woocommerce-order-details,
.ew-thankyou .woocommerce-customer-details {
    background: #fff;
    border: 1px solid #e3dccd;
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 24px;
}
.ew-thankyou .woocommerce-order-details h2,
.ew-thankyou .woocommerce-column__title {
    font-family: "Libre Bodoni", Georgia, serif;
    color: #1e3a35;
    font-size: 22px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0ebde;
}

/* Order details table */
.ew-thankyou .woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
/* Header */
.ew-thankyou .woocommerce-table--order-details thead th {
    background: #faf7ef;
    color: #1e3a35;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 20px;
    border: none;
    text-align: left;
}
.ew-thankyou .woocommerce-table--order-details thead th.product-total {
    text-align: right;
}

/* Body rows (line items) */
.ew-thankyou .woocommerce-table--order-details tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid #f0ebde;
    color: #1e3a35;
    font-size: 14px;
    vertical-align: middle;
}
.ew-thankyou .woocommerce-table--order-details tbody td.product-name {
    font-weight: 600;
}
.ew-thankyou .woocommerce-table--order-details tbody td.product-name .product-quantity {
    color: #6b7775;
    font-weight: 500;
    font-size: 13px;
    margin-left: 4px;
}
.ew-thankyou .woocommerce-table--order-details tbody td.product-total {
    text-align: right;
    font-weight: 700;
    color: #0f4f52;
    white-space: nowrap;
}

/* Footer rows (subtotal, shipping, tax, payment method, total) */
.ew-thankyou .woocommerce-table--order-details tfoot tr th,
.ew-thankyou .woocommerce-table--order-details tfoot tr td {
    padding: 12px 20px;
    border: none;
    border-top: 1px solid #f0ebde;
    font-size: 14px;
    color: #1e3a35;
    background: transparent;
}
.ew-thankyou .woocommerce-table--order-details tfoot tr th {
    text-align: right;
    font-weight: 600;
    color: #6b7775;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    width: 60%;
}
.ew-thankyou .woocommerce-table--order-details tfoot tr td {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

/* Total row — highlighted */
.ew-thankyou .woocommerce-table--order-details tfoot tr.order-total th,
.ew-thankyou .woocommerce-table--order-details tfoot tr.order-total td {
    padding-top: 18px;
    padding-bottom: 18px;
    border-top: 2px solid #1e3a35;
    background: #faf7ef;
}
.ew-thankyou .woocommerce-table--order-details tfoot tr.order-total th {
    font-size: 14px;
    text-transform: uppercase;
    color: #1e3a35;
    font-weight: 700;
}
.ew-thankyou .woocommerce-table--order-details tfoot tr.order-total td {
    font-size: 22px;
    font-weight: 700;
    color: #0f4f52;
}

/* Addresses */
.ew-thankyou .woocommerce-customer-details .col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.ew-thankyou .woocommerce-customer-details address {
    background: #faf7ef;
    border-radius: 10px;
    padding: 16px;
    font-style: normal;
    line-height: 1.6;
    color: #1e3a35;
    font-size: 14px;
    border: none;
}

/* CTA buttons */
.ew-thankyou-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}
.ew-thankyou-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
    letter-spacing: 0.02em;
}
.ew-thankyou-btn-primary {
    background: #1e3a35;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(30, 58, 53, 0.15);
}
.ew-thankyou-btn-primary:hover {
    background: #2c544c;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 53, 0.22);
}
.ew-thankyou-btn-outline {
    background: #fff;
    color: #1e3a35 !important;
    border: 1.5px solid #e3dccd;
}
.ew-thankyou-btn-outline:hover {
    border-color: #1e3a35;
    background: #faf7ef;
}

/* LCR bank info — was styled in checkout.css :before, refine here */
.ew-thankyou .ew-lcr-bank-info {
    background: #faf7ef !important;
    border: 1px solid #e3dccd !important;
    border-radius: 14px !important;
    padding: 28px !important;
    margin: 0 0 24px !important;
    position: relative;
}
.ew-thankyou .ew-lcr-bank-info h3 {
    font-family: "Libre Bodoni", Georgia, serif;
    color: #1e3a35;
    font-size: 22px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e3dccd;
}
.ew-thankyou .ew-lcr-bank-info p {
    font-size: 14px;
    color: #1e3a35;
    line-height: 1.6;
    margin: 0 0 12px;
}
.ew-thankyou .ew-lcr-bank-info p:last-child { margin-bottom: 0; }

/* Mobile */
@media (max-width: 700px) {
    .ew-thankyou-hero { padding: 32px 20px; }
    .ew-thankyou-hero h1 { font-size: 26px; }
    .ew-thankyou-icon { width: 72px; height: 72px; }
    .ew-thankyou-icon svg { width: 36px; height: 36px; }
    .ew-thankyou .woocommerce-customer-details .col2-set { grid-template-columns: 1fr; }
    .ew-thankyou-actions .ew-thankyou-btn { width: 100%; justify-content: center; }
}

/* ---------- Mobile checkout ---------- */

@media (max-width: 768px) {
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last {
        width: 100%;
        margin: 0 0 1.25rem;
        float: none;
    }
    .woocommerce-checkout-review-order { margin-top: 2rem; }
}
