@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");

[hidden] {
  display: none !important;
}

:root {
  --bg: #f6f1eb;
  --surface: #fffdfb;
  --text: #2a1f18;
  --muted: #7a695b;
  --line: #eadfce;
  --brand: #b05024;
  --brand-strong: #833a17;
  --accent: #bf2f42;
  --panel-shadow: 0 14px 30px rgba(74, 41, 21, 0.1);
  --card-shadow: 0 10px 22px rgba(77, 46, 24, 0.11);
  --radius-lg: 18px;
  --beige: #a3753562;
  --honey: #fffefd;
  --gold: #c89a2a;
  --gold-r: rgb(255, 183, 1);
  --active-green: #6f9b63;
}

* {
  box-sizing: border-box;
}

.page-wrap {
  padding: 8px 0 40px;
}

.browse-sticky {
  position: sticky;
  top: var(--search-h, 0px);
  z-index: 40;
  background: rgba(255, 253, 250, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 10px 0 12px;
  margin: 0 0 8px;
  transition: box-shadow 0.2s ease, top 0.22s ease;
}

.browse-sticky.is-stuck {
  box-shadow: 0 10px 20px rgba(74, 41, 21, 0.08);
  border-bottom: 1px solid var(--line);
}

.error-box {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fbeced;
  color: var(--accent);
  border: 1px solid rgba(191, 47, 66, 0.25);
  font-weight: 700;
  font-size: 14px;
}


.category-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 4px;
  background: var(--surface);
  box-shadow: 0 10px 18px rgba(65, 38, 20, 0.08);
  scroll-snap-type: x proximity;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tabs .tab-chip {
  min-width: max-content;
  max-width: none;
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid #e3d6c8;
  background: #fffdfb;
  padding: 6px 14px 6px 8px;
  color: #4e4036;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.category-tabs .chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #eadccc;
  flex: 0 0 34px;
}

.category-tabs .chip-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.category-tabs .tab-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(74, 41, 21, 0.1);
  border-color: #d5bca3;
}

.category-tabs .tab-chip.active {
  background: #fff4ea;
  border-color: var(--brand);
  color: var(--brand-strong);
}

.category-tabs .tab-all {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-color: transparent;
  color: #fff;
}

.category-tabs .tab-all .all-icon {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.category-tabs .tab-all.active {
  box-shadow: 0 8px 16px rgba(131, 58, 23, 0.28);
  color: #fff;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 0;
  flex-wrap: nowrap;
}

.filters-left {
  flex: 0 0 auto;
}

.filters select,
#sortBy {
  flex: 0 0 auto;
  width: auto;
  min-width: unset;
  max-width: 85px;
  height: 42px;
  border: 1px solid #e3d6c8;
  border-radius: 999px;
  padding: 6px 12px 6px 26px;
  background: #fffdfb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a695b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 8px center;
  background-size: 11px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #4e4036;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(65, 38, 20, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.filters select:hover,
#sortBy:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(74, 41, 21, 0.08);
}

.filters select:focus,
#sortBy:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(176, 80, 36, 0.15);
}

.ads-banner {
  margin-bottom: 16px;
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fff9f2 0%, #f8e4d5 100%);
  border: 1px solid rgba(234, 213, 195, 0.9);
  box-shadow: 0 8px 24px rgba(215, 176, 145, 0.14);
}

.ad-card {
  border: 1px solid rgba(225, 211, 197, 0.9);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
}

.ad-card a {
  display: block;
}

.ad-card img,
.ad-card video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.products-skeleton .skeleton-card {
  border-radius: 18px;
  min-height: 348px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 60%) #efe4d7;
  background-size: 200% 100%;
  animation: skeletonShift 1.1s linear infinite;
  border: 1px solid #e6d9ca;
}

@keyframes skeletonShift {
  to {
    background-position: -200% 0;
  }
}

.product-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(120, 53, 15, 0.35);
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(74, 41, 21, 0.14);
}

.product-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.product-card .box {
  padding: 13px;
}

.product-card .cat {
  font-size: 12px;
  color: var(--muted);
}

.product-card h3 {
  margin: 6px 0;
  font-size: 15px;
  min-height: 42px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .desc {
  margin: 0 0 6px;
  color: #6e6258;
  font-size: 12px;
  min-height: 34px;
}

.product-card .rating {
  font-size: 12px;
  color: #d1972d;
}

.price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.product-card .price {
  color: var(--brand-strong);
  font-weight: 800;
}

.product-card .old-price {
  color: #9b8f84;
  text-decoration: line-through;
  font-size: 12px;
}

.discount-badge {
  background: linear-gradient(135deg, var(--accent), #991f31);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
}

.product-card button {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.product-card button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.empty-state {
  text-align: center;
  padding: 50px 0;
}

.empty-state p {
  color: var(--muted);
  font-size: 18px;
}

.empty-state a {
  color: var(--brand-strong);
  text-decoration: none;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fffaf4;
  margin-top: 22px;
}

.footer-wrap {
  padding: 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer h4 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 22px;
}

.site-footer p {
  margin: 6px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  text-decoration: none;
  color: #5d4d44;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .browse-sticky {
    top: var(--search-h, 0px);
  }
}

@media (max-width: 768px) {
  .browse-sticky {
    top: var(--search-h, 0px);
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card img {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .category-tabs .tab-chip {
    min-width: 118px;
    max-width: 140px;
    height: 44px;
    padding: 5px 8px;
  }

  .category-tabs .chip-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .category-tabs .chip-label {
    font-size: 11px;
  }
}

.category-tabs .tab-card-with-sub {
  min-width: 150px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e3d6c8;
  background: #fffdfb;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  align-self: flex-start;
  height: auto;
}

.category-tabs .tab-card-with-sub:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(74, 41, 21, 0.1);
  border-color: #d5bca3;
}

.category-tabs .tab-card-with-sub.active {
  background: #fff4ea;
  border-color: var(--brand);
}

.tab-parent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.subchips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-right: 42px;
}

.filter-subchips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(65, 38, 20, 0.06);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  white-space: nowrap;
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 56px;
}

.filter-subchips .sub-chip {
  padding: 5px 12px;
  font-size: 12px;
}

.filter-subchips .tab-chip,
.filter-subchips .child-chip {
  min-width: max-content;
  max-width: none;
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid #e3d6c8;
  background: #fffdfb;
  padding: 6px 14px 6px 8px;
  color: #4e4036;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
}

.filter-subchips .tab-chip .chip-icon,
.filter-subchips .child-chip .chip-icon,
.filter-subchips img.chip-icon,
.filter-subchips img {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: cover !important;
  border-radius: 999px !important;
  display: inline-block !important;
}

.filter-subchips .tab-chip .chip-label,
.filter-subchips .child-chip .chip-label {
  font-size: 12px;
  font-weight: 700;
  color: #4c2f21;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.filter-subchips .tab-chip.child-active,
.filter-subchips .child-chip.child-active {
  background: #fff4ea;
  border-color: var(--brand);
  color: var(--brand-strong);
}

.filters .filter-left {
  flex: 0 0 auto;
}

.sub-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #e3d6c8;
  background: #fff9f2;
  font-size: 11px;
  font-weight: 700;
  color: #5d4d44;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.sub-chip:hover {
  background: #fff4ea;
  border-color: var(--brand);
  color: var(--brand-strong);
}

.sub-chip.child-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}