/*
 * Print Way — admin/auth stylesheet.
 * Visual system aligned to the approved reference (print-way-store-demo):
 * same navy/copper palette, IBM Plex Sans Arabic + Righteous, spacing rhythm,
 * radii, shadows and component treatments. Storefront features are NOT included.
 */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #5c6b78;
  --border: #dce3ea;
  --primary: #1e3a5c;
  --primary-dark: #142943;
  --primary-soft: #e7edf4;
  --accent: #c96f47;
  --accent-dark: #a85832;
  --accent-soft: #f7e9e0;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(20, 41, 67, .1);
  --shadow-lg: 0 24px 60px rgba(20, 41, 67, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
.brand-font { font-family: "Righteous", sans-serif; letter-spacing: .3px; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

/* small accent label above headings (reference "kicker") */
.kicker { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent); letter-spacing: .4px; margin-bottom: 6px; }

/* ---- header / nav ---- */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 20px; padding: 14px 0; min-height: 74px; }
.logo { display: flex; align-items: center; flex: none; }
/* Official logo — height set, width auto so aspect ratio is never distorted. */
.logo img.brand-logo { height: 54px; width: auto; display: block; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; align-items: center; margin-inline-start: 26px; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--text); padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); border-color: var(--accent); }
.nav-user { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.nav-user .who { font-size: 13px; color: var(--muted); }
.nav-user .who strong { color: var(--primary-dark); font-weight: 600; }

/* ---- buttons (reference values) ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-size: 14.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; line-height: 1; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--primary-dark); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: #b0413a; color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- page shell / cards ---- */
main.page { padding: 34px 0 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; color: var(--primary-dark); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.muted { color: var(--muted); font-size: 13.5px; }

/* ---- forms ---- */
.form-box { max-width: 480px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--primary-dark); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; font-family: inherit; font-size: 14px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- tables ---- */
table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data-table th, table.data-table td { padding: 13px 15px; border-bottom: 1px solid var(--border); text-align: right; font-size: 13.5px; }
table.data-table th { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background .12s; }
table.data-table tbody tr:hover { background: #fafbfc; }

/* ---- sortable column headers (shared admin.partials.sort-th) ---- */
table.data-table th a.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; white-space: nowrap; }
table.data-table th a.th-sort:hover { text-decoration: underline; }
table.data-table th a.th-sort.active { color: var(--primary, #142943); font-weight: 700; }
table.data-table th a.th-sort .th-sort-ind { font-size: 10px; opacity: .85; }

/* ---- status badges (reference original/compatible tag colors) ---- */
.status-pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.on { background: #e7f3ec; color: #23643d; }
.status-pill.off { background: #fdf1ea; color: #8a4a26; }

/* ---- alerts ---- */
.msg { padding: 13px 15px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; }
.msg.ok { background: #e7f3ec; color: #23643d; border: 1px solid #bfe3cd; }
.msg.err { background: #fbf3f1; border: 1px solid #edd8d2; color: #8a3d2b; }
.msg ul { margin: 0; padding-inline-start: 18px; }

/* ---- dashboard ---- */
.dash { max-width: 680px; }
.dash-hi { display: flex; align-items: center; gap: 15px; }
.dash-avatar { width: 56px; height: 56px; border-radius: 15px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 700; flex: none; }
.dash-name { font-size: 18px; font-weight: 600; color: var(--primary-dark); }
.dash-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.meta-item { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.meta-item .l { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.meta-item .v { font-size: 14px; color: var(--primary-dark); font-weight: 600; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 20px; }

/* ---- auth pages (reference hero treatment: gradient + copper dot texture) ---- */
.auth-screen { position: relative; overflow: hidden; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 78%); }
.auth-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--accent) 1.6px, transparent 1.6px);
  background-size: 22px 22px; opacity: .16;
  -webkit-mask-image: radial-gradient(circle at 80% 30%, #000 0%, transparent 62%);
          mask-image: radial-gradient(circle at 80% 30%, #000 0%, transparent 62%);
}
.auth-card { position: relative; z-index: 1; width: min(430px, 100%); background: var(--card); border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow-lg); }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { height: 86px; width: auto; margin: 0 auto 12px; }
.auth-brand .ar { font-size: 12.5px; color: var(--muted); }
.auth-card h1 { font-size: 20px; margin: 6px 0 20px; text-align: center; color: var(--primary-dark); }
.hp { display: none; } /* honeypot: display:none so browser autofill never fills it */

/* ---- accessibility ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ============================================================
   Storefront components — same tokens/design system as admin
   (ported from the approved print-way-store-demo visual language)
   ============================================================ */
.store-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
/* ---------- storefront footer (professional, multi-column) ---------- */
.store-footer { position: relative; overflow: hidden; background: var(--primary-dark); color: #b9c6d4; padding: 52px 0 22px; margin-top: 48px; }
.store-footer .footer-dots { position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--accent) 1.5px, transparent 1.5px); background-size: 22px 22px; opacity: .10;
  -webkit-mask-image: radial-gradient(circle at 88% 14%, #000 0%, transparent 60%); mask-image: radial-gradient(circle at 88% 14%, #000 0%, transparent 60%); }
.store-footer .wrap { position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 34px; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,.10); }
.footer-brand .footer-logo-chip { display: inline-flex; background: #fff; padding: 9px 13px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.footer-brand .footer-logo-chip img { height: 42px; width: auto; display: block; }
.footer-about { margin: 14px 0 0; font-size: 13px; line-height: 1.9; color: #a9bacb; max-width: 320px; }
.footer-col h5 { color: #fff; font-size: 13.5px; font-weight: 700; margin: 0 0 14px; position: relative; padding-bottom: 8px; }
.footer-col h5::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links li { font-size: 13px; color: #a9bacb; line-height: 1.7; }
.footer-links a { color: #a9bacb; text-decoration: none; transition: color .15s ease; }
.footer-links a:hover { color: #fff; }
.store-footer .foot-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid rgba(255,255,255,.10); margin-top: 22px; padding-top: 16px; font-size: 12px; color: #8798a9; }
.store-footer .foot-bottom .brand-font { color: #fff; }
.store-footer .foot-bottom .foot-tag { color: var(--accent); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .store-footer .foot-bottom { justify-content: center; text-align: center; }
}
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

.hero { position: relative; overflow: hidden; background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 78%); color: #fff; }
.hero-dots { position: absolute; inset: 0; background-image: radial-gradient(var(--accent) 1.6px, transparent 1.6px); background-size: 22px 22px; opacity: .16; -webkit-mask-image: radial-gradient(circle at 78% 40%, #000 0%, transparent 62%); mask-image: radial-gradient(circle at 78% 40%, #000 0%, transparent 62%); }
.hero-inner { position: relative; padding: 56px 0 48px; text-align: center; }
.hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 14px; }
.hero h1 span { color: var(--accent); }
.hero p.lede { color: #d7e0ea; max-width: 52ch; margin: 0 auto 22px; font-size: 15.5px; }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 30px; }
.section-head h2 { font-size: 26px; margin: 6px 0 10px; color: var(--primary-dark); }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.cat-card h5 { margin: 0; font-size: 13.5px; color: var(--primary-dark); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-media { height: 120px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; position: relative; color: var(--primary); }
.product-tag { position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.product-tag.original { background: #e7f3ec; color: #23643d; }
.product-tag.compatible { background: #fdf1ea; color: #8a4a26; }
.product-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 11px; color: var(--muted); }
.product-body h4 { margin: 0; font-size: 14px; line-height: 1.4; }
.product-body h4 a { color: var(--text); }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.price small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.stock-note { font-size: 11.5px; }
.stock-note.ok { color: #23643d; }
.stock-note.out { color: #b0413a; }

.pd-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.pd-media { height: 300px; background: var(--primary-soft); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pd-media img { width: 100%; height: 100%; object-fit: contain; }
.pd-title { font-size: 24px; margin: 6px 0 8px; color: var(--primary-dark); }
.compat-list { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
@media (max-width: 760px) {
  table.data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .nav { flex-wrap: wrap; gap: 12px; min-height: 0; }
  .nav-links { margin: 0; order: 3; width: 100%; overflow-x: auto; }
  .nav-user { margin-inline-start: auto; }
  .logo img.brand-logo { height: 46px; }
  .page-head h1 { font-size: 22px; }
  .dash-meta { grid-template-columns: 1fr; }
}
