/* ==========================================================================
   LuxDesign B2B — front-end + admin styles
   ========================================================================== */

/* Trade customers are priced off the NORMAL (regular) price — their discount never
   stacks with Finale Lite or native WooCommerce sale prices. The theme's sale flash is
   therefore both inaccurate for them and would reveal the discount % (which we hide),
   so remove it entirely on every surface for trade users (cards, carousels, quick-view,
   related). The <body> carries `luxb2b-trade` for approved trade users site-wide. */
body.luxb2b-trade .sale-badge,
body.luxb2b-trade .onsale,
body.luxb2b-trade .qv-image .sale-badge,
body.luxb2b-trade .gallery-badge,
body.luxb2b-trade #gallerySaleBadge { display: none !important; }

/* ---- Price block / gating (product cards + single) ---- */
.luxb2b-price { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
/* Trade customers see THEIR price in red. Force it (incl. the inner wc_price
   .amount/bdi spans) so no theme rule on .product-price/.amount can override it. */
.luxb2b-trade-price,
.luxb2b-trade-price .amount,
.luxb2b-trade-price bdi { color: var(--red, #E53935) !important; }
.luxb2b-trade-price { font-size: 1.05em; font-weight: 700; }
.luxb2b-price--single .luxb2b-trade-price,
.product-price .luxb2b-trade-price { font-size: 1.6rem; }
.luxb2b-from { font-size: .6em; font-weight: 600; text-transform: lowercase; color: var(--gray, #666) !important; }
.luxb2b-rrp,
.luxb2b-rrp .amount,
.luxb2b-rrp bdi { color: #9a9a9a !important; font-weight: 400; }
.luxb2b-rrp { font-size: .85em; }
.luxb2b-rrp s { text-decoration: line-through; }
/* The old "Вашата търговска цена −X%" label is gone from the markup, but hide it
   defensively so any page still served from cache with the old markup shows only
   the struck original + the (red) net price — never the discount %. */
.luxb2b-trade-label { display: none !important; }

.luxb2b-rrp-label { font-size: .7em; text-transform: uppercase; letter-spacing: .05em; color: #9a9a9a; }
.luxb2b-rrp-value { color: #555; font-weight: 600; }

.luxb2b-gate {
  display: inline-block; margin-top: 2px;
  font-size: .82em; font-weight: 600; text-decoration: none;
  color: #1a1a1a;
}
.luxb2b-gate--login { color: #b8860b; }
.luxb2b-gate--login:hover, .luxb2b-gate--apply:hover { text-decoration: underline; }
.luxb2b-gate--apply { color: #6a6a6a; font-weight: 500; }
.luxb2b-gate--pending { color: #a06a00; font-style: italic; font-weight: 500; }
.luxb2b-request { font-weight: 700; color: #1a1a1a; }

/* Compact variant inside grid cards.
   The theme's base `.product-price` is 36px (styled for the SINGLE product page).
   The B2B price block uses em-relative sizes, so inside a card it would inherit
   that 36px and render huge. Pin an explicit, small base + child sizes here so
   card prices match the theme's normal `.price-regular` (20px) look. */
.product-card .luxb2b-price { align-items: flex-start; font-size: 15px; gap: 2px; }
.product-card .luxb2b-gate { font-size: .78em; }
.product-card .product-price .luxb2b-trade-price,
.product-card .luxb2b-trade-price { font-size: 20px; font-weight: 700; color: var(--red, #E53935); }
.product-card .luxb2b-rrp { font-size: 13px; }
.product-card .luxb2b-trade-label { font-size: 11px; }
.product-card .luxb2b-rrp-label { font-size: 11px; }
.product-card .luxb2b-rrp-value { font-size: 14px; font-weight: 600; }
.product-card .luxb2b-price--staff { font-size: 20px; font-weight: 700; color: var(--dark, #1a1a1a); }

/* ---- Registration form ---- */
.luxb2b-reg-form { max-width: 820px; margin: 0 auto; }
.luxb2b-reg-form fieldset {
  border: 1px solid #e6e2da; border-radius: 10px; padding: 20px 22px; margin: 0 0 22px;
}
.luxb2b-reg-form legend {
  padding: 0 10px; font-weight: 700; letter-spacing: .02em; color: #1a1a1a; font-size: 1.02rem;
}
.luxb2b-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.luxb2b-reg-form label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: #444; }
.luxb2b-reg-form .luxb2b-block { grid-column: 1 / -1; }
.luxb2b-reg-form input, .luxb2b-reg-form select, .luxb2b-reg-form textarea {
  padding: 10px 12px; border: 1px solid #d8d3c9; border-radius: 8px; font-size: .95rem;
  font-weight: 400; background: #fff; color: #1a1a1a; width: 100%;
}
.luxb2b-reg-form small { font-weight: 400; color: #8a8a8a; }
.luxb2b-submit {
  background: #1a1a1a !important; color: #fff !important; border: 0 !important;
  padding: 13px 34px !important; border-radius: 8px !important; font-weight: 600 !important;
  cursor: pointer; font-size: 1rem !important;
}
.luxb2b-submit:hover { background: #b8860b !important; }
.luxb2b-form-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.luxb2b-form-notice.error { background: #fdecea; color: #a12a1e; }
.luxb2b-form-notice.success { background: #eaf7ec; color: #1e6e2e; }

@media (max-width: 640px) { .luxb2b-grid { grid-template-columns: 1fr; } }

/* ---- Panels / banners ---- */
.luxb2b-panel { border: 1px solid #e6e2da; border-radius: 12px; padding: 26px; max-width: 640px; margin: 0 auto; text-align: center; }
.luxb2b-panel h3 { margin-top: 0; }
.luxb2b-status-pending { background: #fff8e6; border-color: #f0dca0; }
.luxb2b-status-approved { background: #eef8ef; border-color: #b6e0bd; }
.luxb2b-status-rejected { background: #fdecea; border-color: #f2b8b0; }

.luxb2b-banner { padding: 14px 18px; border-radius: 10px; margin: 0 0 18px; font-size: .95rem; }
.luxb2b-banner--ok { background: #eef8ef; border: 1px solid #b6e0bd; }
.luxb2b-banner--pending { background: #fff8e6; border: 1px solid #f0dca0; }

.luxb2b-login-intro { border: 1px solid #e6e2da; border-radius: 12px; padding: 20px 22px; margin-bottom: 22px; background: #faf8f4; }
.luxb2b-login-intro h3 { margin: 0 0 6px; }

/* ---- Buyer dashboard ---- */
.luxb2b-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.luxb2b-card { border: 1px solid #e6e2da; border-radius: 12px; padding: 16px 18px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.luxb2b-card__k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #9a9a9a; }
.luxb2b-card__v { font-size: 1.1rem; font-weight: 700; color: #1a1a1a; }
.luxb2b-card--status.luxb2b-status-approved { background: #eef8ef; border-color: #b6e0bd; }
.luxb2b-card--status.luxb2b-status-pending { background: #fff8e6; border-color: #f0dca0; }
.luxb2b-card--status.luxb2b-status-rejected { background: #fdecea; border-color: #f2b8b0; }

.luxb2b-details { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.luxb2b-details th { text-align: left; width: 180px; padding: 8px 10px; color: #7a7a7a; font-weight: 600; border-bottom: 1px solid #efece5; }
.luxb2b-details td { padding: 8px 10px; border-bottom: 1px solid #efece5; }

.luxb2b-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.luxb2b-tool { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid #e6e2da; border-radius: 12px; text-decoration: none; color: #1a1a1a; background: #fff; transition: border-color .15s, transform .15s; }
.luxb2b-tool:hover { border-color: #b8860b; transform: translateY(-2px); }
.luxb2b-tool__n { font-weight: 700; }
.luxb2b-tool__s { font-size: .8rem; color: #9a9a9a; }
.luxb2b-tool--soon { opacity: .6; pointer-events: none; }

/* ---- Admin ---- */
.luxb2b-review-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.luxb2b-inline { display: inline-flex; gap: 6px; align-items: center; }
.luxb2b-wrap .widefat td { vertical-align: top; }

/* ============================================================
   B2B homepage (trade front page) — reuses theme section shells
   ============================================================ */

/* Brand logo strip (replaces shop-by-category) */
.luxb2b-brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.luxb2b-brand-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.luxb2b-brand-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.luxb2b-brand-card img { max-width: 100%; max-height: 68px; height: auto; width: auto; object-fit: contain; filter: grayscale(1); opacity: .85; transition: filter .2s ease, opacity .2s ease; }
.luxb2b-brand-card:hover img { filter: grayscale(0); opacity: 1; }
.luxb2b-brand-name { font-weight: 600; font-size: 16px; color: #222; text-align: center; }

/* Two-up offer banners */
.offers-grid.luxb2b-offers-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 768px) { .offers-grid.luxb2b-offers-2 { grid-template-columns: 1fr; } }

/* New-arrivals load-more */
.luxb2b-loadmore {
    padding: 12px 28px !important;
    height: auto !important;
    font-size: 15px !important;
    border-radius: 999px !important;
}

/* Delivery banner */
.luxb2b-delivery-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    background: var(--bg-light, #f6f5f2);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
}

/* ============================================================
   Product page — trade enhancements
   ============================================================ */

/* Hide the theme "need help" box for approved trade customers */
body.luxb2b-trade .product-help-box { display: none !important; }

/* Download assets button */
.luxb2b-product-actions { margin: 16px 0; }
.luxb2b-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: background .2s ease;
}
.luxb2b-download-btn:hover { background: #333; color: #fff; }
.luxb2b-download-btn svg { flex: 0 0 auto; }
