/* Arcana Magic — Coursework Redesign (RED Dark Mode / NAVY Light Mode)
   Focus: readable typography, consistent spacing, responsive layout, accessible contrast.
*/

:root{
  /* Palette from your image */
  --navy-1: #000020;
  --navy-2: #191936;
  --slate:  #32324C;
  --red-1:  #E03121;
  --red-2:  #B12418;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* Dark mode (default) = RED-DOMINANT but not painful */
  --bg: #2a0a0a;                 /* deep warm red-black */
  --bg-2: #160505;               /* deeper base */
  --panel: rgba(255,255,255,.06);
  --panel-2: rgba(255,255,255,.10);

  --text: #F6F7FB;
  --muted: rgba(246,247,251,.72);

  --brand: var(--red-1);
  --accent: var(--red-2);
  --brand-2: #FFB000;            /* warm highlight */

  --danger: var(--red-1);
  --ok: #2ECB70;

  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --shadow-2: 0 10px 30px rgba(0,0,0,.28);

  --radius: 18px;
  --radius-sm: 12px;

  --max: 1160px;
  --border: rgba(246,247,251,.14);

  --focus: 0 0 0 4px color-mix(in srgb, var(--brand) 28%, transparent);
}

/* Light mode = NAVY DOMINANT (clean + bright) */
:root[data-theme="light"]{
  --bg: #f6f7ff;
  --bg-2: #eef0ff;
  --panel: rgba(25,25,54,.05);
  --panel-2: rgba(25,25,54,.08);

  --text: #0b0d18;
  --muted: rgba(11,13,24,.68);

  --brand: var(--navy-2);        /* navy primary in light */
  --accent: var(--navy-1);
  --border: rgba(25,25,54,.14);

  --shadow: 0 18px 50px rgba(25,25,54,.12);
  --shadow-2: 0 10px 26px rgba(25,25,54,.10);

  --focus: 0 0 0 4px rgba(25,25,54,.18);
}

*{box-sizing:border-box}

html, body{
  height:100%;
  color: var(--text);
}

body{
  margin:0;
  font-family:var(--font);
  line-height:1.5;

  /* Dark mode background (RED dominant, soft glows, no harsh stripes) */
  background:
    radial-gradient(1100px 560px at 12% 12%, rgba(224,49,33,.26), transparent 60%),
    radial-gradient(900px 520px at 86% 18%, rgba(177,36,24,.20), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, rgba(25,25,54,.28), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

/* Light mode background (NAVY dominant but bright) */
:root[data-theme="light"] body{
  background:
    radial-gradient(1200px 640px at 18% 10%, rgba(25,25,54,.12), transparent 60%),
    radial-gradient(900px 560px at 88% 18%, rgba(0,0,32,.08), transparent 60%),
    radial-gradient(900px 700px at 40% 120%, rgba(224,49,33,.08), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

img{max-width:100%; display:block}
a{color:inherit}
p{margin:0 0 1rem}
h1,h2,h3,h4{line-height:1.15; margin:0 0 .75rem}
h1{font-size:clamp(2rem, 3vw, 3.1rem); letter-spacing:-.02em}
h2{font-size:clamp(1.4rem, 2.2vw, 2rem)}
.h2{font-size:clamp(1.6rem, 2.5vw, 2.3rem)}
.h3{font-size:1.25rem}
.h4{font-size:1.05rem}
.h5{font-size:.95rem; margin:0 0 .5rem}

.container{width:min(var(--max), calc(100% - 2rem)); margin:0 auto}
.section{padding:3rem 0}
.section--alt{background: linear-gradient(180deg, transparent, rgba(255,255,255,.03), transparent)}
:root[data-theme="light"] .section--alt{background: linear-gradient(180deg, transparent, rgba(25,25,54,.04), transparent)}
.section--tight{padding:2rem 0}

.muted{color:var(--muted)}
.tiny{font-size:.85rem}
.lead{font-size:1.05rem}

.skip-link{
  position:absolute; left:-999px; top:1rem;
  background:var(--panel); border:1px solid var(--border);
  padding:.6rem .9rem; border-radius:999px;
}
.skip-link:focus{left:1rem; box-shadow:var(--shadow); outline:none}

.sr-only{
  position:absolute!important; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

.site-header{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(140%) blur(10px);
  background:rgba(12,7,10,.78);
  border-bottom:1px solid var(--border);
}
:root[data-theme="light"] .site-header{
  background:rgba(246,247,255,.80);
}

.topbar{border-bottom:1px solid var(--border)}
.topbar__inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; padding:.6rem 0;
}
.topbar__msg{margin:0; font-size:.95rem}
.topbar__actions{display:flex; gap:.5rem; align-items:center}

.nav__inner{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap:1rem;
  align-items:center;
  padding:.9rem 0;
}

.brand{display:flex; gap:.55rem; align-items:center; text-decoration:none}
/* LOGO MARK AS A PLAYING CARD */
/* inner outline like a real card */
.brand__mark::before{
  content:"";
  position:absolute;
  inset:6px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  opacity:.85;
}

/* tiny corner pips (optional but looks “card-ish”) */
.brand__mark::after{
  content:"♦";
  position:absolute;
  top:6px;
  left:8px;
  font-size:12px;
  color: rgba(255,255,255,.90);
  text-shadow: 0 1px 0 rgba(0,0,0,.20);
  opacity:.95;
}

/* center “sparkle” (your icon) */
.brand__pip{
  width:18px;
  height:18px;
  background: rgba(255,255,255,.92);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.28));
}

/* LIGHT MODE: make card navy (as you requested) */
:root[data-theme="light"] .brand__name{font-weight:800; letter-spacing:-.02em}

.nav__toggle{
  display:none;
  background:transparent; color:var(--text);
  border:1px solid var(--border);
  border-radius:12px; padding:.5rem .7rem;
}
.nav__menu{
  display:flex; gap:1rem; align-items:center; justify-content:center;
}
.nav__link{
  text-decoration:none; color:var(--muted);
  padding:.35rem .5rem; border-radius:10px;
}
.nav__link:hover{
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--text);
}
:root[data-theme="light"] .nav__link:hover{
  background: rgba(25,25,54,.08);
  color: var(--navy-2);
}

.nav__link:focus{outline:none; box-shadow:var(--focus)}

.search{
  display:flex; justify-content:flex-end; gap:.5rem;
}
.search input{
  width:min(420px, 100%);
  padding:.75rem .9rem;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--text);
}
.search input:focus{outline:none; box-shadow:var(--focus)}
.search input::placeholder{color:color-mix(in srgb, var(--muted) 80%, transparent)}

.btn{
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  border-radius:999px;
  padding:.7rem 1rem;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex; gap:.45rem; align-items:center; justify-content:center;
  transition:transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn:focus{outline:none; box-shadow:var(--focus)}

.btn--primary{
  background: linear-gradient(135deg, var(--red-1), var(--red-2));
  border-color: color-mix(in srgb, var(--red-1) 55%, transparent);
  color:#fff;
}
.btn--primary:hover{
  background: linear-gradient(135deg, color-mix(in srgb, var(--red-1) 88%, #fff 12%), var(--red-2));
}
:root[data-theme="light"] .btn--primary{
  background: linear-gradient(135deg, var(--navy-2), var(--navy-1));
  border-color: rgba(25,25,54,.22);
  color:#fff;
}
:root[data-theme="light"] .btn--primary:hover{
  background: linear-gradient(135deg, color-mix(in srgb, var(--navy-2) 88%, #fff 12%), var(--navy-1));
}

.btn--ghost{background:transparent}
.btn--sm{padding:.5rem .8rem; font-size:.9rem}
.btn--lg{padding:.85rem 1.15rem; font-weight:700}

.badge{
  min-width:22px; height:22px;
  border-radius:999px;
  background:rgba(224,49,33,.18);
  border:1px solid rgba(224,49,33,.30);
  display:inline-grid; place-items:center;
  font-size:.8rem; padding:0 .35rem;
}
:root[data-theme="light"] .badge{
  background:rgba(25,25,54,.10);
  border:1px solid rgba(25,25,54,.18);
}

.pill{
  display:inline-block;
  padding:.35rem .65rem;
  border-radius:999px;
  background:rgba(224,49,33,.14);
  border:1px solid rgba(224,49,33,.22);
  color:var(--text);
  font-weight:600;
  margin-bottom:.8rem;
}
:root[data-theme="light"] .pill{
  background:rgba(25,25,54,.08);
  border:1px solid rgba(25,25,54,.14);
  color:var(--navy-2);
}

.hero{padding:3.2rem 0 1.2rem}
.hero__grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:2rem;
  align-items:stretch;
}
.hero__copy{padding:1rem 0}
.hero__cta{display:flex; flex-wrap:wrap; gap:.7rem; margin:1.25rem 0 1rem}
.hero__stats{
  margin:1rem 0 0; padding:0;
  list-style:none; display:flex; flex-wrap:wrap; gap:.85rem;
  color:var(--muted);
}
.hero__card{display:flex}

.product-card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
}
:root[data-theme="light"] .product-card{
  background: linear-gradient(180deg, rgba(25,25,54,.04), rgba(25,25,54,.02));
}

.product-card__media img{
  width:100%; height:260px; object-fit:cover;
}
.product-card__body{padding:1.1rem}
.product-card__meta{display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:.75rem 0}
.product-card__actions{display:flex; gap:.6rem; flex-wrap:wrap}
.price{font-weight:800}
.rating{color:color-mix(in srgb, var(--brand-2) 65%, var(--text))}

.section__head{display:flex; flex-direction:column; gap:.25rem; margin-bottom:1.2rem}
.section__foot{margin-top:1.1rem}

.cards-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:1rem;
}
.cat-card{
  text-decoration:none;
  padding:1rem;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panel);
  transition:transform .12s ease, border-color .15s ease;
}
.cat-card:hover{
  transform:translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}
.cat-card__icon{font-size:1.4rem}
.cat-card__title{display:block; font-weight:800; margin:.45rem 0 .2rem}
.cat-card__desc{display:block; color:var(--muted); font-size:.95rem}

.products-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:1rem;
}
.card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--panel);
  box-shadow:var(--shadow);
  display:flex; flex-direction:column;
}
.card__media img{width:100%; height:180px; object-fit:cover}
.card__body{padding:1rem; display:flex; flex-direction:column; gap:.5rem; flex:1}
.card__title{font-weight:800; margin:0}
.card__row{display:flex; align-items:center; justify-content:space-between; gap:.8rem}
.card__chips{display:flex; gap:.4rem; flex-wrap:wrap}

.chip{
  font-size:.85rem;
  color:var(--muted);
  border:1px solid var(--border);
  padding:.2rem .55rem;
  border-radius:999px;
  background:rgba(255,255,255,.03);
}
:root[data-theme="light"] .chip{background:rgba(25,25,54,.03)}

.cta{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background: linear-gradient(
    135deg,
    rgba(224,49,33,.16),
    rgba(25,25,54,.12)
  );
  padding:1.2rem;
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; flex-wrap:wrap;
}
:root[data-theme="light"] .cta{
  background: linear-gradient(135deg, rgba(25,25,54,.10), rgba(224,49,33,.08));
}

.cta__form{display:flex; gap:.6rem; flex-wrap:wrap; align-items:center}
.cta__form input{
  padding:.75rem .9rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  min-width:min(320px, 100%);
}
.cta__form input:focus{outline:none; box-shadow:var(--focus)}
.form-hint{margin:0; width:100%}

.info-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:1rem;
}
.info{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--panel);
  padding:1rem;
}

.site-footer{border-top:1px solid var(--border); padding:2rem 0}
.footer__grid{
  display:grid;
  grid-template-columns: 1fr 1.6fr;
  gap:2rem;
  align-items:start;
}
.footer__links{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:1rem;
}
.footer__link{display:block; text-decoration:none; color:var(--muted); padding:.15rem 0}
.footer__link:hover{color:var(--text)}
.footer__bottom{padding-top:1rem; border-top:1px solid var(--border); margin-top:1.5rem}

.page-head{margin-bottom:1.25rem}

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:1.25rem;
  align-items:start;
}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:1rem;
}
.panel__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; margin-bottom:.75rem;
}

.field{display:grid; gap:.35rem; margin:.7rem 0}
.field input, .field select{
  padding:.7rem .8rem;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--text);
}
.field input:focus, .field select:focus{outline:none; box-shadow:var(--focus)}
.check{display:flex; gap:.55rem; align-items:center; color:var(--muted); margin:.35rem 0}

.results__bar{
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; margin-bottom:1rem;
}
.sort{display:flex; gap:.5rem; align-items:center}
.pagination{display:flex; justify-content:center; gap:.8rem; margin-top:1.2rem}

.breadcrumbs{display:flex; gap:.5rem; align-items:center; color:var(--muted); margin-bottom:1rem}
.breadcrumbs a{text-decoration:none; color:var(--muted)}
.breadcrumbs a:hover{color:var(--text)}

.product{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:1.5rem;
  align-items:start;
}
.product__media img{
  width:100%;
  border-radius:var(--radius);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  height:min(520px, 62vh);
  object-fit:cover;
}
.product__meta{display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:.75rem 0}
.product__chips{display:flex; gap:.4rem; flex-wrap:wrap; margin:.7rem 0}
.product__actions{display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; margin-top:1rem}

.qty{
  width:90px;
  padding:.75rem .8rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
}
.bullets{margin:.5rem 0 0; padding-left:1.1rem}
.details summary{cursor:pointer; font-weight:700}

.cart{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap:1.2rem;
  align-items:start;
}
.cart-list{display:grid; gap:.8rem}
.cart-item{
  display:grid;
  grid-template-columns: 92px 1fr auto;
  gap:.9rem;
  align-items:center;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:.7rem;
  background:rgba(255,255,255,.02);
}
:root[data-theme="light"] .cart-item{background:rgba(25,25,54,.02)}

.cart-item img{
  width:92px; height:70px; object-fit:cover;
  border-radius:14px; border:1px solid var(--border);
}
.cart-item__title{font-weight:800; margin:0}
.cart-item__meta{color:var(--muted); font-size:.9rem; margin:.25rem 0 0}
.cart-item__actions{display:flex; gap:.4rem; align-items:center; justify-content:flex-end; flex-wrap:wrap}

.cart-item__qty{
  width:72px;
  padding:.55rem .6rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
}

.summary{display:grid; gap:.8rem}
.summary__row{display:flex; align-items:center; justify-content:space-between; gap:1rem}
.summary__row--total{font-size:1.1rem}
hr{border:none; border-top:1px solid var(--border)}

/* Toast */
.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:999px;
  padding:.75rem 1rem;
  box-shadow:var(--shadow);
  max-width:min(720px, calc(100% - 2rem));
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.toast.is-visible{
  opacity:1;
  transform:translateX(-50%) translateY(-2px);
}

/* Responsive */
@media (max-width: 980px){
  .nav__inner{grid-template-columns: 1fr auto}
  .search{grid-column:1 / -1; justify-content:stretch}
  .search input{width:100%}
  .nav__toggle{display:inline-flex; justify-self:end}
  .nav__menu{
    display:none;
    grid-column:1 / -1;
    flex-direction:column;
    align-items:flex-start;
    padding:.6rem 0 .2rem;
  }
  .nav__menu.is-open{display:flex}
  .hero__grid{grid-template-columns:1fr}
  .cards-grid{grid-template-columns: repeat(2, 1fr)}
  .products-grid{grid-template-columns: repeat(2, 1fr)}
  .layout{grid-template-columns:1fr}
  .filters{position:relative}
  .product{grid-template-columns:1fr}
  .cart{grid-template-columns:1fr}
  .footer__grid{grid-template-columns:1fr}
  .footer__links{grid-template-columns: repeat(2, 1fr)}
}

@media (max-width: 520px){
  .products-grid{grid-template-columns:1fr}
  .cards-grid{grid-template-columns:1fr}
  .footer__links{grid-template-columns:1fr}
}


/* --- Logo (image only) --- */
.brand{display:flex; align-items:center; gap:12px; text-decoration:none}


/* --- Header logo (image only, consistent everywhere) --- */
.brand{display:flex; align-items:center; gap:12px; text-decoration:none}
.brand__logo{
  width:92px;
  height:92px;
  object-fit:cover;
  border-radius:10px;
  display:block;
  box-shadow: 0 10px 22px rgba(0,0,0,.30);
}



/* --- Demo product creator row (name + bio + avatar) --- */
.creator-row{
  display:flex;
  gap:.6rem;
  align-items:flex-start;
  margin:.65rem 0 .35rem;
}
.creator-avatar{
  width:34px;
  height:34px;
  border-radius:999px;
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
}
.creator-meta{min-width:0}
.creator-name{
  font-size:.9rem;
  font-weight:700;
  line-height:1.1;
}
.creator-bio{
  font-size:.82rem;
  color:var(--muted);
  line-height:1.25;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.section__head--split{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
}
.section__head--split .link{
  font-weight:700;
  white-space:nowrap;
}




/* ═══════════════════════════════════════════════════
   VERTICAL PRODUCT LIST — New/Cards/Gifts/Live rows
═══════════════════════════════════════════════════ */
.products-grid--vertical {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  grid-template-columns: none !important;
  width: 100%;
}

.products-grid--vertical .product-card {
  display: grid !important;
  grid-template-columns: 110px 1fr !important;
  min-height: 110px;
  max-height: 130px;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.products-grid--vertical .product-media {
  width: 110px !important;
  height: 110px !important;
  min-height: 110px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.products-grid--vertical .product-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.products-grid--vertical .product-media .badge {
  position: absolute;
  top: 5px; left: 5px;
  font-size: 9px !important;
  padding: 2px 5px !important;
}

.products-grid--vertical .product-body {
  padding: 10px 14px !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.products-grid--vertical .product-title {
  font-size: .88rem !important;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-grid--vertical .product-subtitle {
  font-size: .75rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-grid--vertical .creator-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.products-grid--vertical .creator-avatar {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
}

.products-grid--vertical .creator-name {
  font-size: .72rem !important;
  font-weight: 600;
}

.products-grid--vertical .creator-bio {
  display: none !important;
}

.products-grid--vertical .product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.products-grid--vertical .rating {
  font-size: .72rem !important;
}

.products-grid--vertical .price {
  font-size: .88rem !important;
  font-weight: 700;
}

.products-grid--vertical .product-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.products-grid--vertical .btn--sm {
  padding: 3px 10px !important;
  font-size: .72rem !important;
}

.products-grid--vertical .chip--video {
  padding: 3px 8px !important;
  font-size: .72rem !important;
}
