:root {
  --bg: #060509;
  --bg-elevated: #0c0b10;
  --card: #0f0e14;
  --card-soft: #13121a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(240, 185, 30, 0.45);
  --text: #f8f8f8;
  --muted: #9a99a8;
  --accent: #C8890E;
  --accent-strong: #F2C440;
  --accent-soft: rgba(240, 185, 30, 0.14);
  --shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tajawal", sans-serif;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(240, 185, 30, 0.22), transparent 60%),
    linear-gradient(180deg, #0a0910 0%, #060509 100%);
  color: var(--text);
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0 8px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #12101a 0%, #0d0c14 100%);
  border: 1px solid rgba(240, 185, 30, 0.22);
  box-shadow:
    0 0 0 1px rgba(240, 185, 30, 0.07),
    0 6px 28px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(240, 185, 30, 0.08);
  position: relative;
  /* Allow logo to visually overflow without changing header layout */
  overflow: visible;
}

.header-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 80px;
  background: radial-gradient(
    ellipse,
    rgba(240, 185, 30, 0.12),
    transparent 70%
  );
  pointer-events: none;
}

.logo-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: contain;
  flex-shrink: 0;
  filter:
    /* Dark base halo to create contrast */
    drop-shadow(0 8px 20px rgba(8, 6, 12, 0.9))
    /* Subtle purple rim for a polished accent */
    drop-shadow(0 0 12px rgba(120, 50, 180, 0.14));
  /* Visual scale: increases apparent logo size without changing layout box */
  transform: scale(1.15);
  transform-origin: center center;
  z-index: 6;
}

.logo-img-sm {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.filters-section {
  padding: 8px 0 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
}

.logo-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(200, 155, 50, 0.32);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-logo {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  background: linear-gradient(135deg, #F8D878 0%, #F2C440 40%, #C8890E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-tagline {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(240, 185, 30, 0.55);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.filters-section {
  padding: 8px 0 14px;
}

.filters {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
  background: rgba(240, 185, 30, 0.05);
  border-radius: 14px;
  border: 1px solid rgba(240, 185, 30, 0.12);
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 1;
  min-width: fit-content;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  min-height: 36px;
  padding: 0 20px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.filter-chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active {
  color: #0a0810;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 2px 14px rgba(240, 185, 30, 0.5);
}

.products-section {
  padding-top: 4px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-accent-bar {
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  flex-shrink: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.products-count-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* ── Search Toggle Button ── */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(240, 185, 30, 0.08);
  border: 1px solid rgba(240, 185, 30, 0.25);
  color: var(--accent-strong);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.search-toggle:hover {
  background: rgba(240, 185, 30, 0.18);
  border-color: rgba(240, 185, 30, 0.5);
  box-shadow: 0 0 14px rgba(240, 185, 30, 0.15);
}

/* ── Search Overlay ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}
.search-overlay[hidden] { display: none; }

.search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 8, 0.85);
  backdrop-filter: blur(8px);
}

.search-panel {
  position: relative;
  width: min(92%, 480px);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, #141220 0%, #0e0d16 100%);
  border: 1px solid rgba(240, 185, 30, 0.2);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(240, 185, 30, 0.08);
  overflow: hidden;
  animation: searchSlideIn 0.22s ease-out;
}

@keyframes searchSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(240, 185, 30, 0.12);
}

.search-input-icon {
  flex-shrink: 0;
  color: var(--accent-strong);
  opacity: 0.7;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  caret-color: var(--accent-strong);
}
.search-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}
.search-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ── Search Results ── */
.search-results {
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 185, 30, 0.2) transparent;
}

.search-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.search-result-item:hover {
  background: rgba(240, 185, 30, 0.08);
}

.search-result-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(240, 185, 30, 0.1);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-name mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 800;
}

.search-result-price {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.search-result-snippet {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-snippet mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 700;
}

.search-result-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F2C440, #C8890E);
  color: #0a0810;
  margin-right: 6px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  background: linear-gradient(
    180deg,
    rgba(15, 14, 20, 0.98),
    rgba(11, 10, 16, 0.98)
  );
  border: 1px solid rgba(240, 185, 30, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 185, 30, 0.45);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(240, 185, 30, 0.18),
    0 0 20px rgba(240, 185, 30, 0.06);
}

.image-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at top, rgba(240, 185, 30, 0.14), transparent 45%),
    linear-gradient(180deg, #131118 0%, #0c0b12 100%);
}

.product-link,
.product-title-link {
  display: block;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F2C440, #C8890E);
  border: 1px solid rgba(242, 196, 64, 0.9);
  color: #0a0810;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  margin: 0 0 4px;
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 700;
}

.product-summary {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.product-price {
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 800;
}

.product-prices {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.product-old-price {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: line-through;
}

.product-code {
  color: var(--muted);
  font-size: 0.82rem;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #0a0810;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow:
    0 8px 22px rgba(240, 185, 30, 0.35),
    0 0 0 1px rgba(240, 185, 30, 0.2);
  border: 0;
  cursor: pointer;
}

.details-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(240, 185, 30, 0.1);
  border: 1px solid rgba(240, 185, 30, 0.35);
  color: var(--accent-strong);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.details-icon:hover {
  background: rgba(240, 185, 30, 0.2);
  border-color: rgba(240, 185, 30, 0.65);
  box-shadow: 0 0 12px rgba(240, 185, 30, 0.2);
}

.platform-picker[hidden] {
  display: none;
}

.platform-picker {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.picker-sheet {
  position: relative;
  padding: 18px;
  width: min(420px, calc(100vw - 32px));
  border-radius: 24px;
  background: linear-gradient(180deg, #151515 0%, #101010 100%);
  border: 1px solid rgba(200, 155, 50, 0.3);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.52);
}

.picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.picker-eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.picker-head h3 {
  margin: 0;
  font-size: 1.04rem;
}

.picker-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.picker-message {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.picker-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.picker-action.whatsapp {
  background: linear-gradient(180deg, #25d366, #128c7e);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.18);
}

.picker-action.telegram {
  background: linear-gradient(180deg, #2ca5e0, #1a8bbf);
  color: #fff;
  box-shadow: 0 10px 24px rgba(44, 165, 224, 0.28);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.product-card.is-hidden {
  display: none;
}

.detail-body {
  min-height: 100vh;
}

.detail-shell {
  padding-bottom: 120px;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0 8px;
  margin-bottom: 10px;
}

.detail-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #12101a 0%, #0d0c14 100%);
  border: 1px solid rgba(240, 185, 30, 0.22);
  box-shadow:
    0 0 0 1px rgba(240, 185, 30, 0.07),
    0 6px 28px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(240, 185, 30, 0.08);
  position: relative;
  overflow: visible;
}

.detail-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
}

.logo-icon-sm {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(200, 155, 50, 0.3);
}

.header-spacer {
  width: 38px;
  flex-shrink: 0;
}

.detail-main {
  display: grid;
  gap: 18px;
}

.plain-product-page {
  display: grid;
  gap: 14px;
}

.plain-info-card,
.plain-section-card,
.detail-empty {
  border-radius: 24px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.plain-image-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.plain-badge,
.plain-code,
.plain-store-name {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.plain-badge {
  background: rgba(200, 155, 50, 0.14);
  border: 1px solid rgba(200, 155, 50, 0.28);
}

.plain-code {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.plain-product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

.plain-image-wrap {
  position: relative;
}

.plain-image-wrap .plain-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.plain-info-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.plain-store-name {
  display: none;
}

.plain-product-title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.15;
}

.plain-product-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.plain-price-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(200, 155, 50, 0.08);
  border: 1px solid rgba(200, 155, 50, 0.18);
  flex-wrap: wrap;
}

.plain-old-price {
  color: var(--muted);
  font-size: 1.1rem;
  text-decoration: line-through;
}

.plain-price-value {
  font-size: 1.4rem;
  font-weight: 800;
}

.plain-discount-badge {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.plain-actions {
  display: grid;
  gap: 10px;
}

.detail-order-button {
  min-height: 54px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
}

.plain-section-card {
  padding: 18px;
}

.plain-section-head {
  margin-bottom: 12px;
}

.plain-section-head h2 {
  margin: 0;
  font-size: 1.06rem;
}

.plain-section-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.plain-spec-list {
  display: grid;
  gap: 10px;
}

.spec-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.spec-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.spec-value {
  font-size: 0.96rem;
  line-height: 1.65;
}

.detail-empty {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(19, 19, 19, 0.98),
    rgba(16, 16, 16, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-empty h1,
.detail-empty p {
  margin: 0;
}

.empty-link {
  margin-top: 4px;
}

@media (min-width: 700px) {
  .page-shell {
    padding-inline: 20px;
  }

  .site-header {
    padding-top: 22px;
  }

  .header-inner {
    padding: 12px 20px 10px;
    border-radius: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .plain-product-page {
    gap: 18px;
  }

  .plain-info-card {
    grid-row: auto;
  }

  .plain-actions {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}

@media (min-width: 1040px) {
  .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
