@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root{
  --bg: #ffffff;
  --surface: #faf8f4;
  --surface-2: #f1ede3;
  --line: #e4ddcd;
  --parchment: #6d5a2e;
  --arcane: #6d43e0;
  --arcane-soft: #6d43e0;
  --gold: #a9782c;
  --text: #221f2b;
  --text-muted: #756f80;
}

body.dark{
  --bg: #14111b;
  --surface: #1e1926;
  --surface-2: #262032;
  --line: #372f47;
  --parchment: #e9d9a8;
  --arcane: #8a6bff;
  --arcane-soft: #a68bff;
  --gold: #d9b25c;
  --text: #f3efe4;
  --text-muted: #a79fc0;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  line-height:1.5;
  transition: background .25s ease, color .25s ease;
}
.display{font-family:'Cormorant Garamond', serif;}

a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}

/* ---------- header ---------- */
header{
  position:sticky; top:0; z-index:40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line);
}
.header-inner{
  max-width:1180px; margin:0 auto; padding:8px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.logo{display:flex; align-items:center; gap:8px; flex-shrink:0;}
.logo img{height:64px; width:64px; object-fit:cover; border-radius:9px;}
.logo-text{font-family:'Cormorant Garamond', serif; font-size:20px; font-weight:600; letter-spacing:0.3px; white-space:nowrap;}
.logo-text em{font-style:normal; color:var(--gold); font-size:13px; letter-spacing:1px; margin-left:2px;}
nav{display:flex; gap:6px; flex-wrap:wrap;}
.header-actions{display:flex; align-items:center; gap:8px; flex-shrink:0;}
.search-box{
  display:flex; align-items:center; gap:6px;
  width:120px; padding:7px 12px;
  border:1px solid var(--line); border-radius:999px; background:var(--surface);
  color:var(--text-muted); transition:width .2s;
}
.search-box:focus-within{border-color:var(--arcane-soft); color:var(--text); width:180px;}
.search-box input{
  border:none; background:none; outline:none; width:100%; font-size:13px; color:var(--text);
  font-family:'Manrope', sans-serif;
}
.search-box input::placeholder{color:var(--text-muted);}
.theme-toggle{
  display:flex; align-items:center; justify-content:center;
  width:34px; height:34px; border:1px solid var(--line); border-radius:50%;
  transition:border-color .2s; flex-shrink:0;
}
.theme-toggle:hover{border-color:var(--arcane-soft);}
.cart-btn{
  position:relative; display:flex; align-items:center; gap:6px;
  border:1px solid var(--line); padding:7px 14px; border-radius:999px;
  font-size:12px; letter-spacing:0.2px; flex-shrink:0; white-space:nowrap;
}
.cart-btn:hover{border-color:var(--arcane-soft);}
.cart-count{
  background:var(--arcane); color:#ffffff; font-weight:700; font-size:11px;
  width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center;
}

/* ---------- hero ---------- */
.hero{
  max-width:1180px; margin:0 auto; padding:80px 28px 48px;
  text-align:center; position:relative;
}
.hero::before{
  content:""; position:absolute; top:-40px; left:50%; transform:translateX(-50%);
  width:520px; height:280px; border-radius:50%;
  background: radial-gradient(closest-side, rgba(124,92,255,0.20), transparent 70%);
  pointer-events:none;
}
.eyebrow{
  font-size:12px; letter-spacing:3px; text-transform:uppercase; color:var(--gold);
  margin-bottom:18px; position:relative;
}
h1.hero-title{
  font-size:56px; font-weight:600; line-height:1.08; max-width:760px; margin:0 auto 20px;
  position:relative;
}
h1.hero-title em{font-style:italic; color:var(--arcane-soft);}
.hero-sub{
  color:var(--text-muted); max-width:480px; margin:0 auto 34px; font-size:15px; position:relative;
}

/* ---------- category filter (in header nav) ---------- */
.chip{
  border:1px solid var(--line); padding:6px 12px; border-radius:999px;
  font-size:12px; color:var(--text-muted); transition:all .2s; white-space:nowrap;
}
.chip:hover{color:var(--text); border-color:var(--arcane-soft);}
.chip.active{background:var(--arcane); color:#ffffff; border-color:var(--arcane); font-weight:600;}

/* ---------- grid ---------- */

main{max-width:1180px; margin:0 auto; padding:44px 28px 100px;}
.grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:22px;
}
.empty-state{
  grid-column:1/-1; text-align:center; padding:60px 20px; color:var(--text-muted); font-size:14px;
}

.card{
  position:relative; background:var(--surface); border:1px solid var(--line);
  border-radius:14px 14px 8px 8px; padding:22px; overflow:hidden;
  transition:transform .25s ease, border-color .25s ease;
}
.card:hover{transform:translateY(-4px); border-color:var(--arcane-soft);}
.card::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.95) 45%, rgba(169,120,44,0.35) 50%, rgba(109,67,224,0.35) 55%, transparent 65%);
  transform:translateX(-120%);
  transition:transform .7s ease;
}
.card:hover::after{transform:translateX(120%);}

.icon-wrap{
  width:100%; height:120px; display:flex; align-items:center; justify-content:center;
  background:var(--surface-2); border-radius:10px; margin-bottom:16px; position:relative;
}
.rare-badge{
  position:absolute; top:8px; right:8px; background:rgba(202,154,61,0.15); color:var(--gold);
  font-size:10px; letter-spacing:1px; text-transform:uppercase; padding:3px 8px; border-radius:5px;
  border:1px solid rgba(202,154,61,0.4);
}
.premium-badge{
  position:absolute; top:8px; right:8px; display:flex; align-items:center; gap:4px;
  background:linear-gradient(100deg, #a9782c, #e0b45a, #a9782c);
  color:#241c08; font-size:10px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase;
  padding:3px 9px 3px 6px; border-radius:5px;
}
.premium-badge svg{width:11px; height:11px;}
.cat-label{
  font-size:11px; letter-spacing:1.5px; text-transform:uppercase; color:var(--text-muted); margin-bottom:6px;
}
.card h3{
  font-family:'Cormorant Garamond', serif; font-size:21px; font-weight:600; margin-bottom:6px;
}
.card p.desc{font-size:13px; color:var(--text-muted); margin-bottom:16px; min-height:34px;}
.card-actions{display:flex; flex-direction:column; gap:10px;}
.card-footer{display:flex; align-items:center; justify-content:space-between;}
.price{font-family:'Cormorant Garamond', serif; font-size:22px; color:var(--parchment);}
.add-btn{
  border:1px solid var(--arcane-soft); color:var(--arcane-soft); padding:8px 14px; border-radius:8px;
  font-size:13px; font-weight:600; transition:all .2s;
}
.add-btn:hover{background:var(--arcane); color:#ffffff; border-color:var(--arcane);}
.details-link{
  font-size:12px; color:var(--text-muted); text-align:center; padding:6px; border-radius:8px;
  border:1px solid transparent; transition:all .2s;
}
.details-link:hover{color:var(--arcane); border-color:var(--line);}

/* ---------- cart drawer ---------- */
.overlay{
  position:fixed; inset:0; background:rgba(10,8,15,0.6); z-index:50;
  opacity:0; pointer-events:none; transition:opacity .25s ease;
}
.overlay.open{opacity:1; pointer-events:auto;}
.drawer{
  position:fixed; top:0; right:0; height:100%; width:380px; max-width:90vw;
  background:var(--surface); border-left:1px solid var(--line); z-index:51;
  display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform .3s ease;
}
.drawer.open{transform:translateX(0);}
.drawer-header{
  padding:22px 24px; border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
}
.drawer-header h2{font-family:'Cormorant Garamond', serif; font-size:24px;}
.close-btn{font-size:22px; color:var(--text-muted);}
.close-btn:hover{color:var(--text);}
.drawer-items{flex:1; overflow-y:auto; padding:18px 24px;}
.drawer-item{
  display:flex; gap:12px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line);
}
.drawer-item .icon-mini{
  width:46px; height:46px; background:var(--surface-2); border-radius:8px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
.drawer-item-info{flex:1;}
.drawer-item-info h4{font-size:14px; font-weight:600;}
.drawer-item-info span{font-size:12px; color:var(--text-muted);}
.qty-controls{display:flex; align-items:center; gap:10px;}
.qty-controls button{
  width:24px; height:24px; border:1px solid var(--line); border-radius:6px; font-size:14px;
}
.qty-controls button:hover{border-color:var(--arcane-soft);}
.empty-cart{color:var(--text-muted); font-size:14px; text-align:center; padding:60px 20px;}
.drawer-footer{padding:20px 24px; border-top:1px solid var(--line);}
.subtotal-row{display:flex; justify-content:space-between; margin-bottom:16px; font-size:15px;}
.subtotal-row strong{font-family:'Cormorant Garamond', serif; font-size:22px; color:var(--parchment);}
.checkout-btn{
  width:100%; background:var(--arcane); color:#ffffff; padding:14px; border-radius:8px;
  font-weight:700; font-size:14px; text-align:center;
}
.checkout-note{font-size:11px; color:var(--text-muted); text-align:center; margin-top:10px;}

footer{border-top:1px solid var(--line); padding:32px 28px; text-align:center; color:var(--text-muted); font-size:12px;}

/* ---------- stock note ---------- */
.stock-note{
  display:inline-block; font-size:11px; color:var(--text-muted); margin-bottom:10px;
}
.stock-note.low{
  color:#ffffff; font-weight:700; background:#d1483c;
  padding:2px 8px; border-radius:5px; letter-spacing:0.2px;
}
.stock-note.out{color:#b3413a; font-weight:600;}
.add-btn:disabled{opacity:0.4; cursor:not-allowed;}
.add-btn:disabled:hover{background:none; color:var(--arcane-soft);}

/* ---------- product modal (quick view) ---------- */
.product-modal{
  position:fixed; top:50%; left:50%; transform:translate(-50%, -48%) scale(0.96);
  width:440px; max-width:90vw; max-height:88vh; overflow-y:auto;
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  padding:32px; z-index:61;
  opacity:0; pointer-events:none; transition:all .25s ease;
}
.product-modal.open{opacity:1; pointer-events:auto; transform:translate(-50%, -50%) scale(1);}
.modal-close{position:absolute; top:18px; right:20px; font-size:22px; color:var(--text-muted);}
.modal-close:hover{color:var(--text);}
.modal-icon{
  width:100%; height:140px; display:flex; align-items:center; justify-content:center;
  background:var(--surface-2); border-radius:10px; margin-bottom:18px; position:relative;
}
.modal-icon svg{width:64px; height:64px;}
#modalName{font-size:26px; margin-bottom:10px;}
.modal-desc{font-size:14px; color:var(--text-muted); margin-bottom:14px; line-height:1.6;}
.modal-footer{display:flex; align-items:center; justify-content:space-between; margin:18px 0;}
.modal-qty{display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-radius:8px; padding:6px 12px;}
.modal-qty button{width:22px; height:22px; font-size:15px;}
.modal-qty button:hover{color:var(--arcane);}
#modalDetailsLink{display:block; text-align:center; margin-top:12px;}

/* ---------- product detail page ---------- */
.breadcrumb{
  max-width:1180px; margin:0 auto; padding:20px 28px 0; font-size:13px; color:var(--text-muted);
}
.breadcrumb a:hover{color:var(--arcane);}
.product-detail{
  max-width:1180px; margin:0 auto; padding:36px 28px 80px;
  display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:start;
}
.detail-visual{
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  display:flex; align-items:center; justify-content:center; padding:60px; position:relative; overflow:hidden;
}
.detail-visual svg{width:140px; height:140px;}
.detail-visual::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.95) 45%, rgba(169,120,44,0.35) 50%, rgba(109,67,224,0.35) 55%, transparent 65%);
  transform:translateX(-130%); animation:detailShine 5s ease-in-out infinite;
}
@keyframes detailShine{
  0%, 60%{transform:translateX(-130%);}
  100%{transform:translateX(130%);}
}
.detail-info h1{font-size:34px; margin:10px 0 16px;}
.detail-price{font-family:'Cormorant Garamond', serif; font-size:30px; color:var(--parchment); margin-bottom:16px;}
.detail-desc{color:var(--text-muted); font-size:15px; line-height:1.7; margin-bottom:18px;}
.detail-qty-row{display:flex; align-items:center; gap:18px; margin:22px 0;}
.detail-actions .checkout-btn{width:auto; padding:14px 34px;}
.seo-section{
  max-width:1180px; margin:0 auto 80px; padding:0 28px;
}
.seo-section h2{font-size:24px; margin-bottom:14px;}
.seo-section p{color:var(--text-muted); font-size:14px; line-height:1.8; margin-bottom:14px; max-width:760px;}

@media (max-width:1100px){
  .cart-label{display:none;}
}
@media (max-width:900px){
  .header-inner{flex-wrap:wrap; row-gap:10px;}
  nav{order:3; width:100%; justify-content:flex-start;}
  .product-detail{grid-template-columns:1fr;}
}
@media (max-width:640px){
  h1.hero-title{font-size:38px;}
  .drawer{width:100%; max-width:100%;}
  .search-box{width:100px;}
}
