/* =========================================================
   Riftbound Trading Co — style.css
   (single stylesheet used across all pages)
========================================================= */

/* ---------- Base / Reset ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a;
  background:#0b0f16;
}
/* ===== HEADER ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;

  background: url("/images/wood-header.jpg") center/cover no-repeat;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.site-logo{
  height: 120px;        /* <-- control logo size here */
  width: auto;
  display: block;
  border-radius: 10px;
}

.brand-name{
  font-weight: 900;
  font-size: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
  white-space: nowrap;
}

.navlinks{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.navlinks a{
  text-decoration: none;
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}

/* gem-matching colors */
.nav-sell{ color: #ff9a2a; }      /* orange */
.nav-sellcart{ color: #ffd34d; }  /* yellow */
.nav-buy{ color: #b56bff; }       /* purple */
.nav-buycart{ color: #ff3b3b; }   /* red */
.nav-ship{ color: #3da5ff; }      /* blue */
.nav-contact{ color: #43d66a; }   /* green */

.navlinks a:hover{
  background: rgba(0,0,0,.55);
}

@media (max-width: 820px){
  .topbar{ align-items: flex-start; }
  .brand-name{ display:none; }
  .site-logo{ height: 52px; }
}

/* links */
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

/* ---------- Wood shelves background ---------- */
body{
  /* Put your shelves image here (the big background) */
  background-image: url("/images/wooden-shelves.jpg");
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Optional: darken slightly so content pops */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.15);
  pointer-events:none;
  z-index:-1;
}

/* ---------- Page wrapper ---------- */
.page{
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.page-title{
  margin: 6px 0 6px;
  font-size: 52px;
  line-height: 1.05;
  color: #f59e0b; /* orange headline */
  font-weight: 900;
  letter-spacing: .5px;
}

.page-subtitle{
  margin: 0 0 18px;
  color: rgba(15, 23, 42, .65);
  font-weight: 600;
}

/* make subtitle readable on wood */
.page, .page *{
  text-shadow: none;
}

/* ---------- Header / Nav (wood wall + gem colors) ---------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  display:flex;
  align-items:center;
  gap:16px;

  /* wood wall background */
  background-image: url("/images/wood-wall.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* subtle dark overlay so text readable */
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.topbar::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.25);
  pointer-events:none;
}
.topbar > *{ position:relative; } /* above overlay */

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 240px;
}

.brand-logo,
.site-logo{
  /* ✅ controls logo size everywhere */
  height: 120px;              /* adjust to taste */
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display:block;
  border-radius: 8px;
}

.brand-name{
  font-weight: 900;
  color: #ffffff;
  letter-spacing: .3px;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
  white-space: nowrap;
}

.navlinks{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.navlinks a{
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.navlinks a.active{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
}

/* gem colors per link order:
   Sell Cards (orange), Sell Cart (yellow), Buy Cards (purple),
   Buy Cart (red), Shipping (blue), Contact (green)
*/
.navlinks a:nth-child(1){ color:#f59e0b; }  /* orange */
.navlinks a:nth-child(2){ color:#fbbf24; }  /* yellow */
.navlinks a:nth-child(3){ color:#a855f7; }  /* purple */
.navlinks a:nth-child(4){ color:#ef4444; }  /* red */
.navlinks a:nth-child(5){ color:#3b82f6; }  /* blue */
.navlinks a:nth-child(6){ color:#22c55e; }  /* green */

/* ---------- Badges (gem images) ---------- */
.hidden { display: none !important; }

.cart-badge.cart-badge--gem{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 26px;
  height: 26px;
  margin-left: 8px;
  vertical-align: middle;
}

.cart-badge.cart-badge--gem img{
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 999px;
}

.cart-badge.cart-badge--gem .cart-badge__count{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}


/* If you still want numbers visible on top of gem, remove color: transparent above
   and uncomment this:
*/
/*
.cart-badge[data-cart="buy"], .cart-badge[data-cart="sell"]{
  color:#fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  font-size: 12px;
}
*/

/* ---------- Shared: cards / panels ---------- */
.cart-list{
  list-style:none;
  padding:0;
  margin: 18px 0 0;
}

.cart-item{
  list-style:none;
  margin: 0 0 18px;
}

.cart-card{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
  padding: 18px;
}

/* Sell/Buy cart row layout (image | main | right) */
.cart-card{
  display:grid;
  grid-template-columns: 96px 1fr 220px;
  gap: 18px;
  align-items:center;
}

.cart-thumb{
  width: 84px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
  cursor: zoom-in;
}

.cart-title{
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 900;
}

.cart-main{ min-width:0; }

.cart-meta{
  font-weight: 700;
  color: rgba(15,23,42,.85);
  line-height: 1.55;
}
.cart-subline{
  margin-top: 6px;
  color: rgba(15,23,42,.75);
}

/* right column */
.cart-right{
  justify-self: end;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap: 10px;
}

.line-price{
  font-weight: 900;
  font-size: 22px;
  color:#0f172a;
}

/* ---------- Condition tabs (blue active) ---------- */
.cond-tabs{
  display:flex;
  gap:8px;
  background:#eef2f7;
  border-radius: 14px;
  padding: 6px;
  margin: 0 0 10px;
  width: fit-content;
}

.cond-tab{
  border:0;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor:pointer;
  background: transparent;
  color:#111827;
}

.cond-tab.active{
  background:#2563eb; /* blue */
  color:#fff;
}

.cond-tab.disabled{
  opacity:.45;
  cursor:not-allowed;
}

/* ---------- Quantity controls (cart pages) ---------- */
.qty-controls{
  display:flex;
  align-items:center;
  gap: 10px;
}

.qty-minus, .qty-plus,
.cart-minus, .cart-plus{
  width: 42px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  background:#111;
  color:#fff;
}

.qty-minus:disabled, .qty-plus:disabled,
.cart-minus:disabled, .cart-plus:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.qty-value, .cart-qty{
  min-width: 24px;
  text-align:center;
  font-weight: 900;
  font-size: 16px;
}

.remove-cond-btn, .cart-remove{
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(255,255,255,.65);
  color:#ef4444;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
}
.remove-cond-btn:hover, .cart-remove:hover{
  background: rgba(239,68,68,.08);
}

/* ---------- Cart summary blocks ---------- */
.cart-summary{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
  padding: 18px;
}

.cart-total{
  display:flex;
  gap:10px;
  align-items:baseline;
  font-size: 18px;
  font-weight: 900;
  color:#0f172a;
}
.cart-total strong{ font-size: 22px; }

.cart-checkout{
  margin-top: 12px;
}
.cart-checkout label{
  display:block;
  font-weight: 900;
  margin-bottom: 8px;
}
.cart-checkout-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
}

.cart-checkout-row input{
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0 14px;
  font-size: 16px;
  min-width: 260px;
  background: rgba(255,255,255,.95);
}

.cart-checkout-row button{
  height: 42px;
  border-radius: 12px;
  border: 0;
  padding: 0 16px;
  font-weight: 900;
  cursor:pointer;
  background:#2563eb;
  color:#fff;
}

.cart-message{
  margin-top: 10px;
  font-weight: 800;
}

.cart-actions{
  margin-top: 14px;
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap:wrap;
}

.danger-outline{
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(255,255,255,.65);
  color:#ef4444;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
}
.danger-outline:hover{ background: rgba(239,68,68,.08); }

.link-back{
  font-weight: 900;
  color:#2563eb;
}

/* ---------- BUY PAGE LAYOUT (grid + mini cart) ---------- */
.buy-layout{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items:start;
}

.buy-main{ min-width:0; }

.mini-cart{
  width: 100%;
  position: sticky;
  top: 90px;
  background: rgba(255,255,255,.95);
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  padding: 16px;
}

.mini-cart h3{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
}

.mini-cart-summary{
  display:flex;
  flex-direction:column;
  gap: 6px;
  font-weight: 800;
}

.mini-cart-links{
  margin: 10px 0 12px;
  font-weight: 900;
  color:#2563eb;
}
.mini-cart-links a{ color:#2563eb; }

.mini-cart-items{
  list-style:none;
  padding: 0;
  margin: 10px 0 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.mini-line{
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.mini-line-name{ font-weight: 900; }
.mini-line-sub{ color: rgba(15,23,42,.75); font-weight: 800; margin-top: 4px; }
.mini-empty{ padding: 12px 0; color: rgba(15,23,42,.65); font-weight: 800; }

.mini-cart-checkout{
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 900;
  cursor:pointer;
  background:#15803d;
  color:#fff;
}

/* Search bar */
.buy-controls{ margin: 10px 0 18px; }
.buy-search{
  display:flex;
  gap: 10px;
  align-items:center;
  max-width: 560px;
}
#buySearch{
  flex: 1 1 auto;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  background: rgba(255,255,255,.92);
}
#buySearch:focus{
  border-color: rgba(37,99,235,.8);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
#buySearchClear{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

/* Buy grid (4 across when it fits) */
.buy-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* scale down columns sooner so it NEVER goes under mini cart */
@media (max-width: 1500px){
  .buy-grid{ grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 1150px){
  .buy-layout{ grid-template-columns: 1fr; }
  .mini-cart{ position: static; top:auto; }
  .buy-grid{ grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 650px){
  .buy-grid{ grid-template-columns: 1fr; }
}

/* Buy card panel */
.buy-card{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  padding: 18px;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.buy-card-inner{ width:100%; }

.buy-card-img{
  width: 210px;
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display:block;
  margin: 6px auto 10px;
  border-radius: 14px;
  cursor: zoom-in;
}

.buy-card-title{
  width:100%;
  text-align:center;
  font-weight: 900;
  font-size: 22px;
  margin: 6px 0 12px;
  color:#0f172a;
}

.buy-card-meta{
  width:100%;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 10px;
  font-weight: 800;
}

.buy-qty-row{
  width: 100%;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin: 10px 0 12px;
}

.buy-qty-row .qty-input{
  width: 56px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  text-align:center;
  font-weight: 900;
}

.buy-add-btn{
  width:100%;
  border:0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 900;
  cursor:pointer;
  background:#2563eb;
  color:#fff;
}

/* ---------- Image Modal (zoom) ---------- */
.image-modal.hidden { display: none; }

.image-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.image-modal img{
  max-width: min(900px, 95vw);
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0,0,0,.45);
  background: #fff;
}

.image-modal-close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

/* ---------- Mobile header tweaks ---------- */
@media (max-width: 900px){
  .brand-name{ display:none; }
  .brand-logo, .site-logo{ height: 48px; }
  .navlinks{ gap: 8px; }
  .navlinks a{ padding: 7px 10px; font-size: 14px; }
}

@media (max-width: 560px){
  .page-title{ font-size: 42px; }
  .cart-card{
    grid-template-columns: 72px 1fr;
  }
  .cart-right{
    grid-column: 1 / -1;
    justify-self: start;
    align-items:flex-start;
    margin-top: 10px;
  }
}
/* 1) Force the buy layout columns to be real columns (no overlap) */
.buy-layout{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

/* 2) Make sure the LEFT column cannot “bleed” under the mini cart */
.buy-main{
  min-width: 0;
}

/* 3) Keep the mini cart in its own column, no overlay stacking */
.mini-cart{
  grid-column: 2;
  align-self: start;
  position: sticky;
  top: 90px;
  z-index: 1;          /* keep it above the wood bg, not above cards */
}

/* 4) Make the grid fit the available space so it never goes under the mini cart */
.buy-grid{
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(4, minmax(200px, 1fr)); /* slightly smaller */
}

/* If screen isn’t wide enough for 4 + mini cart, drop to 3 */
@media (max-width: 1520px){
  .buy-grid{ grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 1180px){
  .buy-layout{ grid-template-columns: 1fr; }
  .mini-cart{ position: static; top:auto; }
  .buy-grid{ grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 650px){
  .buy-grid{ grid-template-columns: 1fr; }
}

/* 5) Prevent super-long names from forcing weird layout */
.buy-card-title{
  width: 100%;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  margin: 6px 0 12px;

  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body{
  background: url("/images/wooden-shelves.jpg") top center / cover fixed no-repeat;
}

.cart-badge {
  background: crimson;
  color: white;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.cart-badge.hidden {
  display: none;
}

/* =========================
   CARD IMAGE SIZE FIX (BUY + SELL)
   Prevent "massive images"
========================= */

/* Buy grid card images */
.buy-card img,
.buy-card-img{
  width: 210px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 280px !important;
  object-fit: contain !important;
  display: block;
  margin: 8px auto 12px;
}

/* Sell grid card images (adjust class names if yours differ) */
.sell-card img,
.sell-card-img{
  width: 210px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 280px !important;
  object-fit: contain !important;
  display: block;
  margin: 8px auto 12px;
}

/* If you have thumbs in carts */
.cart-thumb{
  width: 92px !important;
  height: auto !important;
  max-height: 130px !important;
  object-fit: contain !important;
}
/* =========================================================
   SHARED PRODUCT GRID + CARD (USE ON BUY + SELL)
========================================================= */

.product-layout{
  display: grid;
  grid-template-columns: 1fr 340px; /* left content, right mini cart (buy only) */
  gap: 24px;
  align-items: start;
}

.product-main{ min-width: 0; }

/* Grid of cards */
.product-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 22px;
  align-items: stretch;
}

@media (max-width: 1250px){
  .product-grid{ grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 900px){
  .product-grid{ grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 560px){
  .product-grid{ grid-template-columns: 1fr; }
}

/* The “panel card” look */
.product-card{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ✅ THIS is what prevents huge images */
.product-card img{
  width: 210px;
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display: block;
  margin: 6px auto 10px;
}

.product-card .product-title{
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  margin: 6px 0 12px;
}

/* Tabs */
.product-card .cond-tabs{
  width: 100%;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  background: #eef2f7;
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 12px;
}

.product-card .cond-tab{
  border: 0;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
}

.product-card .cond-tab.active{
  background: #2563eb;
  color: #fff;
}

.product-card .cond-tab.disabled{
  opacity: .45;
  cursor: not-allowed;
}

/* Meta lines (price, stock, remaining, etc.) */
.product-card .product-meta{
  width: 100%;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Qty row */
.product-card .qty-row{
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 10px 0 12px;
}

.product-card .qty-btn{
  width: 42px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  background: #111;
  color: #fff;
}

.product-card .qty-input{
  width: 56px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  text-align: center;
  font-weight: 800;
}

/* Main action button */
.product-card .primary-btn{
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 900;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}
html, body { height: 100%; }

body {
  margin: 0;
  background-image: url("/images/wooden-shelves.jpg"); /* <-- update filename to YOUR real one */
  background-repeat: repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
/* ===== Shared cart layout (sell + buy) ===== */
.cart-page .cart-topbar{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 18px 0 18px;
}

.cart-top-left{
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
}

.cart-total-line{
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cart-total-label{ opacity: .85; }
.cart-total-value{ color: #111; }

.cart-email{
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.cart-email input{
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0 14px;
  background: rgba(255,255,255,.95);
  outline: none;
}

.cart-top-right{
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 220px;
}

.cart-primary,
.cart-secondary,
.cart-danger{
  width: 220px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.cart-primary{
  background: #1a7f37;
  color: #fff;
}

.cart-secondary{
  background: #eef2f7;
  color: #111;
  border: 1px solid rgba(0,0,0,.10);
}

.cart-danger{
  background: #fff;
  color: #d11a2a;
  border: 1px solid rgba(209,26,42,.35);
}

.cart-msg{
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  opacity: .9;
}

/* list spacing */
.cart-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

/* mobile */
@media (max-width: 900px){
  .cart-page .cart-topbar{
    flex-direction: column;
    align-items: stretch;
  }
  .cart-top-right{
    justify-items: stretch;
  }
  .cart-primary,
  .cart-secondary,
  .cart-danger{
    width: 100%;
  }
}
/* --- FIX: condition tabs never overflow the card --- */
.buy-card .cond-tabs{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;

  display: flex;
  gap: 8px;

  /* key fixes */
  flex-wrap: wrap;            /* allow wrapping instead of sticking out */
  justify-content: center;    /* keeps it centered when it wraps */
  overflow: hidden;           /* prevents any visual spill */
}

/* make each tab flexible so 4 tabs fit nicely */
.buy-card .cond-tab{
  flex: 1 1 56px;             /* grows/shrinks, minimum ~56px */
  max-width: 90px;            /* prevents giant tabs */
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;        /* keep NM/LP/MP/HP on one line */
}

/* optional: tighten a bit on small screens */
@media (max-width: 520px){
  .buy-card .cond-tab{
    flex-basis: 48px;
    padding: 6px 8px;
  }
}
/* =========================
   SELL SEARCH (match BUY SEARCH)
========================= */

.sell-controls{
  margin: 10px 0 18px;
}

.sell-search{
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 520px;
}

#sellSearch{
  flex: 1 1 auto;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  background: rgba(255,255,255,.92);
}

#sellSearch:focus{
  border-color: rgba(37,99,235,.8);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}

#sellSearchClear{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

/* === BUY CARDS GRID === */
/* === BUY CARDS GRID === */
#buyGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* Card outer wrapper */
.store-card,
.product-card {
  height: 100%;
}

/* Card container: flex column makes bottom controls align */
.product-card {
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 460px; /* 👈 uniform height */
}

/* Image uniform */
.product-card img.card-zoom-img,
.product-card img {
  width: 100%;
  object-fit: cover;      /* crop nicely */
  border-radius: 14px;
  background: #f1f1f1;
}

/* Title clamp so long names don't stretch card */
.product-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  margin: 6px 0 0;
  min-height: 52px; /* reserve space */
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* 👈 2 lines max */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tabs */
.cond-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cond-tab {
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
}

.cond-tab.disabled,
.cond-tab[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Meta text */
.product-meta {
  font-size: 14px;
  color: #111827;
  display: grid;
  gap: 4px;
}

/* Bottom section stays aligned across cards */
.qty-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-top: auto; /* 👈 pushes controls to bottom */
}

.qty-controls button {
  height: 42px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 900;
}

.qty-input {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  background: white;
}

/* Add button consistent */
.addBtn {
  height: 44px;
  border-radius: 14px;
  font-weight: 900;
  margin-top: 10px;
}

/* Disabled Add button looks clear */
.addBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


#miniCart,
.shopping-cart-box {
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

/* Ensure the summary panel stacks cleanly */
.cart-summary {
  position: relative;
  z-index: 1;
  overflow: visible;
}

/* Logged-in block should NOT overlay anything */
#loggedInAsBox {
  position: static !important;
  z-index: auto !important;
  margin: 10px 0 12px;
}

/* If your checkout row is flex, ensure it wraps */
.cart-checkout-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.cart-image {
  width: 110px;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-image img {
  width: 110px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.7);
}

.account-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.account-link {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: #2563eb; /* same blue as links */
}

.account-link:hover {
  text-decoration: underline;
}

.logout-link {
  color: #b00020; /* red */
}

.logout-link:hover {
  color: #8a0018;
}

.account-header {
  max-width: 1100px;
  margin: 0 auto;
}

.account-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-header-top h1 {
  margin: 0;
}

.account-actions {
  display: flex;
  gap: 12px;
}

.account-link {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: #2563eb;
}

.account-link:hover {
  text-decoration: underline;
}

.logout-link {
  color: #b00020;
}

.logout-link:hover {
  color: #8a0018;
}

/* --- SELL / BUY CARD SIZE (grid items) --- */
#sellGrid, #buyGrid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}

/* make each card feel like the "small" version */
.store-card .product-card{
  max-width: 260px;   /* <- controls overall box size */
  margin: 0 auto;
  padding: 14px;
  border-radius: 18px;
}

/* --- IMAGE: show WHOLE picture (no crop) --- */
.store-card .product-card img.card-zoom-img,
.store-card .product-card img.card-img,
.store-card .product-card img.sell-card-img{
  width: 100%;
  height: 170px;         /* <- the frame height */
  object-fit: contain;   /* <- THIS is the key */
  background: rgba(0,0,0,.06);
  border-radius: 14px;
  display: block;
}

/* optional: keep title from getting huge */
.store-card .product-title{
  font-size: 18px;
  line-height: 1.15;
  margin: 10px 0 8px;
}
.cond-tab{
  position: relative;
}

.cond-tab .tab-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  background: rgba(15,23,42,.12);
  color: rgba(15,23,42,.9);
}

.cond-tab.active .tab-badge{
  background: rgba(255,255,255,.25);
  color: #fff;
}

.cond-tab.disabled .tab-badge{
  opacity: .55;
}
.cond-tab{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15,23,42,.14);
  color: rgba(15,23,42,.85);
}

.cond-tab.active .tab-badge{
  background: rgba(255,255,255,.25);
  color: #fff;
}

.filters-row{
  display:flex;
  gap:10px;
  margin:10px 0 14px;
  max-width: 900px;
}
.filters-row select{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  font-weight:800;
}

.product-meta-pills{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin: 8px 0 0;
  justify-content:center;
}
.meta-pill{
  font-size:12px;
  font-weight:900;
  padding:4px 8px;
  border-radius:999px;
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.10);
}

/* optional rarity accents */
.rarity-Common{ }
.rarity-Uncommon{ }
.rarity-Rare{ }
.rarity-Epic{ }
.rarity-Showcase{ }

/* =========================
   FOIL (single source of truth)
   Put this near the END of style.css
========================= */

/* Image frame wrapper that matches your fixed image frame size */
.card-img-wrap{
  position: relative;
  width: 100%;
  height: 170px;            /* MUST match your current image frame height */
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.06);
}

/* Make the image fill the frame consistently */
.card-img-wrap img.card-zoom-img{
  width: 100%;
  height: 100%;
  object-fit: contain;      /* you want full card visible */
  display: block;
}

/* Small FOIL badge */
.card-img-wrap .foil-badge{
  position: absolute;
  top: 8px;
  left: 8px;               /* pick ONE location */
  z-index: 5;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  user-select:none;
  pointer-events:none;
}

/* Strong animated shimmer sweep */
.card-img-wrap.foil::after{
  content:"";
  position:absolute;
  inset:-40%;
  z-index: 4;
  pointer-events:none;

  background:
    linear-gradient(115deg,
      rgba(255,255,255,0) 38%,
      rgba(255,255,255,.55) 48%,
      rgba(255,255,255,0) 58%
    ),
    linear-gradient(90deg,
      rgba(255, 0, 140, 0.18),
      rgba(0, 220, 255, 0.18),
      rgba(255, 230, 0, 0.18),
      rgba(255, 0, 140, 0.18)
    );

  mix-blend-mode: screen;
  opacity: .75;
  transform: translate3d(-30%, -30%, 0) rotate(12deg);
  animation: foilSweep 2.2s linear infinite;
}

/* subtle sparkles */
.card-img-wrap.foil::before{
  content:"";
  position:absolute;
  inset:0;
  z-index: 3;
  pointer-events:none;

  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.22), transparent 40%),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,0.14), transparent 45%);
  mix-blend-mode: screen;
  opacity: .55;
  animation: foilPulse 2.6s ease-in-out infinite;
}

@keyframes foilSweep{
  0%   { transform: translate3d(-30%, -30%, 0) rotate(12deg); }
  100% { transform: translate3d(30%,  30%, 0) rotate(12deg); }
}
@keyframes foilPulse{
  0%,100% { opacity: .35; }
  50%     { opacity: .65; }
}

@media (prefers-reduced-motion: reduce){
  .card-img-wrap.foil::before,
  .card-img-wrap.foil::after
}

.navlinks { display:flex; gap:12px; align-items:center; }
.nav-spacer { flex: 1; }

.navbtn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  background: #111827;
  color: #fff;
}

.navlink.active{
  text-decoration: underline;
  text-underline-offset: 6px;
  font-weight: 900;
}

.admin-who{
  margin-top: 6px;
  font-size: 12px;
  opacity: .85;
}
