/* ==========================================================================
   SHD Invite — components.css
   البحث، التصنيفات، البطاقات، المفضلة، شريط التنقل، القوائم
   ========================================================================== */

/* ---------- شريط البحث ---------- */
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  margin: 28px auto 0;
  max-width: 760px;
  padding-inline: 20px;
  border-radius: 999px;
  border: 1.5px solid #d9b5a9;
  background: linear-gradient(180deg, rgba(255, 247, 242, .92), rgba(251, 238, 230, .88));
  box-shadow: 0 8px 22px rgba(150, 90, 80, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.search__icon { font-size: 26px; color: var(--wine); }
.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  text-align: right;
}
.search__input::placeholder { color: var(--wine-soft); opacity: 1; }
.search__input::-webkit-search-cancel-button { display: none; }
.search:focus-within { border-color: var(--wine); }

/* ---------- التصنيفات ---------- */
.chips {
  display: flex;
  gap: 10px;
  margin: 18px auto 0;
  max-width: 760px;
}
.chip {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding-inline: 8px;
  border-radius: 999px;
  border: 1px solid #dcb7ab;
  background: linear-gradient(180deg, rgba(255, 247, 242, .78), rgba(251, 238, 230, .7));
  color: var(--ink);
  font-size: 15px;
  font-weight: 300;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(150, 90, 80, .07);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.chip.is-active {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--surface);
  font-weight: 700;
}

/* ---------- شبكة القوالب ---------- */
.catalog { position: relative; z-index: 2; margin-top: 26px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 249, 245, .93), rgba(251, 238, 230, .9));
  box-shadow: 0 12px 26px rgba(150, 90, 80, .12), inset 0 1px 0 #fff;
}
.card__media {
  aspect-ratio: 1200 / 992;
  border-radius: var(--radius-img);
  overflow: hidden;
  background: #efd3c8;
  border: 1px solid rgba(223, 188, 175, .8);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 4px 0;
  text-align: center;
}
.card__name {
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--ink);
}
.card__name-en {
  margin-top: 2px;
  direction: ltr;
  font-size: .86rem;
  font-weight: 300;
  color: var(--wine-soft);
}
.card__desc {
  margin-top: 6px;
  font-size: .92rem;
  color: var(--wine-soft);
}

/* السعر */
.card__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 10px;
  margin-top: auto;
  padding-top: 12px;
}
.price-old {
  font-size: .9rem;
  color: var(--wine-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.price-new {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.price-new small { font-size: .62em; font-weight: 700; margin-inline-start: 4px; }

/* زر المفضلة */
.fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--wine);
  background: var(--wine);
  color: var(--surface);
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 6px 14px rgba(120, 41, 52, .18);
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
}
.fav-btn .icon { font-size: 20px; transition: transform .3s var(--ease); }
.fav-btn:active { transform: scale(.98); }
.fav-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--wine);
  box-shadow: none;
}
.fav-btn[aria-pressed="true"] .icon { fill: currentColor; transform: scale(1.1); }

/* بطاقة التصميم الخاص */
.card--custom { transition: transform .2s var(--ease); }
.card--custom:active { transform: scale(.99); }
.card--custom .card__media {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f3dcd4, #efd2c8);
}
.card--custom .card__media img {
  width: 74%; height: 74%;
  object-fit: contain;
}
.card--custom .card__body { text-align: center; }
.card--custom .card__name { font-family: var(--font-accent); font-weight: 400; font-size: 1.3rem; }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}
.card__foot .price-new { font-size: 1.5rem; }
.card__go {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--wine);
  color: var(--wine);
  font-size: 22px;
}

/* ---------- رسائل المحتوى غير المتاح ---------- */
.notice {
  max-width: 520px;
  margin: 8px auto 0;
  padding: 34px 24px;
  text-align: center;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 249, 245, .93), rgba(251, 238, 230, .9));
  box-shadow: 0 12px 26px rgba(150, 90, 80, .10), inset 0 1px 0 #fff;
}
.notice__title { font-family: var(--font-accent); font-size: 1.7rem; color: var(--wine); line-height: 1.4; }
.notice__text { margin-top: 6px; font-size: 1rem; color: var(--ink); }

.end-note {
  margin: 30px auto 0;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 460px;
  color: var(--wine);
  font-size: .95rem;
  text-align: center;
}
.end-note::before, .end-note::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ---------- شريط التنقل السفلي ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #fbefe7 0%, #f6e1d5 100%);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(223, 188, 175, .8);
  box-shadow: 0 -10px 30px rgba(150, 90, 80, .16);
}
.bottom-nav__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
  max-width: 520px;
  margin-inline: auto;
  align-items: center;
}
.bottom-nav__list > li { height: 100%; }
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  width: 100%;
  color: var(--ink);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.2;
}
.nav-item .icon { font-size: 30px; stroke-width: 1.6; }
.nav-item.is-active { color: var(--wine); font-weight: 700; }
.nav-item.is-active .icon { stroke-width: 2; }

/* زر الرئيسية: دائرة بارزة كما في المرجع */
.nav-item--home { overflow: visible; }
.nav-item--home .nav-item__bubble {
  position: absolute;
  top: -30px;
  left: 50%;
  translate: -50% 0;
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  background: var(--blush);
  border: 1px solid rgba(223, 188, 175, .9);
  box-shadow: 0 0 0 7px rgba(251, 239, 231, .95), 0 8px 20px rgba(150, 90, 80, .2);
  color: var(--wine);
  font-weight: 700;
  font-size: 12.5px;
}
.nav-item--home .icon { font-size: 30px; }

/* ---------- قائمة الحسابات ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(83, 18, 32, .28);
  opacity: 0; transition: opacity .25s var(--ease);
}
.overlay.is-open { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 32px), 420px);
  padding: 18px 16px 12px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff8f3, #fbefe7);
  box-shadow: 0 24px 50px rgba(83, 18, 32, .25);
  translate: -50% 18px;
  opacity: 0;
  transition: opacity .25s var(--ease), translate .3s var(--ease);
}
.sheet.is-open { opacity: 1; translate: -50% 0; }
.sheet__title { text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--wine); margin-bottom: 8px; }
.social-list { display: grid; }
.social-link {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 13px 8px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: right;
}
.social-list li:first-child .social-link { border-top: 0; }
.social-link .icon { font-size: 28px; color: var(--wine); }
.social-link__arrow { margin-inline-start: auto; font-size: 20px !important; opacity: .7; }

/* ---------- القائمة الجانبية ---------- */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 70;
  width: min(80vw, 320px);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 24px;
  background: linear-gradient(180deg, #fff8f3, #f8e5d9);
  border-radius: 0 28px 28px 0;
  box-shadow: 18px 0 50px rgba(83, 18, 32, .25);
  translate: -105% 0;
  transition: translate .32s var(--ease);
}
.drawer.is-open { translate: 0 0; }
.drawer__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer__top img { width: 96px; }
.drawer__close { width: 44px; height: 44px; display: grid; place-items: center; font-size: 26px; color: var(--wine); }
.drawer__link {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 15px 6px;
  border-top: 1px solid var(--line-soft);
  font-size: 1.1rem; font-weight: 700; color: var(--ink);
  text-align: right;
}
.drawer__link .icon { font-size: 26px; color: var(--wine); }

/* ---------- تنبيه مؤقت ---------- */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  translate: -50% 12px;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--wine);
  color: var(--surface);
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.toast.is-show { opacity: 1; translate: -50% 0; }

/* ---------- بتلات الورد المتساقطة ---------- */
.petals {
  position: fixed; inset: 0;
  z-index: 1;                 /* فوق الخلفية وخلف المحتوى */
  pointer-events: none;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  animation: petal-fall var(--dur, 18s) linear var(--delay, 0s) infinite;
}
.petal__inner {
  display: block;
  width: 100%;
  animation: petal-sway var(--sway-dur, 5s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
.petal__inner img { width: 100%; height: auto; opacity: .88; }

@keyframes petal-fall {
  from { transform: translate3d(var(--x, 50vw), -12vh, 0); }
  to   { transform: translate3d(calc(var(--x, 50vw) + var(--drift, 6vw)), 112vh, 0); }
}
@keyframes petal-sway {
  from { transform: translateX(calc(var(--sway, 24px) * -1)) rotate(calc(var(--rot, 40deg) * -1)); }
  to   { transform: translateX(var(--sway, 24px)) rotate(var(--rot, 40deg)); }
}

/* ---------- صفحات إضافية (المفضلة / التصميم الخاص) ---------- */
.page-head { position: relative; z-index: 2; padding-top: 14px; text-align: center; }
.page-head__title {
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3.4rem);
  color: var(--wine);
  line-height: 1.2;
}
.page-head__text { margin-top: 10px; font-size: 1rem; color: var(--ink); }
.page-hero-short { --hero-h: clamp(380px, 110vw, 520px); }

/* ---------- الشاشات الأكبر ---------- */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .card { padding: 12px 12px 14px; }
  .search { height: 62px; }
  .search__input { font-size: 17px; }
  .chip { height: 48px; font-size: 16px; }
  .site-header { height: 84px; }
  .site-header__logo img { width: 128px; }
  .nav-item { font-size: 14px; }
  .bottom-nav {
    left: 50%; right: auto;
    width: min(560px, calc(100% - 32px));
    translate: -50% 0;
    bottom: 14px;
    border-radius: 30px;
    border: 1px solid rgba(223, 188, 175, .8);
  }
  .bottom-nav { padding-bottom: 0; }
  .sheet, .toast { bottom: calc(var(--nav-h) + 40px); }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petals { display: none; }
  * { transition-duration: .01ms !important; }
}
