@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.1);
  --surface:     #130d22;
  --surface-2:   #1a1230;
  --border:      rgba(166,141,255,0.1);
  --text:        #ede8ff;
  --text-muted:  #7a6e96;
  --danger:      #e74c3c;
}

* { 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 === */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.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.08);
  transition: box-shadow 0.2s;
}
.product:hover {
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.12);
}
.product img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
.product::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent 55%);
  z-index: 2;
}
.product h3 {
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: calc(100% - 16px);
  padding: 6px 15px;
  font-size: 0.75rem; 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;
}

/* === TAGS === */
.tag {
  position: absolute; top: 5px; left: 5px; z-index: 4;
  font-size: 0.62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  background: #fff; color: #222;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 6px;
}
.tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
  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 5px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* === MODAL === */
#modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,2,14,0.82);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

#modal {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn 0.2s cubic-bezier(.32,0,.2,1);
}

@keyframes popIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Zone media — moitié haute */
.modal-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #08031a;
  flex-shrink: 0;
}

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

/* Bouton fermer — cercle propre en haut à droite */
.btn-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 10;
  width: 28px; height: 28px;
  background: rgba(10,5,20,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s, border-color 0.18s;
}
.btn-modal-close:hover {
  background: rgba(20,10,40,0.85);
  border-color: rgba(166,141,255,0.3);
}
.btn-modal-close svg {
  display: block;
  flex-shrink: 0;
}

/* Corps modal */
.modal-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#modal h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Select (mode cart) */
#price-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 32px 9px 12px;
  background: #0e0820;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  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 8px center;
  background-size: 16px;
}
#price-select:focus { border-color: var(--primary); }
#price-select option { background: #1a142d; color: var(--text); }

/* Liste prix (mode contact) */
.price-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(166,141,255,0.04);
  border: 1px solid rgba(166,141,255,0.08);
  border-radius: 8px;
}

.price-row-qty {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.price-row-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* CTA unique — bouton et lien partagent le même style */
.btn-cta {
  display: block;
  width: 100%;
  padding: 11px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #0e0820;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.18s;
  box-sizing: border-box;
}
.btn-cta:active  { opacity: 0.82; }
.btn-cta:disabled { opacity: 0.4; cursor: not-allowed; }

/* === 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.82rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  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;
}

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

.cart-item-name {
  font-size: 0.84rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.cart-item-qty { font-size: 0.72rem; 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: 700; color: var(--primary); white-space: nowrap; }

.cart-item-remove {
  width: 26px; height: 26px; padding: 5px;
  background: rgba(231,76,60,0.07);
  border: 1px solid rgba(231,76,60,0.15);
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin: 0;
}
.cart-item-remove img {
  width: 12px; height: 12px; display: block;
  filter: invert(40%) sepia(80%) saturate(600%) hue-rotate(320deg);
}

.cart-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

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

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

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

/* === FOOTER === */
.dev-footer {
  text-align: center;
  padding: 22px 0 16px;
}
.dev-footer a {
  font-size: 9px;
  color: rgba(166,141,255,0.2);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}
.dev-footer a:hover { color: rgba(166,141,255,0.5); }

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

button { font-family: inherit; cursor: pointer; }
