/* ========== Base / Theme ========== */
*,
*::before,
*::after { box-sizing: border-box; }

:root{
  --bg:#ffffff;
  --text:#222222;
  --muted:#555;
  --brand:#cc5200;         /* darker orange */
  --brand-strong:#b44800;  /* hover */
  --card:#ffffff;
  --border:#e5e7eb;
  --input:#ffffff;

  /* Theme button (light mode) */
  --theme-btn-bg:#000;
  --theme-btn-fg:#fff;
  --theme-btn-border:#000;
}

.dark-mode{
  --bg:#121212;
  --text:#f1f1f1;
  --muted:#c8c8ce;
  --card:#1a1a21;
  --border:#2a2a33;
  --input:#0e0e12;

  /* Theme button (dark mode) */
  --theme-btn-bg:#fff;
  --theme-btn-fg:#111;
  --theme-btn-border:#fff;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, Helvetica, sans-serif;
}

/* Prevent random image blow-ups */
img { max-width: 100%; height: auto; display: block; }

/* ========== Sticky Layout (for footer) ========== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ========== Header ========== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--brand);
  color: #fff;
}

.nav-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Uniform circular cart badge (all pages, desktop + mobile) */
.cart-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.site-header .cart-link .cart-badge,
.mobile-menu .cart-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:26px;
  height:26px;
  border-radius:50%;

  /* darker filled pill like card.html */
  background: rgba(0,0,0,.22);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);

  color:#fff !important;
  font-size:14px;        /* lock text size */
  font-weight:700;
  line-height:1;         /* prevent inheritance quirks */

  margin-left:6px;
  vertical-align:middle;
  transform: translateY(2px); /* optical centering next to “Cart” */
  border:0;                    /* border comes from inset shadow */
}

.dark-mode .site-header .cart-link .cart-badge,
.dark-mode .mobile-menu .cart-badge{
  background: rgba(0,0,0,.22);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
}

@media (max-width:640px){
  .site-header .cart-link .cart-badge,
  .mobile-menu .cart-badge{
    width:26px;
    height:26px;
    font-size:14px;
  }
}





/* Brand (header logo + wordmark) */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

/* Keep header icon small (the BIG image problem came from this not applying) */
.brand img{
  height: 24px;          /* tiny, fixed */
  max-height: 24px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}
.brand b{ font-weight: 700; font-size: 16px; }

/* Left navigation (Magic Sets, Cart, About Us) */
.nav{
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav a{
  color: #fff;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .2s ease;
}
.nav a:hover{ background: rgba(255,255,255,.16); }

/* Right cluster: Search + Sign in + Theme */
.right{
  margin-left: auto;      /* <- pushes to the far right */
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search */
.search{
  position: relative;
  width: 280px;
  max-width: 42vw;
}
.search input{
  width: 100%;
  padding: 8px 12px 8px 28px;
  border-radius: 10px;
  border: none;
  outline: none;
  background: #fff;
  color: #111;
}
.search i {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.dark-mode .search input{
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
}

/* === Results dropdown (scoped to the existing .search only) === */
.search .dd-search-panel{
  position: absolute;
  z-index: 2000;
  top: calc(100% + 6px);   /* sits just under the input */
  left: 0;
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  overflow: hidden;
  display: none;           /* toggled to block by JS */
}

.search .dd-search-results{
  max-height: 60vh;
  overflow-y: auto;
}

.search .dd-shead,
.search .dd-srow{
  display: grid;
  grid-template-columns: 1.4fr .9fr .4fr .9fr .6fr .5fr .5fr; /* Card | Set | # | Variant | Finish | Price | Stock */
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: .9rem;
}

.search .dd-shead{
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: linear-gradient(to bottom, rgba(0,0,0,.06), rgba(0,0,0,0));
  border-bottom: 1px solid var(--border);
}

.search .dd-srow{
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
}
.search .dd-srow:hover,
.search .dd-srow.is-active{
  background: rgba(0,0,0,.05);
}
.search .dd-srow .name{
  font-weight: 600;
  color: var(--text);
}

/* small helpers for tags/muted text within rows (if you use them) */
.search .dd-pill{
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: .85rem;
}
.search .dd-muted{ color: var(--muted); }

/* Responsive trimming for narrow screens */
@media (max-width: 850px){
  .search .dd-shead,
  .search .dd-srow{
    grid-template-columns: 1.4fr .9fr .6fr .9fr .5fr; /* hide a couple of cols with .dd-hide-sm */
  }
  .search .dd-hide-sm{ display: none; }
}

/* Dark mode consistency */
.dark-mode .search .dd-search-panel{
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.dark-mode .search .dd-srow:hover,
.dark-mode .search .dd-srow.is-active{
  background: rgba(255,255,255,.05);
}


/* Sign in link (text only) */
.signin-link{
  color:#fff;
  text-decoration:none;
  padding:8px 6px;
  border-radius:8px;
}
.signin-link:hover{ background: rgba(255,255,255,.16); }

/* Theme toggle (black box in light mode, darker in dark mode) */
/* Theme toggle button */
.toggle {
  width: 40px;
  height: 36px;
  margin-left: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #000;      /* black box background */
  color: #fff;
  cursor: pointer;
  border: none;
}
.toggle i {
  font-size: 16px;
  line-height: 1;
}
/* Header icon sizes (font icons) */
.site-header .nav-wrap i,
.site-header .nav-wrap svg{
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-block;
  flex-shrink: 0;
}

/* Mobile */
.menu-toggle{ display: none; }

/* Mobile dropdown */
.mobile-menu{
  display: none;
  flex-direction: column;
  gap: 8px;
  background: var(--brand);
  padding: 10px 16px;
}
.mobile-menu a,
.mobile-menu input{ color: #fff; }
.mobile-menu.show{ display: flex; }

/* Keep page background consistent (fix white strip under long content) */
main { background: var(--bg); }

/* Optional: make table footer/pager visually continuous with the table */
.pager {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  padding: 12px;
  border-radius: 0 0 12px 12px;
}

/* Ensure pager controls theme correctly in light & dark */
.pager .info { color: var(--muted); }
.pager .btn {
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--line);
}
.pager select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.pager select option { background: var(--card); color: var(--text); }


/* ========== Footer ========== */
/* Footer links: force white text + bigger spacing */
.site-footer .footer-links a {
  color: #fff !important;
  text-decoration: none;
  margin: 0 24px; /* increase horizontal spacing */
  display: inline-block;
}
.site-footer .footer-links a:hover {
  text-decoration: underline;
}
.site-footer {
  border-top: 1px solid transparent;
  background: var(--brand);
  color: #fff;
}
.footer-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== Main content helpers ========== */
.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}
h1, h2, h3{ color: var(--brand); margin: .2rem 0 1rem; }

/* Small hero badge (prevents giant image) */
.home-hero .brand-badge{
  width: 140px;
  max-width: 40vw;
  height: auto;
  display: block;
  margin: 20px auto 8px;
}

/* ========== Responsive ========== */
@media (max-width: 900px){
  .nav{ display: none; }
  .right .search{ display: none; }
  .menu-toggle{ display: inline-block; color:#fff; background:transparent; border:0; font-size:22px; }
}
.shake { animation: ddshake 0.35s; }
@keyframes ddshake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* Search dropdown highlight */
.dd-srow .name{
  color: var(--accent);   /* you already use --accent (#b84e00) */
  cursor: pointer;
}
.dd-srow:hover .name{
  text-decoration: underline;
}
.dd-srow .name{ color:#b84e00; cursor:pointer; }
.dd-srow:hover .name{ text-decoration:underline; }

/* =========================================================
   Global Link Color — Orange (except header/footer)
   ========================================================= */

/* Default readable orange */
:root {
  --link: #cc5200;
  --link-hover: #b44800;
}

/* All regular in-body links (applies to main, cards, etc.) */
body a {
  color: var(--link);
  text-decoration: none;
  transition: color .2s ease;
}

body a:hover,
body a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Keep header & footer links white */
.site-header a,
.site-header a:hover,
.site-header a:focus,
.site-footer a,
.site-footer a:hover,
.site-footer a:focus {
  color: #fff !important;
  text-decoration: none;
}

/* Dark mode still uses same orange for readability */
body.dark-mode a {
  color: var(--link);
}

body.dark-mode a:hover,
body.dark-mode a:focus {
  color: var(--link-hover);
}

