/*
 * MANEO SC Inventory – consolidated frontend styles
 *
 * Sections:
 *  1) Speed Sale checkout (conditional enqueue)
 *  2) SC QR customer checkout (shop-qr-entry / QR-triggered checkout)
 *  3) Checkout focus cleanup (headings, WPML switcher)
 *  4) Order received / receipt screen (QR flow)
 */

/* ------------------------------------------------------------------
 * 1) SPEED SALE CHECKOUT (only enqueued in Speed Sale checkout context)
 * ------------------------------------------------------------------ */

/* Speed Sale checkout: reduce clutter, keep everything above the fold */

/* Payment panel styling (DO NOT HIDE).
   Previous builds hid the payment panel and that broke checkout (no payment methods shown).
   We only keep light styling here. */
#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
  background: rgba(129, 110, 153, .14);
  border-radius: 5px;
}

/* Hide privacy/terms blocks that normally sit above the Place order button */
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper,
.woocommerce-checkout .woocommerce-privacy-policy-text {
  display: none !important;
}

/* Make sure our moved button looks normal */
.maneo-speed-sale-place-order-wrap {
  margin-top: 12px;
}

/* If theme adds extra spacing, keep it compact */
.woocommerce-checkout .woocommerce-additional-fields {
  margin-bottom: 8px;
}


/* ------------------------------------------------------------------
 * 2) SC QR CUSTOMER CHECKOUT (only for QR flow)
 * ------------------------------------------------------------------ */

/* Hide redundant section headings in QR checkout */
body.maneo-sc-qr-checkout .woocommerce-billing-fields > h3 {
  display: none !important; /* "Billing details" */
}

/* Hide country/region row (QR flow, no shipping) */
body.maneo-sc-qr-checkout #billing_country_field {
  display: none !important; /* "Country / Region" row */
}

/* Hide ONLY the "Additional information" heading (keep notes field) */
body.maneo-sc-qr-checkout .woocommerce-additional-fields > h3 {
  display: none !important;
}

/* Spacing: add air before "Your order" */
body.maneo-sc-qr-checkout div#customer_details {
  margin-bottom: 30px !important;
}

/* Headings: keep "Your order" and "Choose your payment method" consistent */
body.maneo-sc-qr-checkout #order_review_heading,
body.maneo-sc-qr-checkout .maneo-choose-payment-title{
  margin: 10px 0 12px !important;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Hide irrelevant checkout notices in QR checkout flow */
body.maneo-sc-qr-checkout .woocommerce-notices-wrapper{
  /* wrapper (kept, but the content below is hidden) */
  margin: 0 !important;
}
body.maneo-sc-qr-checkout .woocommerce-message,
body.maneo-sc-qr-checkout .woocommerce-form-coupon-toggle{
  display: none;
}

/* Coupon form inside the "Forgotten something?" panel */
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.checkout_coupon,
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.woocommerce-form-coupon{
  margin: 10px 0 12px !important;
}
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.checkout_coupon p{
  margin: 0 0 10px !important;
}

/* Remove Subtotal row in order review table (QR checkout) */
body.maneo-sc-qr-checkout tr.cart-subtotal{
  display: none !important;
}

/* Avoid double-spacing if themes add their own margins */
body.maneo-sc-qr-checkout div#payment{
  margin-top: 0 !important;
}


/* ------------------------------------------------------------------
 * 3) CHECKOUT FOCUS CLEANUP (all checkout pages)
 * ------------------------------------------------------------------ */

/* WPML footer language switcher: no distraction during checkout */
body.woocommerce-checkout .wpml-ls-statics-footer.wpml-ls.wpml-ls-legacy-list-horizontal {
  display: none !important;
}


/* ------------------------------------------------------------------
 * 4) ORDER RECEIVED / RECEIPT (QR flow)
 * ------------------------------------------------------------------ */

/* Payment status notice ("Payment completed..." or "Pay with cash now") */
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-message{
  background:#2f7d32 !important;
  border-color:#2f7d32 !important;
  color:#ffffff !important;
  border-radius:12px;
}
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-message a{
  color:#ffffff !important;
  text-decoration:underline;
}

/* Mollie instructions (card payments): make it consistent (light green) */
.woocommerce-order-received section.woocommerce-order-details.woocommerce-info.mollie-instructions {
  background-color: #dff3df !important;
}

/* Gateway/COD instruction paragraph (right after order overview) */
.woocommerce-order-received ul.woocommerce-order-overview + p{
  background:#d6f0d8 !important;
  border:1px solid #b7e1b7 !important;
  border-left-width:6px !important;
  border-left-color:#2f7d32 !important;
  color:#1b5e20 !important;
  padding:14px 16px;
  border-radius:12px;
  margin-top:12px;
}

/* Important: show confirmation screen to seller + Next button */
.woocommerce-order-received .maneo-sc-confirm-hint{
  margin-top:12px;
  background:#dff3df !important;
  border:1px solid #b7e1b7 !important;
  border-left-width:6px !important;
  border-left-color:#2f7d32 !important;
  color:#1b5e20 !important;
  padding:14px 16px;
  border-radius:10px;
}
.woocommerce-order-received .maneo-sc-confirm-hint strong{font-weight:800;}
.woocommerce-order-received .maneo-sc-confirm-hint .maneo-next-btn{
  display:inline-block;
  margin-top:12px;
  padding:12px 18px;
  border-radius:10px;
  background:#2f7d32;
  color:#ffffff;
  text-decoration:none;
  font-weight:800;
}
.woocommerce-order-received .maneo-sc-confirm-hint .maneo-next-btn:active{transform:scale(0.99);}


/* ==========================
 * Checkout / Cart tweaks
 * ========================== */
.wp-block-woocommerce-cart.alignwide { padding: 30px; }


/* ==========================
 * QR Language chooser page
 * ========================== */
body.maneo-lang-chooser-page .entry-title{ display:none !important; }

/* ----------------------------------------------------------
 * LANG CHOOSER (QR ENTRY) – /lang_chooser_qr/
 * ---------------------------------------------------------- */

/* Hide WPML footer language switcher on our QR language chooser page (avoid distraction).
   Note: body class is injected by MANEO_SCI_Shortcodes::maybe_add_body_class(). */
body.maneo-lang-chooser-page .wpml-ls-statics-footer.wpml-ls.wpml-ls-legacy-list-horizontal {
    display: none !important;
}

/* True vertical centering on the viewport (mobile first)
   Neutralize theme paddings/margins and center the chooser container. */
body.maneo-lang-chooser-page .site-content,
body.maneo-lang-chooser-page .content-area,
body.maneo-lang-chooser-page .inside-article,
body.maneo-lang-chooser-page .entry-content {
    margin: 0 !important;
    padding: 0 !important;
}

/* Make the visible content fill the viewport and center our chooser */
body.maneo-lang-chooser-page .entry-content {
	/* 100svh behaves better on mobile (browser UI). Keep 100vh as fallback. */
	min-height: 100vh;
	min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Allow the document chain to stretch so flex centering is reliable. */
body.maneo-lang-chooser-page,
body.maneo-lang-chooser-page #page,
body.maneo-lang-chooser-page #content,
body.maneo-lang-chooser-page .site-content,
body.maneo-lang-chooser-page .content-area,
body.maneo-lang-chooser-page .site-main,
body.maneo-lang-chooser-page article,
body.maneo-lang-chooser-page .inside-article {
	height: auto;
	min-height: 100vh;
	min-height: 100svh;
}

/* Center the chooser container itself and avoid extra top/bottom whitespace from theme wrappers. */
body.maneo-lang-chooser-page .maneo-lang-chooser {
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Keep some breathing room so it doesn't touch the very edges */
body.maneo-lang-chooser-page .maneo-lang-chooser {
    padding: 18px 14px;
}

/* =====================================================================
 * QR Shop Entry (shop-qr-entry)
 * =================================================================== */

body.maneo-qr-entry-page .wpml-ls-statics-footer.wpml-ls.wpml-ls-legacy-list-horizontal,
body.maneo-qr-entry .wpml-ls-statics-footer.wpml-ls.wpml-ls-legacy-list-horizontal {
    display: none !important;
}

/* Hide stock info – no value in the SpeedSale/QR context */
body.maneo-qr-entry-page .stock,
body.maneo-qr-entry .stock {
    display: none !important;
}

/* Product / Shop layout tweaks for a fast, mobile-first buy-flow */
body.maneo-qr-entry-page .woocommerce-products-header,
body.maneo-qr-entry .woocommerce-products-header,
body.maneo-qr-entry-page .woocommerce-result-count,
body.maneo-qr-entry .woocommerce-result-count,
body.maneo-qr-entry-page .woocommerce-ordering,
body.maneo-qr-entry .woocommerce-ordering {
    display: none !important;
}

body.maneo-qr-entry-page ul.products,
body.maneo-qr-entry ul.products {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.maneo-qr-entry-page ul.products li.product,
body.maneo-qr-entry ul.products li.product {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

body.maneo-qr-entry-page .woocommerce-loop-product__title,
body.maneo-qr-entry .woocommerce-loop-product__title,
body.maneo-qr-entry-page.single-product div.product .product_title,
body.maneo-qr-entry.single-product div.product .product_title {
    color: #111 !important;
}

body.maneo-qr-entry-page .button,
body.maneo-qr-entry .button {
    border-radius: 12px !important;
}

/* Add-to-cart primary button */
body.maneo-qr-entry-page .single_add_to_cart_button.button,
body.maneo-qr-entry .single_add_to_cart_button.button,
body.maneo-qr-entry-page a.button.add_to_cart_button,
body.maneo-qr-entry a.button.add_to_cart_button {
    background: #2f7d32 !important;
    color: #fff !important;
    padding: 14px 18px !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
}

body.maneo-qr-entry-page .single_add_to_cart_button.button:hover,
body.maneo-qr-entry .single_add_to_cart_button.button:hover,
body.maneo-qr-entry-page a.button.add_to_cart_button:hover,
body.maneo-qr-entry a.button.add_to_cart_button:hover {
    filter: brightness(0.95);
}

body.maneo-lang-chooser-page .maneo-lang-chooser {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

body.maneo-lang-chooser-page .maneo-lang-chooser h2 {
    display: none;
}

body.maneo-lang-chooser-page .maneo-lang-chooser-buttons {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
}

body.maneo-lang-chooser-page a.maneo-lang-btn {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.75);
}

body.maneo-lang-chooser-page a.maneo-lang-btn img {
    height: 140px;
    width: auto;
}

body.maneo-lang-chooser-page a.maneo-lang-btn:hover,
body.maneo-lang-chooser-page a.maneo-lang-btn:focus {
    background: rgba(255,255,255,0.95);
}

body.maneo-lang-chooser-page a.maneo-lang-btn img {
    height: 140px;
    width: auto;
    max-width: 52%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

body.maneo-lang-chooser-page a.maneo-lang-btn span.maneo-lang-label {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
}

@media (max-width: 420px) {
    body.maneo-lang-chooser-page a.maneo-lang-btn img {
        height: 140px;
    }
    body.maneo-lang-chooser-page a.maneo-lang-btn span.maneo-lang-label {
        font-size: 18px;
    }
}


/* === SC QR Checkout: "Anything else?" panel (near Place order) === */
body.maneo-sc-qr-checkout .maneo-anything-else-wrap{
  margin: 10px 0 8px !important;
}
body.maneo-sc-qr-checkout details.maneo-anything-else{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}
body.maneo-sc-qr-checkout details.maneo-anything-else > summary{
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  outline: none;
}
body.maneo-sc-qr-checkout .maneo-anything-else-body{
  margin-top: 10px;
}
body.maneo-sc-qr-checkout .maneo-anything-else-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
body.maneo-sc-qr-checkout .maneo-anything-else-link{
  font-size: 13px;
  text-decoration: underline;
}
body.maneo-sc-qr-checkout .maneo-order-comments-field textarea{
  min-height: 90px;
}

/* Coupon form when moved into the "Forgotten something?" panel */
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.checkout_coupon,
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.woocommerce-form-coupon{
  margin: 0 0 10px 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.checkout_coupon .form-row,
body.maneo-sc-qr-checkout #maneo-additional-tools-wrap form.woocommerce-form-coupon .form-row{
  margin: 0 0 8px 0;
}

/* -------------------------------------------------------------------------
 * User requested CSS (scoped to plugin pages only)
 * ------------------------------------------------------------------------- */

/*   .../checkout-sc/  */
body.maneo-sc-qr-checkout .maneo-anything-else summary {
    text-align: end;
    color: #d2d2d2;
}

body.maneo-sc-qr-checkout table.shop_table.woocommerce-checkout-review-order-table thead {
    display: none;
}

body.maneo-sc-qr-checkout #add_payment_method #payment,
body.maneo-sc-qr-checkout .woocommerce-cart #payment,
body.maneo-sc-qr-checkout .woocommerce-checkout #payment {
    background: #dff3df !important;
    border-radius: 5px;
}

body.maneo-sc-qr-checkout button#place_order {
    background: #2f7d32 !important;
    border-radius: 10px;
}

/*  /checkout-sc/order-received/  */
body.maneo-sc-qr-order-received section.woocommerce-order-details,
body.maneo-sc-qr-order-received section.woocommerce-customer-details {
    display: none;
}

/* Frontend */
.maneo-sc-line .k,
.maneo-sc-line .v,
table.maneo-sc-table.maneo-sc-table-compact {
    font-size: 17px;
    font-weight: 900;
    text-align: left;
}

table.maneo-sc-table.maneo-sc-table-compact thead {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    opacity: .75;
}

/* === Seller portal: neutral buttons (scoped) === */
.maneo-sc-portal .button,
.maneo-sc-portal button.button,
.maneo-sc-portal input[type="button"],
.maneo-sc-portal input[type="submit"] {
    border-radius: 12px;
}

.maneo-sc-portal .button.button-primary,
.maneo-sc-portal button.button-primary,
.maneo-sc-portal input.button-primary {
    background: #444 !important;
    border-color: #444 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.maneo-sc-portal .button.button-primary:hover,
.maneo-sc-portal button.button-primary:hover,
.maneo-sc-portal input.button-primary:hover {
    background: #333 !important;
    border-color: #333 !important;
}

.maneo-sc-portal .button:disabled,
.maneo-sc-portal button:disabled,
.maneo-sc-portal input:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

/* Payment status badge */
.maneo-pay-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
    border: 1px solid rgba(0,0,0,.18);
    background: #fff;
    color: #444;
}

.maneo-pay-badge--draft { background:#fff; color:#444; }
.maneo-pay-badge--pending { background:#fff; color:#444; }
.maneo-pay-badge--paid { background:#fff; color:#1f6f3a; border-color: rgba(31,111,58,.35); }
.maneo-pay-badge--refunded { background:#fff; color:#0b4a6b; border-color: rgba(11,74,107,.35); }
.maneo-pay-badge--failed { background:#fff; color:#8a1f1f; border-color: rgba(138,31,31,.35); }
.maneo-pay-badge--completed { background:#fff; color:#111; border-color: rgba(0,0,0,.35); }
.maneo-pay-badge--none { background:#fff; color:#444; }

/* When postings are applied, lock editing + hide action buttons */
.maneo-adj-locked .maneo-sc-card input,
.maneo-adj-locked .maneo-sc-card textarea,
.maneo-adj-locked .maneo-sc-card select,
.maneo-adj-locked .maneo-sc-card button {
    pointer-events: none;
}

.maneo-adj-locked #maneo-finalize-cash,
.maneo-adj-locked #maneo-finalize-card {
    display: none !important;
}
