/* =========================================================
   EXTRAS — search & sort, recently viewed, price estimator,
   seasonal themes
   ========================================================= */

/* ---------- SEARCH + SORT TOOLBAR ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  max-width: 1320px; margin: 0 auto 28px;
}
.search {
  flex: 1 1 280px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 48px;
  border: 1px solid rgba(42, 33, 25, 0.18); border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-ink-dim);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.search:focus-within { border-color: var(--gold-dk); background: #fff; box-shadow: 0 6px 24px -14px rgba(42, 33, 25, 0.5); }
.search svg { flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  font: inherit; font-size: 0.98rem; color: var(--text-ink);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: rgba(110, 95, 75, 0.7); }
.search__clear { width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; color: var(--text-ink-dim); }
.search__clear:hover { background: rgba(42, 33, 25, 0.08); }
.toolbar__count { font-family: var(--f-display); font-style: italic; font-size: 1.1rem; color: var(--text-ink-dim); }
.sort { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-ink-dim); }
:lang(ar) .sort { letter-spacing: 0; font-size: 0.9rem; }
.sort select {
  height: 44px; padding: 0 36px 0 16px;
  border: 1px solid rgba(42, 33, 25, 0.18); border-radius: 999px;
  background: rgba(255, 255, 255, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238c6a2c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: inherit; font-size: 0.92rem; letter-spacing: 0; text-transform: none; color: var(--text-ink);
  appearance: none; cursor: pointer;
}
[dir="rtl"] .sort select { padding: 0 16px 0 36px; background-position: left 14px center; }
.sort select:focus { outline: none; border-color: var(--gold-dk); }

.grid__empty {
  grid-column: 1 / -1; text-align: center;
  padding: 60px 20px;
  font-family: var(--f-display); font-style: italic; font-size: 1.4rem; color: var(--text-ink-dim);
}
.grid__empty .pill { margin-top: 12px; font-family: var(--f-body); font-style: normal; font-size: 0.85rem; }

/* ---------- RECENTLY VIEWED ---------- */
.recent { max-width: 1320px; margin: clamp(50px, 7vw, 80px) auto 0; padding-top: 30px; border-top: 1px solid rgba(42, 33, 25, 0.14); }
.recent[hidden] { display: none; }
.recent__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.recent__head h3 { font-size: 1.8rem; }
.recent__head .text-btn { color: var(--gold-dk); }
.recent__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 14px;
  overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dk) transparent;
}
.recent__item { text-align: center; animation: cardIn 0.5s var(--ease) both; }
.recent__art {
  position: relative; display: block; aspect-ratio: 1;
  border-radius: 64px 64px 6px 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #3b2e20, #15110c 78%);
  padding: 10%;
  transition: transform 0.5s var(--ease);
}
.recent__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recent__item:hover .recent__art { transform: translateY(-4px); }
.recent__name { display: block; margin-top: 8px; font-family: var(--f-display); font-size: 1rem; line-height: 1.2; color: var(--text-ink); }

/* ---------- PRICE ESTIMATOR ---------- */
.modal__links { display: flex; flex-wrap: wrap; gap: 18px; margin: 0.4rem 0 0.8rem; }
.est { padding: clamp(28px, 5vw, 52px); }
.est__product {
  display: flex; align-items: center; gap: 16px;
  margin: 1.2rem 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
}
.est__art { position: relative; width: 64px; height: 64px; flex: none; border-radius: 32px 32px 4px 4px; overflow: hidden; background: radial-gradient(circle, #3a2d1f, #14100b); padding: 6px; }
.est__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.est__product .card__cat { margin: 0; }
.est__pname { font-family: var(--f-display); font-size: 1.35rem; margin: 0; line-height: 1.2; }
.est__form { display: grid; gap: 18px; margin: 1.6rem 0; }
.est__field { display: grid; gap: 8px; }
.est__field[hidden] { display: none; }
.est__label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
:lang(ar) .est__label { letter-spacing: 0; font-size: 0.9rem; }
.est__result { margin-bottom: 20px; }
.est__total {
  padding: 18px 20px; border-radius: 12px;
  background: linear-gradient(120deg, rgba(201, 164, 92, 0.2), rgba(201, 164, 92, 0.05));
  border: 1px solid var(--gold);
  animation: cardIn 0.5s var(--ease);
}
.est__big { font-family: var(--f-display); font-size: clamp(2.2rem, 6vw, 3rem); color: var(--gold-lt); margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.est__rows { margin: 14px 0 6px; }
.est__rows dt { font-size: 0.88rem; }
.est__src { font-size: 0.8rem; color: var(--gold); margin: 8px 0 4px; }
.est__note { font-size: 0.82rem; margin: 0; }

/* ---------- SEASONAL THEMES ---------- */
.season-pill {
  display: inline-flex; flex-wrap: nowrap; max-width: 100%; text-align: start; align-items: center; gap: 10px;
  margin-bottom: 1.6rem;
  padding: 7px 8px 7px 14px; border-radius: 999px;
  background: rgba(201, 164, 92, 0.12);
  border: 1px solid rgba(201, 164, 92, 0.45);
  font-size: 0.88rem;
  animation: cardIn 0.9s 0.6s var(--ease) both;
}
[dir="rtl"] .season-pill { padding: 7px 14px 7px 8px; }
.season-pill[hidden] { display: none; }
.season-pill__ico { color: var(--gold-lt); font-size: 1rem; }
.season-pill__msg { color: var(--text); flex: 0 1 auto; min-width: 0; line-height: 1.35; }
.season-pill__cta, .season-pill__x, .season-pill__ico { flex: none; }
.season-pill__cta {
  padding: 5px 12px; border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font-size: 0.78rem; font-weight: 500;
  transition: background 0.3s;
}
.season-pill__cta:hover { background: var(--gold-lt); }
.season-pill__cta i { font-style: normal; display: inline-block; transition: transform 0.3s; }
[dir="rtl"] .season-pill__cta i { transform: scaleX(-1); }
.season-pill__x { width: 24px; height: 24px; border-radius: 50%; color: var(--text-dim); font-size: 1rem; line-height: 1; }
.season-pill__x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.season-deco { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }

/* hanging lanterns (Ramadan / Eid) */
.lantern {
  position: absolute; top: 0; inset-inline-end: var(--x);
  width: calc(64px * var(--s));
  padding-top: var(--len);
  transform-origin: top center;
  animation: swing 5s ease-in-out infinite; animation-delay: var(--delay);
}
.lantern::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: var(--len); background: linear-gradient(rgba(201, 164, 92, 0), #c9a45c); }
.lantern svg { width: 100%; }

@keyframes swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.82; } 50% { opacity: 0.95; } 70% { opacity: 0.86; } }
.crescent {
  position: absolute; top: 150px; inset-inline-end: 36%;
  width: 54px; opacity: 0.85;
}
[dir="rtl"] .crescent { transform: scaleX(-1); }

/* floating particles (hearts, flowers, petals, stars) */
.floater {
  position: absolute; left: var(--x);
  width: calc(22px * var(--s)); height: calc(22px * var(--s));
  opacity: 0;
}
.floater svg { width: 100%; height: 100%; }
.floater--rise { bottom: -40px; animation: rise var(--d) linear infinite; animation-delay: var(--delay); }
.floater--fall { top: -40px; animation: fall var(--d) linear infinite; animation-delay: var(--delay); }
.floater--twinkle { top: calc(var(--x) * 0.6 + 8%); animation: twinkle calc(var(--d) / 4) ease-in-out infinite; animation-delay: var(--delay); color: #fff5d6; width: calc(12px * var(--s)); height: calc(12px * var(--s)); }
.floater--rose { color: rgba(232, 110, 140, 0.75); }
.floater--blush { color: rgba(245, 180, 195, 0.7); }
.floater--petal { color: rgba(240, 200, 190, 0.6); }
@keyframes rise {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.6; }
  100% { transform: translate(var(--drift), -110vh) rotate(25deg); opacity: 0; }
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: 0.85; }
  90% { opacity: 0.6; }
  100% { transform: translate(var(--drift), 110vh) rotate(320deg); opacity: 0; }
}

/* subtle seasonal accents */
body[data-season="valentine"] .hero,
body[data-season="mothers"] .hero {
  background:
    radial-gradient(ellipse 70% 60% at 72% 50%, rgba(232, 130, 160, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 50% at 10% 100%, rgba(120, 40, 60, 0.25), transparent 70%),
    var(--ink);
}
body[data-season="ramadan"] .hero,
body[data-season="eid"] .hero {
  background:
    radial-gradient(ellipse 70% 60% at 72% 50%, rgba(201, 164, 92, 0.2), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(40, 60, 110, 0.35), transparent 70%),
    var(--ink);
}

@media (max-width: 820px) {
  .lantern:nth-child(-n + 2) { display: none; }
  .lantern { --len: 96px !important; width: 40px; }
  .crescent { width: 40px; top: 112px; inset-inline-end: auto; inset-inline-start: 6%; }
  .season-pill { justify-content: center; }
}
@media (max-width: 560px) {
  .toolbar { gap: 10px; }
  .search { flex-basis: 100%; }
  .toolbar__count { flex: 1; }
  .sort > span { display: none; }
  .season-pill { font-size: 0.8rem; }
}
