:root {
  --main-bg: #10141a;
  --card-bg: #181f29;
  --sidebar-bg: #181f29;
  --cart-item-bg: #23273b;
  --sidebar-accent: #43e97b;
  --header-bg: #171d25;
  --cart-red: #d62828;
  --cart-red-hover: #a51d1d;
  --highlight: #43e97b;
  --highlight-hover: #32c972;
  --white: #fff;
  --border-radius: 1rem;
  --shadow: 0 4px 16px #0d11180a;
  --max-width: 1200px;
}

html, body { margin: 0; padding: 0; box-sizing: border-box; }
* { box-sizing: inherit; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--main-bg);
  color: var(--white);
  min-height: 100vh;
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px;
  background: var(--header-bg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 6px #0003;
  animation: fade-in 0.8s;
}
.logo { font-weight: 700; font-size: 18px; letter-spacing: 1px; color: var(--white); text-decoration: none !important; }
nav { display: flex; align-items: center; gap: 20px;}
nav a {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  border: none;
  outline: none;
  transition: color 0.2s;
}
nav a:hover {
  color: var(--cart-red);
}
.logo:hover {
  color: var(--white);
}

.cart-btn {
  background: var(--cart-red);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 18px 8px 16px;
  border-radius: 2em;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: background .2s, box-shadow .2s, transform .1s;
  box-shadow: 0 2px 10px rgba(214,40,40,0.18);
  outline: none;
}
.cart-btn:active { transform: scale(0.97); }
.cart-btn:hover, .cart-btn:focus { background: var(--cart-red-hover);}
.cart-icon {
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin-right: 2px;
  margin-bottom: 1px;
  fill: currentColor;
}
.cart-count-badge {
  background: var(--white);
  color: var(--cart-red);
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  padding: 2px 7px;
  min-width: 26px;
  text-align: center;
  display: inline-block;
  margin-left: 2px;
  box-shadow: 0 2px 6px #0002;
  animation: pop .3s;
  transition: background .2s, color .2s;
}
@keyframes pop {
  0% { transform: scale(0.5);}
  60% { transform: scale(1.2);}
  100% { transform: scale(1);}
}
h1 { text-align: center; font-size: 36px; margin: 40px 0 28px; letter-spacing: 2px; }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 28px; max-width: var(--max-width); margin:0 auto 60px;
  padding: 0 1rem;
}
.product {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 22px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
  will-change: box-shadow, transform;
  position: relative;
  animation: fade-in .9s;
}
.product:hover {
  box-shadow: 0 12px 28px #43e97b10;
  transform: translateY(-2px) scale(1.025);
}
.product h2 { font-size:19px; margin-bottom: 11px;}
.variant-select {
  margin: 12px 0 8px; padding: 9px; font-size: 14px;
  background: #1f1f1f; color: #fff; border: 1px solid #333; border-radius: 4px; width: 100%;
  transition: border .2s;
}
.variant-select:focus { border: 1.5px solid var(--highlight);}
.product p { font-size:13px; color: #ccc; margin: 12px 0 19px;}
.add-to-cart-btn {
  background: var(--cart-red);
  color: var(--white);
  border: none;
  padding: 11px 24px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background .18s, transform .1s;
  margin-top: 6px;
  box-shadow: 0 2px 8px #d6282810;
}
.add-to-cart-btn:hover, .add-to-cart-btn:focus {
  background: var(--cart-red-hover);
  transform: translateY(-2px) scale(1.025);
}

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 39; background: rgba(0,0,0,0.12); opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.cart-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: -410px; width: 370px; max-width: 97vw; height: 100vh;
  background: #181f29;
  box-shadow: -6px 0 32px #42e97b19, -2px 0 14px #10141a2e;
  z-index: 40;
  transition: right .36s cubic-bezier(.68,-0.55,.27,1.55);
  display: flex; flex-direction: column; padding: 28px 20px 12px 22px;
  border-radius: 20px 0 0 20px;
  will-change: right;
  border-left: 3.5px solid #43e97b;
}
.cart-drawer.open { right: 0; }
.cart-drawer-header {
  font-size: 1.23rem; font-weight: bold; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
  border-bottom: 1.5px solid #43e97b;
  padding-bottom: 10px;
  background: transparent;
}
.cart-drawer-close {
  font-size: 1.7rem;
  background: none; border: none; color: var(--white);
  opacity: 0.5; cursor: pointer; transition: opacity .18s;
  text-decoration: none;
}
.cart-drawer-close:hover { opacity: 1; }
.cart-items { flex: 1; overflow-y: auto; margin-bottom: 1.4rem;}
.cart-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #23273b;
  border-radius: 12px;
  padding: 0.95em 0.8em 0.95em 1.1em;
  margin-bottom: 1.08em;
  box-shadow: 0 2px 10px #43e97b22, 0 1px 3px #10141a10;
  border: 1.5px solid #232e41;
  animation: fade-in 0.7s;
  transition: box-shadow .16s, background .18s;
  text-decoration: none;
}
.cart-item:hover {
  background: #252c45;
  box-shadow: 0 8px 22px #43e97b19, 0 2px 10px #43e97b2a;
  text-decoration: none;
}
.cart-item-title { font-weight: 600; font-size: 1em; }
.cart-item-variant { font-size: 0.94em; color: #c6ffe7; opacity: 0.75; }
.cart-item-price { font-size: 0.98em; color: var(--highlight); }
.cart-item-controls { display: flex; align-items: center; gap: 0.6em; }
.qty-btn {
  background: var(--highlight); color: var(--main-bg);
  border: none; border-radius: 0.4em; width: 2em; height: 2em;
  font-weight: bold; font-size: 1.1em; cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.qty-btn:hover { background: var(--highlight-hover);}
.cart-remove-btn {
  background: transparent; color: #f87171; border: none; font-size: 1.3em; cursor: pointer; margin-left: 2px; padding: 0 6px;
  opacity: .7; transition: opacity .18s;
  text-decoration: none !important;
  border: none !important;
}
.cart-remove-btn:hover { opacity: 1; color: #ff3c3c; text-decoration: none;}
.cart-total {
  font-size: 1.09rem; font-weight: bold; color: var(--highlight); margin-bottom: 1.4rem;
  border-top: 1.5px solid #43e97b;
  padding-top: 11px;
  text-decoration: none;
}
.checkout-btn {
  background: linear-gradient(90deg, var(--highlight), #38f9d7);
  color: var(--main-bg);
  font-weight: bold;
  border: none;
  border-radius: 0.7em;
  padding: 1em 0;
  width: 100%;
  font-size: 1.09em;
  cursor: pointer;
  box-shadow: 0 2px 8px #43e97b22;
  transition: background .19s, color .18s;
  margin-bottom: 12px;
  margin-top: 3px;
  text-decoration: none;
}
.checkout-btn:hover, .checkout-btn:focus { background: linear-gradient(90deg,#43e97b,#0fc9ff); color: #10141a;}
.cart-empty { opacity: 0.8; text-align: center; font-size: 1.04em; margin-top: 2.5em;}
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 15px;}
  header { padding: 13px 6vw;}
  .cart-drawer { width: 99vw; border-radius: 0;}
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px);}
  to { opacity: 1; transform: none;}
}
