/* ============================================================
   UnboxTools Bulk Pricing — Frontend styles
   Palette: black #000, white #fff, orange #ff4d01
   Layout: horizontal rows (one per slab, stacked vertically)
   Optimised for: Flatsome theme + mobile (down to 320px)
   ============================================================ */

.ubp-pricing-section {
    margin: 14px 0 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    -webkit-text-size-adjust: 100%;
}

/* Variable products: keep the widget hidden until the customer has picked a
   complete variation. JS toggles this class on `found_variation` /
   `reset_data` / `hide_variation`. */
.ubp-pricing-section.ubp-awaiting-variation {
    display: none;
}

.ubp-pricing-wrap {
    font-family: inherit;
    color: #1a1a1a;
    background: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header (compact: just the title) ---------- */
.ubp-pricing-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #000;
    letter-spacing: -0.2px;
    line-height: 1.2;
    text-align: center;
}

.ubp-pricing-title span { color: #ff4d01; }

/* ---------- Tier list (horizontal rows, stacked) ---------- */
.ubp-tiers-list {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 14px;
}

/* Each row is a 3-column grid: QTY | DISCOUNT | PRICE.
   The DISCOUNT column sits in the flexible middle (1fr) so it visually centres
   between the auto-sized QTY (left) and PRICE (right) columns, with generous
   inter-column spacing. Data rows (`[data-threshold]`) are clickable — clicking
   sets the WC qty input to the row's threshold (live JS in ubp-frontend.js). */
.ubp-tier-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    padding: 12px 18px;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ubp-tier-row:last-child { border-bottom: none; }

.ubp-tier-row[data-threshold] {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 77, 1, 0.12);
}

.ubp-tier-row[data-threshold]:not(.featured):hover {
    background: #fafafa;
}

.ubp-tier-row.featured[data-threshold]:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.ubp-tier-row[data-threshold]:focus-visible {
    outline: 2px solid #ff4d01;
    outline-offset: -2px;
}

/* Column header row */
.ubp-tier-row.ubp-tier-header {
    background: #f7f7f7;
    padding: 8px 18px;
    border-bottom: 1px solid #e0e0e0;
}

.ubp-tier-row.ubp-tier-header .ubp-tier-qty,
.ubp-tier-row.ubp-tier-header .ubp-tier-rate,
.ubp-tier-row.ubp-tier-header .ubp-tier-discount {
    font-size: 10px;
    font-weight: 700;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    line-height: 1.2;
}

.ubp-tier-row.featured {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    color: #fff;
}

.ubp-tier-row.active {
    background: #fff5f0;
    box-shadow: inset 4px 0 0 #ff4d01;
}

.ubp-tier-row.featured.active {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1408 100%);
    box-shadow: inset 4px 0 0 #ff4d01;
}

.ubp-tier-qty {
    font-size: 13px;
    color: #444;
    line-height: 1.2;
    text-align: left;
}

.ubp-tier-qty strong {
    font-size: 18px;
    font-weight: 800;
    color: #000;
    margin-right: 3px;
}

.ubp-tier-row.featured .ubp-tier-qty,
.ubp-tier-row.featured .ubp-tier-qty strong { color: #fff; }

.ubp-tier-row.active .ubp-tier-qty strong { color: #ff4d01; }

/* PRICE column: right-aligned, sits in the middle 1fr column. */
.ubp-tier-rate {
    font-size: 17px;
    font-weight: 900;
    color: #ff4d01;
    line-height: 1.15;
    text-align: right;
}

.ubp-tier-rate .woocommerce-Price-amount,
.ubp-tier-rate bdi {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.ubp-tier-row.featured .ubp-tier-rate { color: #ff4d01; }

/* DISCOUNT column — per-pc savings amount, centred in the flexible middle column. */
.ubp-tier-discount {
    font-size: 14px;
    font-weight: 700;
    color: #ff4d01;
    line-height: 1.15;
    text-align: center;
    min-width: 60px;
}

/* Match the "pcs" suffix in the QTY column: same colour as `.ubp-tier-qty`
   (which provides the cell-level colour the trailing text inherits). */
.ubp-tier-discount .ubp-discount-suffix {
    font-size: 11px;
    font-weight: 500;
    color: #444;
    margin-left: 1px;
    letter-spacing: 0;
}

.ubp-tier-row.featured .ubp-tier-discount .ubp-discount-suffix { color: #fff; }
.ubp-tier-row.ubp-tier-header .ubp-tier-discount .ubp-discount-suffix { display: none; }

.ubp-tier-discount .woocommerce-Price-amount,
.ubp-tier-discount bdi {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.ubp-tier-row.featured .ubp-tier-discount { color: #ff4d01; }

/* POPULAR badge — sits inline next to the qty number on featured rows. */
.ubp-popular-tag {
    display: inline-block;
    background: #ff4d01;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 3px;
    letter-spacing: 1px;
    line-height: 1.4;
    white-space: nowrap;
    margin-left: 6px;
    vertical-align: middle;
}

/* ---------- CTA row ---------- */
.ubp-cta-row {
    margin-top: 14px;
    text-align: center;
    padding: 16px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #ff4d01;
}

.ubp-cta-row h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #000;
    font-weight: 700;
    line-height: 1.3;
}

.ubp-cta-row p {
    margin: 0 0 10px;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.ubp-cta-login {
    background: #fff;
}

.ubp-btn {
    display: inline-block;
    background: #ff4d01;
    color: #fff !important;
    padding: 11px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.4px;
    margin: 3px;
    transition: background 0.2s, transform 0.1s;
    line-height: 1.2;
    min-height: 40px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.15);
}

.ubp-btn:hover { background: #cc3d00; color: #fff !important; }
.ubp-btn:active { transform: translateY(1px); }
.ubp-btn-wa { background: #25d366; }
.ubp-btn-wa:hover { background: #1ebe5a; }

.ubp-note {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    font-style: italic;
    line-height: 1.4;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet (≤ 768px) */
@media (max-width: 768px) {
    .ubp-pricing-title { font-size: 16px; }
    .ubp-tier-row {
        gap: 18px;
        padding: 11px 14px;
    }
    .ubp-tier-row.ubp-tier-header { padding: 7px 14px; }
    .ubp-tier-qty strong { font-size: 16px; }
    .ubp-tier-rate { font-size: 16px; }
    .ubp-tier-discount { font-size: 13px; min-width: 56px; }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    .ubp-tier-row {
        gap: 14px;
        padding: 10px 12px;
    }
    .ubp-tier-row.ubp-tier-header { padding: 6px 12px; }
    .ubp-tier-discount { font-size: 12px; min-width: 48px; }
    .ubp-popular-tag {
        font-size: 8px;
        padding: 2px 7px;
        margin-left: 5px;
        letter-spacing: 0.6px;
    }
}

/* Small mobile (≤ 380px) */
@media (max-width: 380px) {
    .ubp-pricing-title { font-size: 15px; }
    .ubp-tier-row {
        gap: 10px;
        padding: 9px 10px;
    }
    .ubp-tier-row.ubp-tier-header { padding: 6px 10px; }
    .ubp-tier-qty strong { font-size: 15px; }
    .ubp-tier-rate { font-size: 15px; }
    .ubp-tier-discount { font-size: 11px; min-width: 42px; }
    .ubp-cta-row h3 { font-size: 14px; }
    .ubp-btn { padding: 10px 16px; font-size: 12px; display: block; margin: 5px 0; }
}

/* ============================================================
   "Why Register" banner
   ============================================================ */
.ubp-register-banner {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 50%, #ff4d01 100%);
    color: #fff;
    padding: 22px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin: 16px 0 12px;
}

.ubp-register-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 12px);
    pointer-events: none;
}

.ubp-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.ubp-register-banner h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
    color: #fff;
    line-height: 1.2;
}

.ubp-register-banner h2 span { color: #ff4d01; }

.ubp-register-banner p {
    font-size: 13px;
    opacity: 0.85;
    margin: 0 0 12px;
    color: #fff;
    line-height: 1.45;
}

.ubp-benefits-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ubp-benefit-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.ubp-benefit-pill strong { color: #ff4d01; }

.ubp-register-btn {
    display: inline-block;
    background: #fff;
    color: #ff4d01 !important;
    padding: 12px 26px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    min-height: 44px;
    box-sizing: border-box;
    line-height: 1.2;
    -webkit-tap-highlight-color: rgba(216, 67, 21, 0.15);
}

.ubp-register-btn:hover { transform: translateY(-2px); color: #ff4d01 !important; }

.ubp-register-sub {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 10px;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .ubp-register-banner { padding: 18px 14px; }
    .ubp-register-banner h2 { font-size: 18px; }
    .ubp-register-banner p { font-size: 12px; }
    .ubp-benefits-row { gap: 6px; }
    .ubp-benefit-pill { font-size: 11px; padding: 6px 11px; }
}

@media (max-width: 380px) {
    .ubp-register-banner h2 { font-size: 16px; }
    .ubp-benefit-pill { font-size: 10px; padding: 5px 9px; }
    .ubp-register-btn { padding: 12px 22px; font-size: 13px; }
}

/* ============================================================
   Flatsome theme tweaks
   ============================================================ */

/* Heavy h2 styles from Flatsome — keep our title alignment + size */
.ubp-pricing-wrap h2.ubp-pricing-title {
    text-align: center;
    margin: 0 0 10px;
    padding: 0;
}

/* Flatsome's global `.button` class can leak — neutralize on our buttons */
.ubp-cta-row a.ubp-btn,
.ubp-banner-inner a.ubp-register-btn {
    text-transform: none;
    letter-spacing: 0.5px;
    border: none;
}

/* Flatsome's `<ul>` margin can affect our perks list */
.ubp-pricing-wrap ul.ubp-perks { margin: 0; padding: 0; list-style: none; }
.ubp-pricing-wrap ul.ubp-perks li { list-style: none; margin: 0; }
