/* === TOKENS === */
:root {
  --gold: #C9A96E;
  --gold-light: #E8D5A8;
  --gold-dark: #8B6914;
  --gold-10: rgba(201,169,110,.1);
  --gold-20: rgba(201,169,110,.2);
  --gold-40: rgba(201,169,110,.4);
  --bg: #080808;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --bg-elevated: #161616;
  --bg-sheet: #0e0e0e;
  --text: #F5F0E8;
  --text-dim: #8a8a8a;
  --text-mid: #b8b8b8;
  --border: rgba(201,169,110,.12);
  --border-strong: rgba(201,169,110,.25);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 50px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(80px + var(--safe-bottom));
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* === HEADER === */
.header {
  padding: 16px 20px 12px;
  background: linear-gradient(180deg, rgba(201,169,110,.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}
.header-tagline {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-top: 1px;
}

/* === SEARCH === */
.search-bar {
  padding: 12px 20px 8px;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--gold-40);
  box-shadow: 0 0 0 3px var(--gold-10);
}
.search-clear {
  position: absolute;
  right: 12px;
  font-size: 20px;
  color: var(--text-dim);
  padding: 4px;
  line-height: 1;
}

/* === CATEGORIES === */
.categories {
  display: flex;
  gap: 8px;
  padding: 8px 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-mid);
  transition: all .2s;
  white-space: nowrap;
}
.cat-chip.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  color: var(--bg);
  font-weight: 600;
}
.cat-chip:not(.active):hover { border-color: var(--gold-40); color: var(--text); }

/* === BRANDS STRIP === */
.brands-strip {
  display: flex;
  gap: 8px;
  padding: 10px 20px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.brands-strip::-webkit-scrollbar { display: none; }
.brand-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all .25s;
  white-space: nowrap;
  text-transform: uppercase;
}
.brand-pill.active {
  border-color: var(--gold);
  color: #080808;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  box-shadow: 0 2px 12px rgba(201,169,110,.3);
  font-weight: 700;
}
.brand-pill:not(.active):hover {
  border-color: var(--gold-40);
  color: var(--gold-light);
  background: var(--gold-10);
}

/* === RESULTS BAR === */
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color .2s;
}
.sort-btn:hover { color: var(--gold); }
.sort-btn.asc svg { transform: rotate(180deg); }

/* === PRODUCTS GRID === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 12px 20px;
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px 10px 20px; }
}

/* === PRODUCT CARD === */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.32,.72,0,1), border-color .2s, box-shadow .3s;
  animation: cardIn .4s ease both;
}
.product-card:active {
  transform: scale(0.97);
}
.product-card:hover {
  border-color: var(--gold-40);
  box-shadow: 0 8px 32px rgba(201,169,110,.12), 0 0 0 1px rgba(201,169,110,.08);
  transform: translateY(-2px);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-visual {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #111 0%, #0a0a0a 60%, #080808 100%);
}
/* Halo doré derrière le produit */
.card-visual::before {
  content: '';
  position: absolute;
  width: 80%;
  height: 80%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(201,169,110,.12) 0%, transparent 70%);
  z-index: 0;
}
/* Surface réfléchissante en bas */
.card-visual::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent 0%, rgba(201,169,110,.04) 70%, rgba(201,169,110,.08) 100%);
  z-index: 0;
}
.card-img {
  max-width: 65%;
  max-height: 120px;
  object-fit: contain;
  z-index: 2;
  filter:
    drop-shadow(0 2px 8px rgba(0,0,0,.7))
    drop-shadow(0 8px 20px rgba(0,0,0,.4))
    drop-shadow(0 0 12px rgba(201,169,110,.1));
  transition: transform .35s cubic-bezier(.32,.72,0,1), filter .35s;
}
.product-card:hover .card-img {
  transform: scale(1.08) translateY(-3px);
  filter:
    drop-shadow(0 4px 12px rgba(0,0,0,.7))
    drop-shadow(0 12px 28px rgba(0,0,0,.4))
    drop-shadow(0 0 20px rgba(201,169,110,.2));
}
.card-monogram {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  opacity: .25;
  letter-spacing: -2px;
  z-index: 1;
}
.card-volume {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-10);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
  z-index: 1;
}
.card-category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  z-index: 1;
}
.card-body {
  padding: 12px 12px 14px;
  border-top: 1px solid var(--border);
}
.card-brand {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 4px;
  opacity: .8;
}
.card-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.card-price-eur {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}
.card-stars {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  background: var(--gold-10);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Card gradients by brand */
.card-visual[data-brand="LATTAFA"] { background: linear-gradient(145deg, #1a0f2e 0%, #0d0d1a 100%); }
.card-visual[data-brand="ARD AL ZAAFARAN"] { background: linear-gradient(145deg, #2e1a0f 0%, #1a0d0d 100%); }
.card-visual[data-brand="MAISON ALHAMBRA"] { background: linear-gradient(145deg, #0f2e1a 0%, #0d1a0d 100%); }
.card-visual[data-brand="SWISS ARABIAN"] { background: linear-gradient(145deg, #0f1a2e 0%, #0d0d1a 100%); }
.card-visual[data-brand="GULF ORCHID"] { background: linear-gradient(145deg, #2e0f2e 0%, #1a0d1a 100%); }
.card-visual[data-brand="LATTAFA PRIDE"] { background: linear-gradient(145deg, #2e1a2e 0%, #1a0d1a 100%); }
.card-visual[data-brand="RIIFFS"] { background: linear-gradient(145deg, #1a2e2e 0%, #0d1a1a 100%); }
.card-visual[data-brand="LOUI MARTIN"] { background: linear-gradient(145deg, #2e2e0f 0%, #1a1a0d 100%); }

/* === PRODUCT DETAIL OVERLAY === */
.product-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.product-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.product-detail {
  width: 100%;
  max-height: 85vh;
  background: var(--bg-sheet);
  border-radius: 24px 24px 0 0;
  padding: 8px 24px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,0,1);
}
.product-overlay.open .product-detail {
  transform: translateY(0);
}

.detail-handle {
  width: 36px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 2px;
  margin: 4px auto 20px;
  opacity: .4;
}
.detail-visual {
  height: 200px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.detail-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, var(--gold) 0%, transparent 60%);
  opacity: .1;
}
.detail-img {
  max-width: 70%;
  max-height: 170px;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.5));
}
.detail-monogram {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  color: var(--gold);
  opacity: .2;
  letter-spacing: -4px;
}
.detail-brand {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 6px;
}
.detail-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.detail-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-tag {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--gold-10);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 500;
}
.detail-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.detail-price-section {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-price {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
}
.detail-price-stars {
  font-size: 16px;
  color: var(--gold);
  font-weight: 500;
}
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-add-cart {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all .2s;
}
.btn-add-cart:active { transform: scale(0.97); }
.btn-buy-now {
  flex: 2;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: 0.3px;
  transition: all .2s;
}
.btn-buy-now:active { transform: scale(0.97); }

/* === CART BAR === */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-strong);
  padding: 12px 20px calc(12px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 80;
  backdrop-filter: blur(20px);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.cart-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-text {
  font-size: 14px;
  font-weight: 500;
}
.cart-total {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.cart-btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  font-size: 13px;
  font-weight: 700;
  color: var(--bg);
}

/* === CART OVERLAY === */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cart-sheet {
  width: 100%;
  max-height: 80vh;
  background: var(--bg-sheet);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,0,1);
}
.cart-overlay.open .cart-sheet {
  transform: translateY(0);
}
.cart-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.cart-sheet-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}
.cart-close {
  font-size: 28px;
  color: var(--text-dim);
  padding: 4px;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-visual {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-item-mono {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  opacity: .4;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-brand {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.cart-item-remove {
  color: var(--text-dim);
  font-size: 20px;
  padding: 4px;
}
.cart-footer {
  padding: 16px 24px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}
.cart-footer-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}
.cart-footer-total span:last-child { color: var(--gold); }
.checkout-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  font-size: 15px;
  font-weight: 700;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s;
}
.checkout-btn:active { transform: scale(0.97); }

/* === CART EMPTY === */
.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .3;
}
.cart-empty p {
  font-size: 14px;
}

/* === LOADER === */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity .5s;
}
.loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loader-ring {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* === NO RESULTS === */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.no-results-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .3;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all .3s;
  z-index: 300;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* fin */
