/* ================================================================
   AfroStocker Gallery v1.1 — Moteur de recherche + Galerie Masonry
   ================================================================ */

:root {
  --as-gold:       #C8963E;
  --as-gold-dark:  #a87830;
  --as-gold-light: #f5e6ca;
  --as-obsidian:   #0A0A08;
  --as-ivory:      #F5F0E8;
  --as-terra:      #B85C38;
  --as-muted:      #6B6560;
  --as-border:     rgba(0,0,0,0.1);
  --as-radius:     8px;
  --as-radius-sm:  4px;
  --as-shadow:     0 4px 24px rgba(0,0,0,0.12);
  --as-shadow-hover: 0 8px 40px rgba(0,0,0,0.22);
  --as-tr:         240ms cubic-bezier(0.4,0,0.2,1);
}

#as-gallery-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
}

/* ================================================================
   HERO — FULL WIDTH SEARCH BLOCK (style Pixabay)
   ================================================================ */
.as-hero {
  background: linear-gradient(135deg, #0A0A08 0%, #1a1208 40%, #2a1c08 70%, #0f0f0a 100%);
  padding: 60px 20px 50px;
  text-align: center;
  overflow: hidden;
}

/* Subtle texture overlay */
.as-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(200,150,62,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184,92,56,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.as-hero-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.as-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--as-gold);
  margin: 0 0 14px;
  opacity: 0.9;
}

.as-hero-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.as-hero-sub {
  font-size: 14px;
  color: rgba(245,240,232,0.55);
  margin: 0 0 32px;
  font-weight: 400;
}

/* SEARCH BAR — the star of the show */
.as-searchbar-wrap {
  position: relative;
  margin-bottom: 20px;
}

.as-searchbar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 50px;
  padding: 0 8px 0 22px;
  height: 64px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.35), 0 1px 6px rgba(200,150,62,0.15);
  transition: border-color var(--as-tr), box-shadow var(--as-tr);
}

.as-searchbar:focus-within {
  border-color: var(--as-gold);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3), 0 0 0 4px rgba(200,150,62,0.2);
}

.as-search-icon {
  color: var(--as-gold);
  flex-shrink: 0;
  margin-right: 14px;
  display: flex;
  align-items: center;
  opacity: 0.9;
}

#as-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 17px;
  color: var(--as-obsidian);
  background: transparent;
  font-family: inherit;
  min-width: 0;
}

#as-search-input::placeholder { color: #bbb; }

.as-search-btn {
  background: var(--as-gold);
  color: var(--as-obsidian);
  border: none;
  border-radius: 50px;
  padding: 0 28px;
  height: 48px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--as-tr), transform var(--as-tr);
  white-space: nowrap;
}

.as-search-btn:hover { background: #d4a44a; transform: translateY(-1px); }

.as-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--as-muted);
  padding: 8px;
  display: none;
  align-items: center;
  border-radius: 50%;
  transition: background var(--as-tr);
  margin-right: 6px;
  flex-shrink: 0;
}
.as-search-clear:hover { background: #f0f0f0; }
.as-search-clear.visible { display: flex; }

/* HERO CATEGORY PILLS */
.as-hero-cats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.as-hero-cats-label {
  font-size: 12px;
  color: rgba(245,240,232,0.45);
  font-weight: 500;
}

.as-hero-cat-pill {
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid rgba(200,150,62,0.35);
  background: rgba(200,150,62,0.1);
  color: rgba(245,240,232,0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--as-tr);
  font-family: inherit;
}

.as-hero-cat-pill:hover {
  background: var(--as-gold);
  border-color: var(--as-gold);
  color: var(--as-obsidian);
}

/* AUTOCOMPLETE */
.as-autocomplete {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius);
  box-shadow: var(--as-shadow);
  z-index: 1000;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
  text-align: left;
}
.as-autocomplete.open { display: block; animation: as-fade-in 150ms ease; }
.as-ac-section { padding: 8px 0 4px; }
.as-ac-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--as-muted); padding: 0 16px 6px;
}
.as-ac-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; cursor: pointer;
  transition: background var(--as-tr); text-decoration: none; color: inherit;
}
.as-ac-item:hover { background: var(--as-ivory); }
.as-ac-thumb {
  width: 40px; height: 40px; border-radius: var(--as-radius-sm);
  object-fit: cover; flex-shrink: 0; background: #f0f0f0;
}
.as-ac-thumb-icon {
  width: 40px; height: 40px; border-radius: var(--as-radius-sm);
  background: #f5f0e8; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 18px;
}
.as-ac-name { font-size: 13px; font-weight: 500; color: var(--as-obsidian); }
.as-ac-sub  { font-size: 11px; color: var(--as-muted); margin-top: 2px; }
.as-ac-divider { height: 1px; background: var(--as-border); margin: 4px 0; }

/* ================================================================
   GALLERY BODY — padding under hero
   ================================================================ */
.as-gallery-body {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* CATEGORY TABS */
.as-cat-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 0 20px 20px; /* inside hero body */
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--as-border);
  max-width: 1400px;
  margin-left: auto; margin-right: auto;
  padding-left: 20px; padding-right: 20px;
}

.as-cat-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px;
  border: 1px solid var(--as-border); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--as-obsidian);
  cursor: pointer; transition: all var(--as-tr); white-space: nowrap;
  font-family: inherit;
}
.as-cat-tab:hover { border-color: var(--as-gold); color: var(--as-gold); background: #fdf8f0; }
.as-cat-tab.active { background: var(--as-obsidian); border-color: var(--as-obsidian); color: var(--as-gold); }
.as-cat-count {
  font-size: 11px; font-weight: 600;
  background: rgba(200,150,62,0.15); color: var(--as-gold-dark);
  padding: 1px 7px; border-radius: 100px;
}
.as-cat-tab.active .as-cat-count { background: rgba(200,150,62,0.2); color: var(--as-gold); }

/* FILTERS ROW */
.as-filters-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin: 0 auto 16px; flex-wrap: wrap;
  max-width: 1400px; padding: 0 20px;
}
.as-filters-left  { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.as-results-count { font-size: 13px; color: var(--as-muted); font-weight: 500; }
.as-tag-chips     { display: flex; gap: 6px; flex-wrap: wrap; }
.as-tag-chip {
  padding: 4px 12px; border-radius: 100px;
  border: 1px solid var(--as-border); background: #fff;
  font-size: 12px; color: var(--as-muted); cursor: pointer;
  transition: all var(--as-tr); font-family: inherit;
}
.as-tag-chip:hover, .as-tag-chip.active {
  background: var(--as-gold); border-color: var(--as-gold); color: #fff;
}
.as-sort-select {
  padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--as-border); background: #fff;
  font-size: 13px; color: var(--as-obsidian); cursor: pointer;
  outline: none; font-family: inherit;
}
.as-sort-select:focus { border-color: var(--as-gold); }

/* ACTIVE FILTERS */
.as-active-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 auto 16px; max-width: 1400px; padding: 0 20px;
}
.as-filter-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: #1a2a1a; color: #6fcf97;
  font-size: 12px; font-weight: 600; cursor: pointer;
}

/* ================================================================
   MASONRY GRID
   ================================================================ */
.as-masonry {
  column-count: 4; column-gap: 14px; min-height: 400px;
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
}
@media (max-width: 1200px) { .as-masonry { column-count: 3; } }
@media (max-width: 768px)  { .as-masonry { column-count: 2; column-gap: 10px; } }
@media (max-width: 480px)  { .as-masonry { column-count: 1; } }

/* CARD */
.as-card {
  break-inside: avoid; margin-bottom: 14px;
  border-radius: var(--as-radius); overflow: hidden;
  background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  cursor: pointer; transition: transform var(--as-tr), box-shadow var(--as-tr);
  position: relative; display: block;
  animation: as-card-in 300ms ease both;
}
.as-card:hover { transform: translateY(-3px); box-shadow: var(--as-shadow-hover); z-index: 10; }

.as-card-img-wrap {
  position: relative; overflow: hidden; display: block; background: #f0ede8;
}
.as-card-img-wrap img {
  width: 100%; height: auto; display: block;
  transition: transform 400ms cubic-bezier(0.4,0,0.2,1);
}
.as-card:hover .as-card-img-wrap img { transform: scale(1.05); }

/* OVERLAY */
.as-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,8,0.75) 0%, rgba(10,10,8,0.05) 50%, transparent 100%);
  opacity: 0; transition: opacity var(--as-tr);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
}
.as-card:hover .as-card-overlay { opacity: 1; }
.as-overlay-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.as-overlay-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--as-tr), transform var(--as-tr);
  flex-shrink: 0;
}
.as-overlay-btn:hover { background: var(--as-gold); border-color: var(--as-gold); transform: scale(1.1); }
.as-overlay-btn.as-btn-cart {
  margin-left: auto; background: var(--as-gold); border-color: var(--as-gold);
  color: var(--as-obsidian); width: auto; border-radius: 4px;
  padding: 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  text-decoration: none; display: flex; align-items: center;
}
.as-overlay-btn.as-btn-cart:hover { background: #d4a44a; }
.as-overlay-price {
  font-size: 12px; font-weight: 700; color: var(--as-gold);
  background: rgba(10,10,8,0.6); padding: 3px 8px; border-radius: 4px;
  display: inline-block; align-self: flex-start;
}

/* BADGE LICENCE */
.as-licence-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 100px;
  letter-spacing: 0.05em; text-transform: uppercase; z-index: 2;
  background: #1A2A1A; color: #6FCF97; border: 1px solid #2D7A4F;
}

/* CARD FOOTER */
.as-card-footer { padding: 10px 12px; }
.as-card-title {
  font-size: 13px; font-weight: 600; color: var(--as-obsidian);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.as-card-meta { display: flex; align-items: center; justify-content: space-between; }
.as-card-cat  { font-size: 11px; color: var(--as-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.as-card-price { font-size: 13px; font-weight: 700; color: var(--as-terra); flex-shrink: 0; margin-left: 8px; }

/* ================================================================
   LOADING / EMPTY / PAGINATION
   ================================================================ */
.as-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 0; color: var(--as-muted); font-size: 15px;
}
.as-spinner {
  width: 28px; height: 28px;
  border: 3px solid #f0ede8; border-top-color: var(--as-gold);
  border-radius: 50%; animation: as-spin 700ms linear infinite;
}
.as-empty { text-align: center; padding: 80px 20px; color: var(--as-muted); font-size: 15px; }
.as-empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.as-empty-title { font-size: 18px; font-weight: 600; color: var(--as-obsidian); margin-bottom: 8px; }

.as-pagination {
  display: flex; justify-content: center; gap: 6px;
  margin: 40px auto 0; flex-wrap: wrap; max-width: 1400px; padding: 0 20px;
}
.as-page-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--as-border); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--as-obsidian); cursor: pointer;
  transition: all var(--as-tr); font-family: inherit;
}
.as-page-btn:hover { border-color: var(--as-gold); color: var(--as-gold); }
.as-page-btn.active { background: var(--as-obsidian); border-color: var(--as-obsidian); color: var(--as-gold); }
.as-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ================================================================
   LIGHTBOX
   ================================================================ */
.as-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  display: flex !important; align-items: center; justify-content: center;
  padding: 20px; animation: as-fade-in 200ms ease;
}
.as-lightbox[style*='display:none'], .as-lightbox[style*='display: none'] { display: none !important; animation: none; }
.as-lightbox-backdrop { position: absolute; inset: 0; background: rgba(10,10,8,0.88); cursor: pointer; }
.as-lightbox-inner {
  position: relative; z-index: 1; background: #fff;
  border-radius: 12px; overflow: hidden;
  max-width: 1100px; width: 100%; max-height: 90vh;
  display: grid; grid-template-columns: 1fr 340px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  animation: as-scale-in 200ms cubic-bezier(0.4,0,0.2,1);
}
@media (max-width: 768px) {
  .as-lightbox-inner { grid-template-columns: 1fr; max-height: 95vh; overflow-y: auto; }
}
.as-lightbox-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(10,10,8,0.6); border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--as-tr);
}
.as-lightbox-close:hover { background: var(--as-terra); }
.as-lightbox-img-wrap {
  background: var(--as-obsidian); display: flex; align-items: center;
  justify-content: center; overflow: hidden; min-height: 300px;
}
.as-lightbox-img-wrap img { width: 100%; height: 100%; object-fit: contain; max-height: 90vh; }
.as-lightbox-info {
  padding: 28px 24px; display: flex; flex-direction: column;
  gap: 20px; overflow-y: auto; background: #fff;
}
.as-lightbox-info h2 { font-size: 17px; font-weight: 700; color: var(--as-obsidian); line-height: 1.3; margin: 0 0 8px; }
.as-lightbox-details { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.as-detail-pill {
  background: var(--as-ivory); border: 1px solid var(--as-border);
  border-radius: 100px; font-size: 11px; padding: 3px 10px; color: var(--as-muted); font-weight: 500;
}
.as-lightbox-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.as-lb-tag {
  font-size: 11px; color: var(--as-gold-dark);
  background: rgba(200,150,62,0.1); border-radius: 100px;
  padding: 3px 9px; cursor: pointer; transition: background var(--as-tr);
}
.as-lb-tag:hover { background: rgba(200,150,62,0.25); }

/* LICENCE SELECTOR */
.as-licence-selector { display: flex; flex-direction: column; gap: 8px; }
.as-licence-option {
  border: 1.5px solid var(--as-border); border-radius: 8px;
  padding: 12px 14px; cursor: pointer;
  transition: border-color var(--as-tr), background var(--as-tr);
}
.as-licence-option:hover  { border-color: var(--as-gold); background: #fdf8f0; }
.as-licence-option.active { border-color: var(--as-gold); background: #fdf8f0; }
.as-licence-name  { font-size: 13px; font-weight: 700; color: var(--as-obsidian); margin-bottom: 2px; }
.as-licence-desc  { font-size: 11px; color: var(--as-muted); margin-bottom: 4px; }
.as-licence-price { font-size: 15px; font-weight: 800; color: var(--as-gold-dark); }

.as-btn-buy {
  display: block; width: 100%; padding: 14px;
  background: var(--as-gold); color: var(--as-obsidian); border: none;
  border-radius: 6px; font-size: 14px; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase;
  text-align: center; cursor: pointer; text-decoration: none;
  transition: background var(--as-tr), transform var(--as-tr);
}
.as-btn-buy:hover { background: #d4a44a; transform: translateY(-1px); text-decoration: none; color: var(--as-obsidian); }
.as-btn-view {
  display: block; text-align: center; font-size: 13px;
  color: var(--as-muted); text-decoration: none; padding: 8px;
  border-radius: 6px; transition: color var(--as-tr), background var(--as-tr);
}
.as-btn-view:hover { color: var(--as-obsidian); background: var(--as-ivory); text-decoration: none; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes as-spin    { to { transform: rotate(360deg); } }
@keyframes as-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes as-scale-in { from { opacity:0; transform: scale(0.95); } to { opacity:1; transform: scale(1); } }
@keyframes as-card-in  { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 600px) {
  .as-hero { padding: 40px 16px 36px; }
  .as-searchbar { height: 56px; padding: 0 6px 0 18px; }
  #as-search-input { font-size: 15px; }
  .as-search-btn { padding: 0 18px; font-size: 13px; height: 44px; }
  .as-hero-title { font-size: 26px; }
  .as-lightbox { padding: 0; }
  .as-lightbox-inner { border-radius: 0; max-height: 100vh; }
  .as-cat-tabs { padding: 16px 12px; }
  .as-masonry { padding: 0 12px; }
}
