@import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Roboto+Mono:wght@400;600&display=swap');

:root {
  --primary:    #a68dff;
  --primary-dk: #6d56d9;
  --primary-dim: rgba(166, 141, 255, 0.12);
  --bg:         #1b1230;
  --surface:    rgba(22, 14, 40, 0.96);
  --surface-2:  rgba(30, 20, 50, 0.8);
  --border:     rgba(166, 141, 255, 0.12);
  --border-soft: rgba(255,255,255,0.08);
  --text:       #e5e5e5;
  --text-muted: #8a7fa0;
  --danger:     #e74c3c;
}

/* === GLOBAL === */
* { box-sizing: border-box; }
body {
  background: linear-gradient(160deg, #120b22 0%, #1b1230 60%, #0f0f15 100%);
  font-family: 'Inter', sans-serif;
  margin: 0; padding: 0;
  color: var(--text);
  min-height: 100vh;
}

/* === HEADER === */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin: 0;
  background-image: url('https://www.transparenttextures.com/patterns/carbon-fibre.png'),
                    linear-gradient(90deg, #4a3a7d, #a68dff, #4a3a7d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 8s linear infinite;
  filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
}

@keyframes shine {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

header .logo { max-height: 46px; }

/* === PRODUCTS GRID === */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* === PRODUCT CARD === */
.product {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.3);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.1), 0 4px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease-in-out;
}

.product:hover {
  box-shadow: inset 3px 3px 0 rgba(255,255,255,0.1), 0 4px 6px rgba(0,0,0,0.2);
}

.product img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  z-index: 1;
}

.product::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0.03));
  z-index: 2;
}

.product h3 {
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: calc(100% - 16px);
  padding: 5px 12px;
  font-size: 0.85rem; font-weight: 600; line-height: 1.1;
  text-align: center;
  background: rgba(0,0,0,0.6);
  border: 0.5px solid rgba(0,0,0,0.3);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.1);
  border-radius: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.product .product-media {
  position: absolute;
  top: 50%; left: 50%;
  width: 150%; height: 150%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: transform 0.3s ease;
}

/* === TAGS === */
.tag {
  position: absolute; top: 5px; left: 5px; z-index: 4;
  font-size: 0.65rem; font-weight: 700;
  padding: 4px 9px; border-radius: 20px;
  background: #ffffff; color: #333;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 8px;
}

.tag::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.tag.new::before  { background: #e03030; color: rgba(224,48,48,0.4); }
.tag.hot::before  { background: #fc782c; color: rgba(252,120,44,0.4); }
.tag.best::before { background: #3f51b5; color: rgba(63,81,181,0.4); }
.tag.none::before { background: #9e9e9e; color: rgba(158,158,158,0.4); }

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 currentcolor; }
  70%  { box-shadow: 0 0 0 6px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* === MODAL — bottom sheet === */
#modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 4, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  justify-content: flex-end;
  align-items: flex-end;
  z-index: 1000;
}

#modal .modal-content {
  width: 100%;
  max-height: 90vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(.4,0,.2,1);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Poignée visuelle */
#modal .modal-content::before {
  content: "";
  display: block;
  width: 36px; height: 4px;
  background: rgba(166,141,255,0.3);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* Zone media — pleine largeur, hauteur fixe */
.modal-media-wrap {
  width: 100%;
  height: 48vw;
  max-height: 280px;
  min-height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  background: #0a0615;
}

.modal-media {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Corps du modal */
.modal-body {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

#modal h2 {
  margin: 0;
  font-size: 1rem; font-weight: 600;
  color: var(--primary);
  text-align: left;
}

/* Select */
#price-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 11px 40px 11px 16px;
  background: #0e0820;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a68dff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

#price-select:focus { border-color: var(--primary); }

#price-select option {
  background: #1a142d;
  color: #fff;
}

/* Boutons modal */
.modal-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.btn-cart {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--primary-dk), var(--primary));
  border: none;
  border-radius: 10px;
  color: #0f0f15;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: 0.02em;
}
.btn-cart:hover { opacity: 0.88; }

.btn-close-modal {
  padding: 12px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  width: auto;
  margin: 0;
}
.btn-close-modal:hover { background: rgba(255,255,255,0.1); }

/* === PANIER === */
.cart {
  max-width: 560px;
  margin: 24px auto 16px;
  padding: 0 16px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.cart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cart-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--primary-dim);
  padding: 3px 10px;
  border-radius: 20px;
}

/* Item panier */
.cart-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 18px 0;
  margin: 0;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.cart-item:hover { border-color: rgba(166,141,255,0.25); }

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.cart-item-qty {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cart-item-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.cart-item-remove {
  width: 28px; height: 28px;
  padding: 5px;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  margin: 0;
}
.cart-item-remove:hover { background: rgba(231,76,60,0.25); }
.cart-item-remove img { width: 14px; height: 14px; display: block; filter: invert(40%) sepia(80%) saturate(600%) hue-rotate(320deg); }

/* Footer panier */
.cart-footer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 12px;
}

.cart-total-row span:first-child {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cart-total-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-validate {
  width: 100%;
  padding: 13px;
  background: linear-gradient(90deg, var(--primary-dk), var(--primary));
  border: none;
  border-radius: 12px;
  color: #0f0f15;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.2s, transform 0.15s;
  margin: 0;
}
.btn-validate:hover   { opacity: 0.9; }
.btn-validate:active  { transform: scale(0.98); }
.btn-validate:disabled { opacity: 0.5; cursor: not-allowed; }

/* === FOOTER DEV === */
.dev-footer {
  text-align: center;
  padding: 20px 0 14px;
}

.dev-footer a {
  font-size: 11px;
  color: rgba(166, 141, 255, 0.22);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}

.dev-footer a:hover { color: rgba(166, 141, 255, 0.55); }

/* === PARTICLES === */
#particles-js {
  position: fixed;
  width: 100%; height: 100%;
  z-index: -1;
}

/* === GLOBAL BUTTON RESET === */
button {
  font-family: inherit;
  cursor: pointer;
}
