@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Sofia+Sans+Condensed:wght@600;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red:     #e63946;
  --red-dk:  #c62f3b;
  --bg:      #f4f4f4;
  --surface: #ffffff;
  --text:    #1a1a1a;
  --muted:   #888;
  --border:  #e0e0e0;
  --header-h: 54px;
  --kw-h:    42px;
}

html { scroll-behavior: smooth; -webkit-box-sizing: border-box; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* ─── HEADER ─────────────────────────────────── */
#taha-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.logo-wrap {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.logo-icon {
  width: 22px; height: 22px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
}
/* Hide broken image - favicon.ico must be placed in public/ */
.logo-icon[src=""][alt], .logo-icon:not([src]) {
  display: none;
}
.logo-text {
  font-family: 'Archivo Black', sans-serif;
  font-size: 21px; color: var(--red);
  letter-spacing: -1px; line-height: 1;
}

.search-wrap {
  flex: 1; max-width: 520px; margin: 0 auto; position: relative;
}
#taha-search {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 36px 8px 40px;
  font-size: 14px; color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#taha-search:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,.1);
}
#taha-search::placeholder { color: var(--muted); }

.search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.clear-btn {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: none;
  align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  transition: background .15s;
}
.clear-btn.visible { display: flex; }
.clear-btn:hover { background: #eee; color: var(--text); }

/* ─── KEYWORDS BAR ───────────────────────────── */
#taha-keywords {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 18px 7px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: var(--header-h); z-index: 99;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
#taha-keywords::-webkit-scrollbar { display: none; }
.kw-label {
  font-size: 10px; font-weight: 700; color: #ccc;
  flex-shrink: 0; letter-spacing: .8px; text-transform: uppercase;
  margin-right: 3px; white-space: nowrap;
}
.kw-chip {
  flex-shrink: 0;
  background: #fff; border: 1.5px solid #e8e8e8;
  border-radius: 999px; padding: 5px 13px;
  font-size: 12px; font-weight: 600; color: #555;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
  line-height: 1;
}
.kw-chip:hover {
  background: var(--red); border-color: var(--red);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230,57,70,.22);
}
.kw-chip.kw-active {
  background: var(--red); border-color: var(--red);
  color: #fff; box-shadow: 0 2px 8px rgba(230,57,70,.25);
}

/* ─── GRID ───────────────────────────────────── */
#taha-grid {
  position: relative;
  min-height: 200px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* ─── CARD ───────────────────────────────────── */
.t-card {
  position: absolute;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  -webkit-box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  -webkit-transition: -webkit-transform .22s, box-shadow .22s, opacity .3s;
  transition: transform .22s, box-shadow .22s, opacity .3s;
  will-change: transform;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.t-card:hover {
  -webkit-transform: translateY(-4px);
  transform: translateY(-4px);
  -webkit-box-shadow: 0 10px 28px rgba(230,57,70,.14);
  box-shadow: 0 10px 28px rgba(230,57,70,.14);
}
.t-card.taha-hiding {
  opacity: 0;
  -webkit-transform: scale(.9);
  transform: scale(.9);
  pointer-events: none;
}
.t-card img {
  width: 100%; display: block;
  object-fit: cover; background: #f0f0f0;
}
.t-card-body { padding: 8px 10px 10px; min-height: 46px; }
.t-card-title {
  font-family: 'Sofia Sans Condensed', sans-serif;
  font-size: 15px; font-weight: 800; color: #333;
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-card-price {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px; font-weight: 800; color: #818589;
  margin-top: 2px;
}

/* ─── HIDE BUTTON ────────────────────────────── */
.taha-hide-btn {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  background: rgba(0,0,0,0.48); border: none; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s, background .15s;
  backdrop-filter: blur(6px); z-index: 3;
}
.t-card:hover .taha-hide-btn { opacity: 1; }
.taha-hide-btn:hover { background: rgba(0,0,0,0.72); }
.taha-hide-btn svg {
  width: 14px; height: 14px;
  stroke: #fff; stroke-width: 2.3;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* ─── LOADER / EMPTY / HIDDEN BAR ────────────── */
#taha-loader {
  text-align: center; padding: 26px;
  color: var(--muted); font-size: 14px; display: none;
}
.t-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid #ddd; border-top-color: var(--red);
  border-radius: 50%;
  animation: taha-spin .7s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
@keyframes taha-spin { to { transform: rotate(360deg); } }

#taha-empty {
  text-align: center; padding: 60px 20px;
  color: var(--muted); display: none;
}

#taha-hidden-bar {
  display: none; text-align: center;
  padding: 11px 16px; font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border); background: var(--bg);
}
#taha-hidden-bar button {
  background: none; border: none;
  color: var(--red); font-size: 12px;
  cursor: pointer; text-decoration: underline; margin-left: 5px;
}

/* ─── TOAST ──────────────────────────────────── */
#taha-toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 500;
  background: rgba(20,20,20,.82); color: #fff;
  border-radius: 999px; padding: 7px 16px;
  font-size: 11.5px;
  opacity: 0; transition: opacity .3s;
  pointer-events: none; backdrop-filter: blur(8px);
}
#taha-toast.show { opacity: 1; }

/* ─── FOOTER ─────────────────────────────────── */
#taha-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px; margin-top: 40px;
  display: flex; align-items: center; justify-content: center;
  gap: 20px; font-size: 12px; color: var(--muted);
}
#taha-footer a { color: var(--red); text-decoration: none; }
#taha-footer a:hover { text-decoration: underline; }

/* ─── STATIC PAGES ───────────────────────────── */
.static-page {
  max-width: 800px; margin: 30px auto;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.static-page h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 26px; color: var(--text); margin-bottom: 20px;
}
.static-page h2 {
  font-size: 18px; font-weight: 700; margin: 20px 0 8px;
}
.static-page p { font-size: 15px; line-height: 1.7; color: #444; margin-bottom: 10px; }

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 600px) {
  #taha-header { padding: 0 12px; gap: 10px; }
  .logo-text { font-size: 18px; }
  #taha-keywords { padding: 5px 10px 6px; gap: 5px; }
  .kw-chip { font-size: 11px; padding: 4px 11px; }
  .static-page { margin: 12px; padding: 20px 16px; }
}
