/**
 * B2B Wholesale Grocery – Public CSS
 * Covers: B2B registration form, product labels, social proof popup,
 *         brand filters, B2B pills, cookie consent banner, newsletter form,
 *         hero slider, category tiles, product carousels, account pages.
 */

/* ── Reset / base ──────────────────────────────────── */
.bwg-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    line-height: 1.4;
}
.bwg-btn:hover { opacity: 0.88; }
.bwg-btn-primary {
    background: #2563eb;
    color: #fff;
}
.bwg-btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}
.bwg-form-message {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.bwg-msg-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.bwg-msg-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── REGISTRATION FORM ─────────────────────────────── */
.bwg-register-wrap {
    max-width: 700px;
    margin: 40px auto;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.bwg-steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    gap: 4px;
    counter-reset: bwg-step;
}
.bwg-steps li {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 8px 4px;
    border-bottom: 3px solid #e2e8f0;
    position: relative;
    counter-increment: bwg-step;
}
.bwg-steps li::before {
    content: counter(bwg-step);
    display: block;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    line-height: 28px;
    margin: 0 auto 4px;
    font-weight: 700;
}
.bwg-steps li.bwg-step-active { color: #2563eb; border-color: #2563eb; }
.bwg-steps li.bwg-step-active::before { background: #2563eb; color: #fff; }
.bwg-steps li.bwg-step-done { color: #16a34a; border-color: #16a34a; }
.bwg-steps li.bwg-step-done::before { background: #16a34a; color: #fff; }

.bwg-step { display: none; }
.bwg-step.bwg-step-active { display: block; }
.bwg-step-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; color: #1e293b; }
.bwg-form-row { margin-bottom: 16px; }
.bwg-form-row--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bwg-form-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: #475569; }
.bwg-form-field input,
.bwg-form-field select,
.bwg-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #1e293b;
    box-sizing: border-box;
    transition: border 0.15s;
}
.bwg-form-field input:focus,
.bwg-form-field select:focus,
.bwg-form-field textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.bwg-field-error { border-color: #ef4444 !important; }
.bwg-step-error { color: #dc2626; font-size: 0.875rem; margin: 8px 0 0; }
.bwg-step-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.bwg-review-dl { columns: 2; gap: 24px; }
.bwg-review-dl dt { font-weight: 600; font-size: 0.8rem; color: #64748b; margin-top: 10px; }
.bwg-review-dl dd { margin-left: 0; font-size: 0.95rem; }
.bwg-terms-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.bwg-reg-success { text-align: center; padding: 40px 20px; color: #166534; background: #f0fdf4; border-radius: 8px; }

@media (max-width: 600px) {
    .bwg-form-row--2col { grid-template-columns: 1fr; }
    .bwg-review-dl { columns: 1; }
}

/* ── PRODUCT LABELS ────────────────────────────────── */
.bwg-labels {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bwg-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.6;
    color: #fff;
}
.bwg-label-new        { background: #2563eb; }
.bwg-label-sale       { background: #dc2626; }
.bwg-label-hot        { background: #ea580c; }
.bwg-label-clearance  { background: #7c3aed; }
.bwg-label-limited    { background: #0891b2; }
.bwg-label-bestseller { background: #ca8a04; }
.bwg-label-organic    { background: #16a34a; }
.bwg-label-kosher     { background: #1d4ed8; }
.bwg-label-halal      { background: #059669; }

/* ── SOCIAL PROOF POPUP ────────────────────────────── */
#bwg-social-proof {
    position: fixed;
    bottom: 24px; left: 24px;
    z-index: 99995;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,.16);
    padding: 14px 18px;
    max-width: 280px;
    width: calc(100% - 48px);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s, opacity 0.35s;
}
#bwg-social-proof.bwg-sp-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
#bwg-social-proof.bwg-sp-hidden { pointer-events: none; }
.bwg-sp-close {
    position: absolute;
    top: 6px; right: 10px;
    background: none; border: none;
    font-size: 1rem; cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    padding: 0;
}
.bwg-sp-inner { display: flex; align-items: flex-start; gap: 10px; }
.bwg-sp-icon  { font-size: 1.6rem; flex-shrink: 0; }
.bwg-sp-text  { font-size: 0.82rem; line-height: 1.5; color: #1e293b; }
.bwg-sp-buyer { font-weight: 700; }
.bwg-sp-time  { color: #64748b; font-size: 0.75rem; }

/* ── COOKIE CONSENT ────────────────────────────────── */
#bwg-cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 99994;
    background: #1e293b;
    color: #f1f5f9;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(100%);
    transition: transform 0.4s;
    flex-wrap: wrap;
}
#bwg-cookie-banner.bwg-cookie-visible { transform: translateY(0); }
#bwg-cookie-banner.bwg-cookie-hidden  { transform: translateY(100%); }
.bwg-cookie-text { font-size: 0.875rem; flex: 1; min-width: 200px; }
.bwg-cookie-text a { color: #93c5fd; }
.bwg-cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
#bwg-cookie-accept  { background: #22c55e; color: #fff; border: none; padding: 8px 18px; border-radius: 4px; cursor: pointer; font-weight: 600; }
#bwg-cookie-decline { background: transparent; color: #94a3b8; border: 1px solid #475569; padding: 8px 16px; border-radius: 4px; cursor: pointer; }

/* ── BRAND FILTER PILLS ────────────────────────────── */
.bwg-brand-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.bwg-brand-filter-btn {
    padding: 6px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    background: #fff;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: #1e293b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bwg-brand-filter-btn:hover,
.bwg-brand-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.bwg-brand-filter-logo {
    width: 18px; height: 18px;
    object-fit: contain;
    border-radius: 2px;
}

/* ── B2B PILLS (shop loop + single) ───────────────── */
.bwg-case-pill,
.bwg-b2b-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    margin: 2px 2px 0 0;
}
.bwg-cbm-pill { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.bwg-product-brand-loop {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 4px;
}

/* Per-unit breakdown in cart */
.bwg-per-unit-note {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── SHOP PER-PAGE SELECTOR ────────────────────────── */
.bwg-per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #475569;
}
.bwg-per-page-selector select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

/* ── NEWSLETTER SECTION ────────────────────────────── */
.bwg-newsletter-section {
    background: #1e293b;
    color: #f1f5f9;
    padding: 64px 24px;
}
.bwg-newsletter-section .bwg-section-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}
.bwg-newsletter-text { flex: 1; min-width: 200px; }
.bwg-newsletter-title { font-size: 2rem; font-weight: 700; margin: 0 0 8px; color: #fff; }
.bwg-newsletter-subtext { color: #94a3b8; margin: 0; }
.bwg-newsletter-form-wrap { flex: 1; min-width: 260px; }
.bwg-newsletter-input-group { display: flex; gap: 0; }
.bwg-newsletter-input-group input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.95rem;
}
.bwg-newsletter-input-group .bwg-btn {
    border-radius: 0 4px 4px 0;
    padding: 12px 20px;
    white-space: nowrap;
}
.bwg-newsletter-privacy { font-size: 0.75rem; color: #64748b; margin-top: 8px; }

/* ── HERO SLIDER ───────────────────────────────────── */
.bwg-hero-slider {
    position: relative;
    overflow: hidden;
    background: #1e293b;
}
.bwg-slider-track { position: relative; width: 100%; }
.bwg-slide {
    display: none;
    background-size: cover;
    background-position: center;
    min-height: 480px;
    align-items: center;
    justify-content: center;
}
.bwg-slide--active { display: flex; }
.bwg-slide-content {
    text-align: center;
    padding: 40px 24px;
    max-width: 700px;
    background: rgba(0,0,0,.35);
    border-radius: 8px;
}
.bwg-slide-heading {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.2;
}
.bwg-slide-subtext { color: #e2e8f0; font-size: 1.1rem; margin: 0 0 24px; }
.bwg-btn-hero { background: #f59e0b; color: #1e293b; font-weight: 800; font-size: 1rem; }
.bwg-slider-prev,
.bwg-slider-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 8px 16px;
    cursor: pointer;
    z-index: 5;
    border-radius: 4px;
    transition: background 0.2s;
}
.bwg-slider-prev:hover,
.bwg-slider-next:hover { background: rgba(255,255,255,.3); }
.bwg-slider-prev { left: 12px; }
.bwg-slider-next { right: 12px; }
.bwg-slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.bwg-slider-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}
.bwg-slider-dot--active { background: #fff; }

@media (max-width: 640px) {
    .bwg-slide { min-height: 300px; }
    .bwg-slide-heading { font-size: 1.5rem; }
}

/* ── CATEGORY TILES ────────────────────────────────── */
.bwg-category-tiles { padding: 48px 24px; }
.bwg-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.bwg-cat-tile {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.bwg-cat-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.bwg-cat-tile-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
}
.bwg-cat-tile-label {
    padding: 10px 12px;
    background: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}
.bwg-cat-tile-label small { display: block; color: #64748b; font-weight: 400; font-size: 0.75rem; margin-top: 2px; }

/* ── PRODUCT CAROUSEL ──────────────────────────────── */
.bwg-product-carousel { padding: 48px 0; }
.bwg-carousel-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
}
.bwg-carousel-wrapper { position: relative; }
.bwg-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 8px 48px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}
.bwg-carousel-track::-webkit-scrollbar { display: none; }
.bwg-carousel-track.bwg-grabbing { cursor: grabbing; }
.bwg-carousel-item { flex: 0 0 220px; }
.bwg-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: box-shadow 0.2s;
    height: 100%;
}
.bwg-product-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.13); }
.bwg-product-card-img-link { display: block; position: relative; }
.bwg-product-card-img-link img { width: 100%; height: 180px; object-fit: cover; display: block; }
.bwg-product-card-body { padding: 12px 14px 16px; }
.bwg-product-brand { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 4px; }
.bwg-product-title { font-size: 0.9rem; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.bwg-product-title a { color: #1e293b; text-decoration: none; }
.bwg-product-title a:hover { color: #2563eb; }
.bwg-product-price { font-weight: 700; color: #2563eb; margin: 6px 0 10px; font-size: 0.95rem; }
.bwg-carousel-prev,
.bwg-carousel-next {
    position: absolute;
    top: 50%; transform: translateY(-60%);
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 1.5rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.bwg-carousel-prev:hover,
.bwg-carousel-next:hover { background: #f1f5f9; }
.bwg-carousel-prev { left: 6px; }
.bwg-carousel-next { right: 6px; }

/* ── WHY CHOOSE US ─────────────────────────────────── */
.bwg-why-choose-us { padding: 64px 24px; background: #f8fafc; }
.bwg-why-choose-us .bwg-section-inner { max-width: 1100px; margin: 0 auto; }
.bwg-section-title { text-align: center; font-size: 1.8rem; font-weight: 700; margin-bottom: 40px; color: #1e293b; }
.bwg-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}
.bwg-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.bwg-feature-icon { font-size: 2.4rem; margin-bottom: 12px; color: #2563eb; }
.bwg-feature-title { font-size: 1rem; font-weight: 700; margin: 0 0 6px; color: #1e293b; }
.bwg-feature-text { font-size: 0.875rem; color: #64748b; margin: 0; line-height: 1.55; }

/* ── LEAD CTA SECTION ──────────────────────────────── */
.bwg-lead-cta-section { padding: 64px 24px; background: #fff; }
.bwg-lead-cta-section .bwg-section-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.bwg-lead-cta-content { flex: 1; min-width: 200px; }
.bwg-lead-cta-title { font-size: 1.8rem; font-weight: 800; color: #1e293b; margin: 0 0 10px; }
.bwg-lead-cta-subtext { color: #64748b; line-height: 1.6; margin: 0; }
.bwg-lead-cta-form { flex: 1; min-width: 280px; }
.bwg-lead-form .bwg-form-field { margin-bottom: 14px; }
.bwg-lead-form .bwg-form-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; color: #475569; }
.bwg-lead-form .bwg-form-field input,
.bwg-lead-form .bwg-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9rem;
}
.bwg-lead-form .bwg-form-field textarea { resize: vertical; }

/* ── MY ACCOUNT ────────────────────────────────────── */
.bwg-dashboard { padding: 8px 0; }
.bwg-dashboard-welcome { margin-bottom: 28px; }
.bwg-dashboard-welcome h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 8px; }
.bwg-role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.bwg-role-badge.bwg-pending { background: #f59e0b; }
.bwg-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.bwg-dashboard-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}
.bwg-dashboard-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 14px; color: #1e293b; }
.bwg-quick-links { list-style: none; padding: 0; margin: 0; }
.bwg-quick-links li { margin-bottom: 8px; }
.bwg-quick-links a { color: #2563eb; text-decoration: none; font-size: 0.9rem; }
.bwg-quick-links a:hover { text-decoration: underline; }
.bwg-account-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 0.875rem; }
.bwg-account-meta dt { color: #64748b; font-weight: 600; }
.bwg-account-meta dd { margin: 0; color: #1e293b; }
.bwg-orders-table th, .bwg-orders-table td { font-size: 0.85rem; }
.bwg-overdue { color: #dc2626; font-weight: 700; }

.bwg-company-table td input { width: 100%; box-sizing: border-box; }

/* ── BRAND ARCHIVE ─────────────────────────────────── */
.bwg-brand-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.bwg-brand-logo img { max-width: 120px; max-height: 80px; object-fit: contain; }
.bwg-brand-name { font-size: 1.8rem; font-weight: 700; margin: 0 0 6px; }
.bwg-brand-description { color: #64748b; max-width: 600px; margin: 0; }
