/* ============ GlobalB2B Wholesale — Frontend Styles ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #1d4ed8; --blue-dark: #0f172a; --blue-light: #eff6ff;
  --orange: #f97316; --green: #16a34a; --red: #dc2626;
  --text: #1e293b; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc;
}
body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; color: var(--text); background: #fff; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border-radius: 8px; border: none; font-size: 15px; font-weight: 600; transition: .2s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #ea580c; }
.btn-outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }

/* announcement */
.announce { background: linear-gradient(90deg, #0f172a, #1d4ed8); color: #fff; font-size: 13px; padding: 8px 16px; text-align: center; }

/* header */
.header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; overflow: hidden; flex-shrink: 0; }
.brand-name { font-size: 21px; font-weight: 800; color: var(--blue-dark); letter-spacing: .3px; }
.brand-tag { font-size: 11px; color: var(--muted); }
.search-box { flex: 1; max-width: 460px; display: flex; }
.search-box input { border-radius: 8px 0 0 8px; border-right: none; }
.search-box button { border-radius: 0 8px 8px 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.currency-toggle { display: inline-flex; border: 1.5px solid var(--blue); border-radius: 8px; overflow: hidden; }
.currency-toggle button { border: none; background: #fff; color: var(--blue); padding: 7px 14px; font-weight: 700; font-size: 13px; }
.currency-toggle button.on { background: var(--blue); color: #fff; }
.icon-btn { background: var(--blue-light); color: var(--blue); border-radius: 8px; padding: 9px 14px; font-weight: 600; font-size: 14px; border: none; }

/* nav */
.nav { background: var(--blue-dark); }
.nav-inner { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-inner a { color: #cbd5e1; padding: 12px 18px; font-size: 14px; font-weight: 600; border-radius: 6px 6px 0 0; }
.nav-inner a:hover, .nav-inner a.active { color: #fff; background: var(--blue); }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 14px; margin: 22px 0; }
.hero-slides { display: flex; transition: transform .5s ease; }
.hero-slide { min-width: 100%; position: relative; }
.hero-slide img { width: 100%; height: 380px; object-fit: cover; display: block; }
.hero-caption { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 60px; color: #fff; background: linear-gradient(90deg, rgba(15,23,42,.55), transparent); }
.hero-caption h2 { font-size: 40px; margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero-caption p { font-size: 17px; opacity: .95; margin-bottom: 22px; max-width: 520px; }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.hero-dots span.on { background: #fff; width: 26px; border-radius: 6px; }

/* sections */
.section { padding: 36px 0 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-head h3 { font-size: 24px; color: var(--blue-dark); border-left: 5px solid var(--orange); padding-left: 12px; }
.section-head a { color: var(--blue); font-size: 14px; font-weight: 600; }

/* categories */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 12px; text-align: center; transition: .2s; }
.cat-card:hover { border-color: var(--blue); box-shadow: 0 8px 24px rgba(29,78,216,.12); transform: translateY(-3px); }
.cat-card .ico { font-size: 40px; }
.cat-card h4 { margin-top: 10px; font-size: 15px; }
.cat-card small { color: var(--muted); font-size: 12px; }

/* products */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: 0 10px 30px rgba(15,23,42,.12); transform: translateY(-3px); }
.product-card .img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.product-card .img img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.product-card:hover .img img { transform: scale(1.05); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.badge.stock-out { background: var(--muted); }
.product-card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card h4 { font-size: 15px; line-height: 1.4; height: 42px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card h4 a:hover { color: var(--blue); }
.price { font-size: 19px; font-weight: 800; color: var(--red); }
.price small { color: var(--muted); font-weight: 500; font-size: 12px; }
.meta-row { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.meta-row b { color: var(--green); }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; padding: 8px 6px; font-size: 13px; }

/* filter bar */
.filter-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 22px; }
.filter-bar select { width: auto; padding: 8px 12px; }
.filter-bar .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* product detail */
.detail-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; padding: 28px 0; }
.detail-gallery .main-img { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.detail-gallery .main-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.thumbs img.on { border-color: var(--blue); }
.detail-info h1 { font-size: 26px; line-height: 1.3; margin-bottom: 12px; }
.detail-price { background: var(--blue-light); border-radius: 12px; padding: 16px 18px; margin: 14px 0; }
.detail-price .p { font-size: 30px; font-weight: 800; color: var(--red); }
.detail-price .p small { font-size: 13px; color: var(--muted); font-weight: 500; }
.detail-price .alt { color: var(--muted); font-size: 14px; margin-top: 4px; }
.kv { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; margin: 10px 0; }
.kv span { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.kv b { color: var(--green); }
.detail-actions { display: flex; gap: 12px; margin: 18px 0; }
.detail-actions .btn { flex: 1; padding: 14px; font-size: 16px; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.spec-table td { border: 1px solid var(--line); padding: 9px 14px; font-size: 14px; }
.spec-table td:first-child { background: var(--bg); width: 160px; color: var(--muted); }
.detail-desc { grid-column: 1 / -1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 30px; line-height: 1.8; font-size: 15px; }
.detail-desc h4 { margin: 16px 0 8px; color: var(--blue-dark); }
.detail-desc ul, .detail-desc ol { padding-left: 22px; }
.detail-desc li { margin: 4px 0; }

/* contact modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 28px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 24px; color: var(--muted); }
.modal h3 { margin-bottom: 6px; font-size: 20px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.qr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.qr-card { border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.qr-card img { width: 170px; height: 170px; object-fit: cover; border-radius: 10px; margin: 8px auto; }
.qr-card h5 { font-size: 15px; }
.qr-card small { color: var(--muted); display: block; margin-top: 4px; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border-radius: 10px; background: #25d366; color: #fff; font-weight: 700; font-size: 15px; border: none; margin-top: 8px; }
.inq-form { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; display: block; margin: 8px 0 4px; }

/* user center */
.uc-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 26px 0 40px; }
.uc-side { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: fit-content; }
.uc-side .user-brief { padding: 20px; text-align: center; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 8px; border: 2px solid rgba(255,255,255,.5); }
.tier { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 20px; background: rgba(255,255,255,.2); margin-top: 6px; }
.uc-side nav a { display: block; padding: 13px 20px; font-size: 14px; font-weight: 600; color: var(--text); border-left: 3px solid transparent; }
.uc-side nav a:hover, .uc-side nav a.active { background: var(--blue-light); color: var(--blue); border-left-color: var(--blue); }
.uc-main { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; min-height: 400px; }
.uc-main h3 { margin-bottom: 18px; font-size: 20px; }
.auth-box { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 10px; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; font-weight: 700; }
.auth-tabs button.on { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--bg); text-align: left; padding: 11px 14px; color: var(--muted); font-size: 13px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table tr:hover td { background: #f8fafc; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.tag-new { background: #dcfce7; color: #166534; }
.tag-progress { background: #fef9c3; color: #854d0e; }
.tag-done { background: #dbeafe; color: #1e40af; }
.tag-lost { background: #fee2e2; color: #991b1b; }

/* content page */
.page-content { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 34px 40px; margin: 26px 0 44px; line-height: 1.9; }
.page-content h2 { margin-bottom: 14px; }
.page-content h4 { margin: 18px 0 6px; }
.page-content ul, .page-content ol { padding-left: 24px; }

/* trust / features strip */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 30px 0 10px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; text-align: center; }
.feature .ico { font-size: 32px; }
.feature h4 { margin: 8px 0 4px; font-size: 15px; }
.feature p { color: var(--muted); font-size: 13px; }

/* newsletter */
.newsletter { background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: #fff; border-radius: 16px; padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 34px 0; flex-wrap: wrap; }
.newsletter h3 { font-size: 22px; }
.newsletter p { opacity: .85; margin-top: 4px; font-size: 14px; }
.newsletter form { display: flex; gap: 10px; min-width: 360px; }

/* footer */
.footer { background: var(--blue-dark); color: #cbd5e1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding: 44px 0 24px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer a, .footer p { font-size: 13px; line-height: 2; color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer .qr-mini { display: flex; gap: 14px; }
.footer .qr-mini img { width: 92px; height: 92px; border-radius: 10px; background: #fff; padding: 4px; }
.footer .qr-mini small { display: block; text-align: center; margin-top: 6px; font-size: 11px; }
.copyright { border-top: 1px solid #1e293b; padding: 18px 0; text-align: center; font-size: 12px; color: #64748b; }

/* floating contact */
.float-bar { position: fixed; right: 18px; bottom: 80px; display: flex; flex-direction: column; gap: 12px; z-index: 90; }
.float-btn { width: 52px; height: 52px; border-radius: 50%; border: none; color: #fff; font-size: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; }
.float-wa { background: #25d366; }
.float-wc { background: #07c160; }
.float-top { background: var(--blue-dark); }

/* toast */
.toast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--blue-dark); color: #fff; padding: 12px 26px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 400; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* misc */
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty .ico { font-size: 48px; }
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--blue); }
.note { font-size: 12px; color: var(--muted); }
.fav-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); font-size: 16px; color: #cbd5e1; }
.fav-btn.on { color: var(--red); }

@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-wrap { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .uc-wrap { grid-template-columns: 1fr; }
  .hero-caption h2 { font-size: 26px; }
  .header-top { flex-wrap: wrap; }
}

/* ---------- language switcher ---------- */
.lang-switch { border: 1.5px solid var(--blue); border-radius: 8px; background: #fff; color: var(--blue-dark); padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 150px; }

/* ---------- RTL (Arabic) ---------- */
html.rtl body { direction: rtl; }
html.rtl .header-top, html.rtl .nav-inner, html.rtl .filter-bar, html.rtl .meta-row,
html.rtl .card-actions, html.rtl .detail-actions, html.rtl .features, html.rtl .footer-grid,
html.rtl .form-grid, html.rtl .qr-row, html.rtl .hero-caption { direction: rtl; text-align: right; }
html.rtl .float-bar { right: auto; left: 18px; }
html.rtl .fav-btn { right: auto; left: 10px; }
html.rtl .spec-table td:first-child { text-align: right; }
html.rtl .brand { flex-direction: row; }
html.rtl .toast { direction: rtl; }
