/* ==========================================================================
   Wholesale Price BD — storefront integration layer
   style.css is the design ported 1:1. This file adds what the static design
   never needed: server-driven states (search suggestions, busy buttons,
   pagination, alerts, OTP) and a compatibility layer for the account views
   that still use the previous skin's class names.
   ========================================================================== */

.wp-lead  { font-size: 14px; color: var(--wp-muted); }
.wp-count { font-size: 14px; color: var(--wp-muted-2); }
.wp-opt-label { font-size: 15px; font-weight: 600; }
.wp-btn-contact { padding: 14px; font-size: 16px; font-weight: 600; }
.wp-btn-soft { padding: 11px; font-size: 15px; font-weight: 600; }
.wp-btn-login { padding: 14px; font-size: 16px; font-weight: 700; }
.btn[aria-busy="true"] { cursor: progress; }

/* Product details: solid action buttons */
.wp-pd-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px; font-size: 17px; font-weight: 700; color: #fff;
  border: 0; border-radius: 6px;
}
.wp-pd-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.wp-pd-btn.is-orange { background: #E95F30; }
.wp-pd-btn.is-orange:hover, .wp-pd-btn.is-orange:focus-visible { background: #D24E22; color: #fff; }
.wp-pd-btn.is-green { background: #4CE35E; }
.wp-pd-btn.is-green:hover, .wp-pd-btn.is-green:focus-visible { background: #36CC49; color: #fff; }

/* Cards: two-line names keep grid rows aligned */
.wp-p-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wp-card .btn:disabled { opacity: .7; }
.wp-ph { position: relative; overflow: hidden; }

/* Header search + suggestions */
.wp-search { position: relative; overflow: visible; }
.wp-search-input { border-radius: 10px 0 0 10px; }
.wp-search-btn { border-radius: 0 10px 10px 0; }
.wp-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1060;
  background: #fff; border: 1px solid var(--wp-line); border-radius: 12px;
  box-shadow: 0 16px 36px rgba(33, 28, 24, .14); max-height: min(60vh, 380px); overflow-y: auto;
}
.wp-suggest-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; color: var(--wp-ink); text-decoration: none; }
.wp-suggest-item + .wp-suggest-item { border-top: 1px solid var(--wp-line); }
.wp-suggest-item img { width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: cover; background: var(--wp-ph-sm); }
.wp-suggest-item:hover, .wp-suggest-item.is-active { background: var(--wp-tint); color: var(--wp-ink); }
.wp-suggest-note { padding: 12px 14px; font-size: 14px; color: var(--wp-muted-2); }

/* Drawers */
#wpMenu .wp-menu-info { padding-top: 11px; padding-bottom: 11px; }
.wp-drawer-name { font-size: 13px; line-height: 1.4; }
.wp-line-total { font-weight: 800; font-size: 16px; }
.wp-drawer-item .wp-remove { font-size: 15px; }
.wp-qty-xs button:disabled, .wp-qty-sm button:disabled { opacity: .4; cursor: default; }
.wp-variant-btn { padding: 10px 18px; font-size: 14px; font-weight: 600; --bs-btn-border-radius: 0.625rem; }

/* Banner: first slide visible before JS takes over */
.wp-slide { opacity: 0; z-index: 1; }
.wp-slide.is-on { opacity: 1; z-index: 2; }
.wp-slide > a { display: block; width: 100%; height: 100%; }

/* Flash sale countdown */
.wp-countdown { display: inline-flex; align-items: center; gap: 5px; font-family: var(--wp-num); font-weight: 700; color: var(--wp-ink); }
.wp-countdown span { min-width: 38px; padding: 4px 6px; border-radius: 8px; background: var(--wp-ink); color: #fff; font-size: 15px; text-align: center; }

/* Pills as links / toggle buttons */
a.wp-filter-pill { display: inline-block; text-decoration: none; }
a.wp-filter-pill:hover { color: var(--wp-primary); border-color: var(--wp-tint-line-2); }
.wp-filter-pill.is-on:hover { color: var(--wp-primary); }

/* Product page */
button.wp-thumb { padding: 0; width: 100%; cursor: pointer; }
button.wp-thumb:focus-visible { outline: 2px solid var(--wp-primary); outline-offset: 2px; }
.wp-spec-body { padding: 14px 16px; font-size: 14.5px; line-height: 1.75; overflow-x: auto; }
.wp-spec-body > :last-child { margin-bottom: 0; }
.wp-spec-body img { max-width: 100%; height: auto; }
.wp-spec-body table { width: 100%; border-collapse: collapse; }
.wp-spec-body th, .wp-spec-body td { padding: 9px 10px; border-bottom: 1px solid var(--wp-line); vertical-align: top; }
.wp-spec-body tr:nth-child(odd) { background: var(--wp-bg-soft); }

/* Pagination */
.wp-pager { display: flex; justify-content: center; margin-top: 28px; }
.wp-pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wp-page-link {
  min-width: 40px; height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--wp-line); border-radius: 10px; background: #fff;
  font-family: var(--wp-num); font-weight: 600; color: var(--wp-ink); text-decoration: none;
}
a.wp-page-link:hover { border-color: var(--wp-primary); color: var(--wp-primary); }
.wp-page-link.is-on { background: var(--wp-primary); border-color: var(--wp-primary); color: #fff; }
.wp-page-link.is-off { color: var(--wp-muted-3); }

/* Alerts + validation */
.wp-alert { border: 1px solid; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6; }
.wp-alert ul { margin: 0; padding-left: 18px; }
.wp-alert.is-error { background: #FDEEEC; border-color: #F5C9C3; color: #9B2C1F; }
.wp-alert.is-ok { background: var(--wp-green-soft); border-color: #BFE3CE; color: #1B6B3A; }
.form-control.is-invalid { border-color: #D0342C; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 0.2rem rgba(208, 52, 44, .12); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

/* CMS pages */
.wp-prose { font-size: 15px; line-height: 1.8; overflow-x: auto; }
.wp-prose img { max-width: 100%; height: auto; }
.wp-prose > :last-child { margin-bottom: 0; }

/* Login / OTP */
.wp-otp-digits { display: flex; justify-content: center; gap: 10px; }
.wp-otp-digits input { width: 56px; height: 58px; padding: 0; text-align: center; font-size: 24px; font-weight: 700; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 46px; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  display: flex; padding: 6px; border: 0; background: none; color: var(--wp-muted-2); cursor: pointer;
}
.pw-toggle .eye-off, .pw-toggle.is-on .eye-on { display: none; }
.pw-toggle.is-on .eye-off { display: block; }

/* Toast */
.wp-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1090;
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px;
  background: var(--wp-ink); color: #fff; font-size: 14px; text-align: center;
  box-shadow: 0 12px 30px rgba(33, 28, 24, .25);
  opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s;
}
.wp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .wp-toast { bottom: 28px; } }

/* Floating chat buttons (WhatsApp / Messenger) — sit above the mobile tab bar */
.wp-float-chat {
  position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 1025;
  display: flex; flex-direction: column; gap: 10px;
}
.wp-fc {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 50%; color: #fff; text-decoration: none;
  box-shadow: 0 8px 22px rgba(33, 28, 24, .22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.wp-fc:hover, .wp-fc:focus-visible { color: #fff; transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 26px rgba(33, 28, 24, .28); }
.wp-fc svg { width: 28px; height: 28px; fill: currentColor; }
.wp-fc.is-wa { background: #25D366; }
.wp-fc.is-ms { background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 100%); }
.wp-fc.is-wa::before {
  content: ""; position: absolute; inset: 0; width: 50px; height: 50px; border-radius: 50%;
  background: #25D366; opacity: .45; z-index: -1; animation: wp-fc-pulse 2.2s ease-out infinite;
}
@keyframes wp-fc-pulse { from { transform: scale(1); opacity: .45; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wp-fc.is-wa::before { animation: none; display: none; } }
@media (min-width: 768px) {
  .wp-float-chat { right: 22px; bottom: 24px; }
  .wp-fc { width: 56px; height: 56px; }
  .wp-fc.is-wa::before { width: 56px; height: 56px; }
}
/* keep toast clear of the stack */
.wp-float-chat ~ .wp-toast { max-width: calc(100vw - 100px); }

/* --------------------------------------------------------------------------
   Compatibility layer — account, order success, order tracking and register
   views keep the previous skin's class names; map them onto this palette.
   -------------------------------------------------------------------------- */

:root {
  --jp: var(--wp-primary); --jp-dark: var(--wp-primary-dark); --jp-soft: var(--wp-tint);
  --accent: var(--wp-primary); --accent-dark: var(--wp-primary-dark); --accent-soft: var(--wp-tint); --accent-line: var(--wp-tint-line-2);
  --ink: var(--wp-ink); --muted: var(--wp-muted); --muted-2: var(--wp-muted-2);
  --line: var(--wp-line); --line-2: var(--wp-line-2);
  --danger: #D0342C; --gold: #B4740A; --ok: #1B6B3A; --dark-1: var(--wp-ink);
}
.text-brand { color: var(--wp-primary) !important; }
.text-muted-2 { color: var(--wp-muted-2) !important; }
.bg-brand-soft { background: var(--wp-tint) !important; }
.btn-brand {
  --bs-btn-color: #fff; --bs-btn-bg: var(--wp-primary); --bs-btn-border-color: var(--wp-primary);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--wp-primary-dark); --bs-btn-hover-border-color: var(--wp-primary-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wp-primary-dark); --bs-btn-active-border-color: var(--wp-primary-dark);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--wp-primary); --bs-btn-disabled-border-color: var(--wp-primary);
  font-weight: 600;
}
.btn-outline-brand {
  --bs-btn-color: var(--wp-primary); --bs-btn-bg: #fff; --bs-btn-border-color: var(--wp-primary);
  --bs-btn-hover-color: var(--wp-primary); --bs-btn-hover-bg: var(--wp-tint); --bs-btn-hover-border-color: var(--wp-primary);
  --bs-btn-active-color: var(--wp-primary); --bs-btn-active-bg: var(--wp-tint); --bs-btn-active-border-color: var(--wp-primary);
  font-weight: 600;
}
.shadow-cta { box-shadow: 0 10px 24px -12px rgba(217, 83, 30, .55); }
.section-title { margin: 0; font-size: 22px; font-weight: 700; }
.viewall { font-size: 14px; font-weight: 600; }
.auth-card { background: #fff; border: 1px solid var(--wp-line); border-radius: 16px; }
.feature-ico { display: flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--wp-tint); color: var(--wp-primary); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-action {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--wp-line); border-radius: 99px; background: #fff; color: var(--wp-muted); text-decoration: none;
}
.card-action:hover { border-color: var(--wp-primary); color: var(--wp-primary); }
.product-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--wp-line); border-radius: 14px; }
.product-media { position: relative; aspect-ratio: 1 / 1; background: var(--wp-ph); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-media .stretched-cover { position: absolute; inset: 0; z-index: 1; }
.product-media .badge-disc { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 9px; border-radius: 99px; background: var(--wp-primary); color: #fff; font-size: 12px; font-weight: 700; }
.ph-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; font-size: 13px; color: var(--wp-muted-2); }
.product-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.product-name { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; }
.product-name a { color: var(--wp-ink); text-decoration: none; }
.min-h-name { min-height: 38px; }
.price-now { font-family: var(--wp-num); font-weight: 800; color: var(--wp-primary); }
.price-old { font-family: var(--wp-num); font-size: 12px; color: var(--wp-muted-3); text-decoration: line-through; }
