/* ============================================================================
   FGICA REDESIGN 2026 - visual overhaul layer (proof of concept)
   Loaded AFTER style.css so it overrides the original look without touching
   any of the original rules or page structure.
   Design language: deep ink navy + luminous gold, Plus Jakarta Sans,
   layered soft shadows, glass surfaces, micro-motion.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  --navy:     #14304f;
  --navy-dk:  #0b1e35;
  --ink:      #0b1e35;
  --gold:     #c8973a;
  --gold-lt:  #e8b85a;
  --gold-grad: linear-gradient(135deg, #b98527 0%, #e8b85a 100%);
  --navy-grad: linear-gradient(135deg, #0b1e35 0%, #17395e 55%, #1e4a78 100%);
  --bg:       #eef1f6;
  --card:     #ffffff;
  --border:   #dfe4ec;
  --txt:      #1c2431;
  --txt-lt:   #647082;
  --radius:   14px;
  --shadow:   0 1px 2px rgba(11,30,53,.05), 0 4px 14px rgba(11,30,53,.07);
  --shadow-h: 0 4px 10px rgba(11,30,53,.10), 0 18px 40px rgba(11,30,53,.16);
  --ring:     0 0 0 3px rgba(200,151,58,.35);
}

/* Staging stays visually unmistakable: re-tint the new gradient tokens to the
   established hot pink when /env.js sets html.is-staging. */
html.is-staging {
  --navy:      #d63384;
  --navy-dk:   #a01e63;
  --navy-grad: linear-gradient(135deg, #6e1042 0%, #a01e63 55%, #d63384 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -220px, rgba(200,151,58,.10), transparent 60%),
    radial-gradient(900px 480px at -180px 15%, rgba(20,58,92,.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: .005em;
}

::selection { background: rgba(200,151,58,.35); }

/* Buttons and form controls do not inherit the body font by default */
button, input, select, textarea { font-family: inherit; }

/* Elegant thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: #b6bfcd transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #b6bfcd; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a0b3; background-clip: content-box; }

/* Visible focus for keyboard users, everywhere */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---- Header: deep gradient + gold hairline + glass ------------------------ */
.site-header {
  background: var(--navy-grad);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 6px 24px rgba(11,30,53,.35);
  border-bottom: 1px solid rgba(200,151,58,.55);
}
.header-inner { height: 66px; gap: 18px; }

.brand-text .name { font-weight: 800; letter-spacing: .01em; }
.brand-text .sub {
  color: var(--gold-lt);
  opacity: 1;
  font-weight: 600;
  letter-spacing: .14em;
  font-size: .66rem;
}
.brand-divider { background: linear-gradient(180deg, transparent, rgba(232,184,90,.55), transparent); height: 38px; }
.header-brand .header-logo {
  height: 48px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
  transition: transform .25s;
}
.header-brand .header-logo:hover { transform: scale(1.06) rotate(-2deg); }

.header-search input {
  padding: 10px 18px 10px 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.header-search input:focus {
  background: rgba(255,255,255,.2);
  border-color: rgba(232,184,90,.8);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 0 0 3px rgba(200,151,58,.25);
}

.header-nav-link { font-weight: 600; }
.cart-btn { transition: transform .15s; }
.cart-btn:hover { transform: translateY(-1px); }
.cart-badge { box-shadow: 0 0 0 2px rgba(11,30,53,.9); }
.user-badge .avatar {
  background: var(--gold-grad);
  color: #142238;
  box-shadow: 0 0 0 2px rgba(232,184,90,.35), 0 2px 6px rgba(0,0,0,.3);
}

/* ---- Toolbar: frosted sticky bar ------------------------------------------ */
.toolbar {
  top: 66px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(223,228,236,.9);
  box-shadow: 0 4px 18px rgba(11,30,53,.05);
  padding: 10px 24px;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 700;
  letter-spacing: .01em;
  transition: all .18s;
}
.filter-chip:hover { border-color: var(--navy); color: var(--navy); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(11,30,53,.10); }
.filter-chip.active {
  background: var(--navy-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(11,30,53,.35);
}

.result-count { font-weight: 600; }

.btn-print { border-radius: 999px; }

/* ---- Category sidebar ------------------------------------------------------ */
.category-sidebar {
  top: 118px;
  max-height: calc(100vh - 118px);
  width: 210px;
  padding: 16px 10px 20px;
  background: transparent;
  border-right: none;
}
.cat-btn {
  padding: 8px 12px;
  border-radius: 9px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .16s, color .16s, border-color .16s, padding-left .16s;
}
.cat-btn:hover { background: rgba(20,48,79,.07); padding-left: 15px; border-left-color: rgba(200,151,58,.5); }
.cat-btn.active {
  background: var(--navy-grad);
  border-left-color: var(--gold);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11,30,53,.28);
}
.cat-btn-new { border-radius: 9px; }
.cat-btn-new.active { background: var(--navy-grad); }

/* ---- Product grid + cards -------------------------------------------------- */
.catalog-body { padding: 26px 24px 70px; }
.product-grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.product-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: cardIn .4s ease both;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
/* Stagger the first rows on load */
.product-card:nth-child(2)  { animation-delay: .03s; }
.product-card:nth-child(3)  { animation-delay: .06s; }
.product-card:nth-child(4)  { animation-delay: .09s; }
.product-card:nth-child(5)  { animation-delay: .12s; }
.product-card:nth-child(6)  { animation-delay: .15s; }
.product-card:nth-child(7)  { animation-delay: .18s; }
.product-card:nth-child(8)  { animation-delay: .21s; }
.product-card:nth-child(9)  { animation-delay: .24s; }
.product-card:nth-child(10) { animation-delay: .27s; }

.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(200,151,58,.55);
  box-shadow: var(--shadow-h);
}
/* Gold hairline that lights up across the card top on hover */
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-grad);
  opacity: 0;
  transition: opacity .25s, left .25s, right .25s;
  z-index: 2;
}
.product-card:hover::before { opacity: 1; left: 4%; right: 4%; }

.card-img-wrap {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f4f8 100%);
}
.card-img-wrap img { padding: 10px; }
.product-card:hover .card-img-wrap img { transform: scale(1.07); }

.card-code { letter-spacing: .04em; font-weight: 700; }
.card-price, .price-big { font-weight: 800; }

/* Stock badges as soft pills */
.stock-badge { border-radius: 999px; font-weight: 700; letter-spacing: .02em; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn { border-radius: 10px; font-weight: 700; letter-spacing: .01em; }
.btn-primary {
  background: var(--navy-grad);
  box-shadow: 0 2px 8px rgba(11,30,53,.28);
}
.btn-primary:hover { background: var(--navy-grad); filter: brightness(1.18); box-shadow: 0 6px 18px rgba(11,30,53,.35); transform: translateY(-1px); }
.btn-gold {
  background: var(--gold-grad);
  color: #142238;
  box-shadow: 0 2px 8px rgba(200,151,58,.4);
}
.btn-gold:hover { background: var(--gold-grad); filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) !important; }

/* ---- Pagination / load-more -------------------------------------------------- */
.page-btn { border-radius: 10px; font-weight: 600; transition: all .15s; }
.page-btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.page-btn.active { background: var(--navy-grad); box-shadow: 0 3px 10px rgba(11,30,53,.3); }
.load-more-btn { border-radius: 999px; font-weight: 700; }

/* ---- Modals & drawers --------------------------------------------------------- */
.modal-overlay, .cart-overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { border-radius: 18px; box-shadow: 0 30px 80px rgba(11,30,53,.4); border: 1px solid rgba(255,255,255,.6); }
.cart-drawer { box-shadow: -18px 0 60px rgba(11,30,53,.3); }
.user-menu { border-radius: 14px; box-shadow: 0 14px 44px rgba(11,30,53,.22); padding: 8px; }
.user-menu-item { border-radius: 9px; font-weight: 500; }
.user-menu-item:hover { background: rgba(200,151,58,.12); }

/* ---- Auth pages (login / register): the showpiece ----------------------------- */
@keyframes authDrift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.auth-body {
  background:
    radial-gradient(900px 460px at 80% 8%, rgba(232,184,90,.16), transparent 55%),
    radial-gradient(720px 420px at 10% 92%, rgba(46,104,160,.28), transparent 60%),
    linear-gradient(135deg, #081527 0%, #10294a 45%, #1a3f68 80%, #14304f 100%);
  background-size: 160% 160%;
  animation: authDrift 24s ease-in-out infinite;
}
.auth-card {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 22px;
  box-shadow: 0 40px 90px rgba(3,10,20,.55), 0 0 0 1px rgba(232,184,90,.18);
  padding: 46px 42px;
  animation: cardIn .5s ease both;
}
.auth-logo .auth-logo-img { width: 130px; filter: drop-shadow(0 6px 16px rgba(11,30,53,.25)); }
.auth-logo .company { font-weight: 800; letter-spacing: .02em; }
.auth-logo .gold-bar { width: 72px; height: 3px; background: var(--gold-grad); }
.auth-card h2 { font-weight: 800; }
.form-group input {
  padding: 12px 15px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.form-group input:focus { border-color: var(--gold); box-shadow: var(--ring); background: #fff; }

/* ---- Tables (admin / orders) --------------------------------------------------- */
.admin-table-wrap, .orders-wrap { border-radius: var(--radius); }
.status-badge, .ord-status { border-radius: 999px; font-weight: 700; letter-spacing: .02em; }

/* ---- Dark mode refinements ------------------------------------------------------ */
html.dark {
  --bg:     #0e1218;
  --card:   #161c26;
  --border: #262e3c;
  --txt:    #e8eaef;
  --txt-lt: #97a1b2;
  --shadow:   0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.35);
  --shadow-h: 0 6px 16px rgba(0,0,0,.4), 0 20px 44px rgba(0,0,0,.5);
}
html.dark body {
  background:
    radial-gradient(1100px 500px at 85% -220px, rgba(200,151,58,.07), transparent 60%),
    radial-gradient(900px 480px at -180px 15%, rgba(30,74,120,.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
html.dark .toolbar {
  background: rgba(18,23,32,.85);
  border-bottom-color: rgba(38,46,60,.9);
}
html.dark .filter-chip { background: var(--card); }
html.dark .filter-chip.active { background: var(--navy-grad); color: #fff; }
html.dark .cat-btn:hover { background: rgba(232,184,90,.08); }
html.dark .product-card { border-color: #333c4b; }
html.dark .user-menu-item:hover { background: rgba(232,184,90,.1); }
html.dark .auth-card { background: rgba(22,28,38,.92); border-color: rgba(255,255,255,.08); color: var(--txt); }
html.dark * { scrollbar-color: #3a4454 transparent; }
html.dark *::-webkit-scrollbar-thumb { background: #3a4454; background-clip: content-box; }

/* ---- Reduced motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .product-card, .auth-card { animation: none; }
  .auth-body { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---- Mobile tune-ups ---------------------------------------------------------------- */
@media (max-width: 768px) {
  .toolbar { top: 62px; padding: 8px 14px; }
  .catalog-body { padding: 16px 12px 60px; }
  .product-grid { gap: 12px; }
}
