* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #0f1a24;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===== HEADER (STICKY) ===== */
.top {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f1a24;
  border-bottom: 1px solid #2a3a48;
}

.sado-ai-btn {
  color: #4a9eff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e2c38;
  padding: 10px 16px;
  border-radius: 30px;
  border: 1px solid #2a3a48;
}

.search input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
}

.search input::placeholder {
  color: #6f8a9c;
}

.person {
  color: #4a9eff;
  cursor: pointer;
  background: #1e2c38;
  padding: 8px;
  border-radius: 50%;
  font-size: 24px;
}

/* ===== CATEGORIES - 2 РАД, ГОРИЗОНТАЛӢ ===== */
.categories-container {
  padding: 12px 0;
  background: #0f1a24;
  width: 100%;
  border-bottom: 1px solid #1e2c38;
}

.categories-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: max-content;
}

.category-item {
  min-width: 140px;
  width: 140px;
  height: 100px;
  background: #f5f5f5;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  flex-shrink: 0;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.category-item:active {
  transform: scale(0.96);
}

.category-item.active {
  border-color: #4a9eff;
  box-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

/* Акс аз static/uploads/categories - ПУРРА */
.cat-icon {
  position: absolute;
  inset: 0;  /* Тамоми ҷойро пур мекунад */
  width: 100%;
  height: 100%;
  background-size: cover;      /* Пурра пӯшонидан, бурида мешавад */
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  opacity: 0.7;  /* Шаффофият барои дидани матн */
}

/* Матн дар боло */
.category-item span {
  position: relative;
  z-index: 2;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  max-width: 80%;
}

/* Icons аз static/uploads/categories - БЕ CDN */
.cat-icon.home        { background-image: url("/static/uploads/categories/nedvizhimost.png"); }
.cat-icon.car         { background-image: url("/static/uploads/categories/avto.png"); }
.cat-icon.electronics { background-image: url("/static/uploads/categories/elektronika.png"); }
.cat-icon.accessories { background-image: url("/static/uploads/categories/aksessuary.png"); }
.cat-icon.services    { background-image: url("/static/uploads/categories/uslugi.png"); }
.cat-icon.home-garden { background-image: url("/static/uploads/categories/dom.png"); }
.cat-icon.work        { background-image: url("/static/uploads/categories/rabota.png"); }
.cat-icon.business    { background-image: url("/static/uploads/categories/biznes.png"); }
.cat-icon.clothes     { background-image: url("/static/uploads/categories/odezhda.png"); }
.cat-icon.all         { background-image: url("/static/uploads/categories/all.png"); }

/* ===== РЕКЛАМА - МИСЛИ АВИТО ===== */
.promo-section {
  padding: 8px 16px 16px;
  background: #0f1a24;
}

.promo-header {
  margin-bottom: 8px;
}

.promo-label {
  font-size: 11px;
  font-weight: 600;
  color: #6f8a9c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.promo-card {
  background: #1e2c38;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #2a3a48;
  position: relative;
}

.promo-content {
  padding-right: 60px;
}

.promo-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.promo-desc {
  font-size: 13px;
  color: #9bb8d0;
  margin-bottom: 8px;
  line-height: 1.4;
}

.promo-info {
  font-size: 10px;
  color: #6f8a9c;
}

.promo-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #2a3a48;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 600;
  color: #9bb8d0;
  border: 1px solid #3a4a58;
}

/* ===== FEED ===== */
.feed {
  flex: 1;
  padding: 8px 12px 100px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: #0f1a24;
}

/* SKELETON LOADING */
.skeleton-card {
  background: #1e2c38;
  border-radius: 14px;
  overflow: hidden;
  animation: pulse 1.5s infinite;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(90deg, #1e2c38 25%, #2a3e4e 50%, #1e2c38 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 60px;
  margin: 10px;
  background: linear-gradient(90deg, #1e2c38 25%, #2a3e4e 50%, #1e2c38 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== POST CARDS ===== */
.card {
  background: #1e2c38;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s;
  cursor: pointer;
  animation: fadeInUp 0.4s ease;
  border: 1px solid #2a3a48;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:active {
  transform: scale(0.98);
  background: #253846;
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 10px;
}

.price {
  color: #4a9eff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
}

.meta {
  font-size: 11px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9bb8d0;
  margin-top: 4px;
}

.meta .material-icons-outlined {
  font-size: 12px;
}

/* LIKE BUTTON */
.like-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
  border: 1px solid rgba(255,255,255,0.1);
}

.like-btn span {
  font-size: 18px;
  color: #fff;
}

.like-btn.liked {
  background: #ff4757;
  border-color: #ff6b81;
}

.like-btn.liked span {
  color: #fff;
}

.like-btn:active {
  transform: scale(0.85);
}

/* SHORTS */
.shorts-wrapper {
  grid-column: span 2;
  background: #1e2c38;
  border-radius: 20px;
  padding: 16px;
  margin: 4px 0;
  border: 1px solid #2a3a48;
}

.shorts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #ff6b6b;
  font-weight: 600;
  font-size: 15px;
}

.shorts-header span:first-child {
  font-size: 22px;
  color: #ff4757;
}

.shorts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shorts-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #1e2c38;
  aspect-ratio: 1/1.2;
  border: 1px solid #2a3a48;
}

.shorts-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shorts-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shorts-overlay span {
  font-size: 32px;
  color: #fff;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.shorts-views {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 3px 8px;
  border-radius: 30px;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
}

.shorts-views::before {
  content: "▶";
  font-size: 8px;
}

/* ===== PULL TO REFRESH ===== */
.pull-refresh {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #2a4a6a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  z-index: 200;
  transition: transform 0.25s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  border: 1px solid #4a9eff;
}

.pull-refresh.show {
  transform: translateX(-50%) translateY(0);
}

.pull-refresh span:first-child {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== BOTTOM NAV (STICKY) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: #0f1a24;
  border-top: 1px solid #2a3a48;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  opacity: 0.6;
  color: #9bb8d0;
  text-decoration: none;
  transition: all 0.15s;
  padding: 4px 8px;
}

.nav-item span {
  font-size: 22px;
}

.nav-item.active {
  opacity: 1;
  color: #4a9eff;
}

.nav-item.add {
  background: #4a9eff;
  padding: 12px;
  border-radius: 45%;
  color: #fff;
  opacity: 1;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
  margin-top: -18px;
}

.nav-item.add span {
  font-size: 22px;
}

.nav-item.add:active {
  transform: scale(0.92);
  background: #3a8eef;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: #1e2c38;
}

::-webkit-scrollbar-thumb {
  background: #2a4a6a;
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .categories-grid {
    gap: 8px 4px;
  }
  
  .category-item {
    padding: 10px 2px;
    min-height: 70px;
  }
  
  .cat-icon {
    width: 28px;
    height: 28px;
  }
  
  .category-item span {
    font-size: 10px;
  }
  
  .promo-card {
    padding: 14px;
  }
  
  .promo-title {
    font-size: 15px;
  }
  
  .promo-desc {
    font-size: 12px;
  }
}

;
  background: #0f1a24;
  border-bottom: 1px solid #1e2c38;
  margin-bottom: 8px;
}

.promoted-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.promoted-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6f8a9c;
}

.promoted-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.promoted-scroll::-webkit-scrollbar {
  display: none;
}

/* ===== VIP & СРОЧНО СЕКЦИЯ - Скролли уфуқӣ дар зери реклама ===== */
.promoted-section {
  padding: 12px 0 12px 16px;  /* Танҳо аз чап padding */
  background: #0f1a24;
  border-bottom: 1px solid #1e2c38;
  margin-bottom: 8px;
}

.promoted-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-right: 16px;  /* Барои тугмаи "Свайп →" */
}

.promoted-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6f8a9c;
}

/* ===== КОНТЕЙНЕРИ СКРОЛЛ ===== */
.promoted-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;           /* Скролли уфуқӣ */
  overflow-y: hidden;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
  -webkit-overflow-scrolling: touch;  /* iOS smooth scroll */
  padding-bottom: 8px;        /* Ҷои барои скролл */
  padding-right: 16px;        /* Ҷои аз рости охирин карта */
}

/* Пинҳон кардани scrollbar */
.promoted-scroll::-webkit-scrollbar {
  display: none;
}

/* ===== VIP КАРТОЧКА ===== */
.vip-card {
  flex: 0 0 auto;             /* Ҳаҷм фиксӣ, ҳеҷ гоҳ кӯчак намешавад */
  width: 160px;               /* Васеъи фиксӣ */
  min-width: 160px;           /* Минималӣ */
  max-width: 160px;           /* Максималӣ */
  background: #1e2c38;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #4a9eff;
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vip-card:active {
  transform: scale(0.96);
}

.vip-card:hover {
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

.vip-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #000;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.vip-badge.premium {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #000;
}

.vip-card .card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #0f1a24;
}

.vip-card .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vip-card .card-body {
  padding: 8px;
}

.vip-card .price {
  color: #ffd700;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-card .title {
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
  margin: 2px 0;
  min-height: 32px;           /* Барои 2 сатр */
}

.vip-card .meta {
  color: #6f8a9c;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ===== СРОЧНО КАРТОЧКА ===== */
.urgent-card {
  flex: 0 0 auto;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  background: #1e2c38;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #ff4757;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.urgent-card:active {
  transform: scale(0.96);
}

.urgent-card:hover {
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.urgent-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #ff4757 0%, #ff2e43 100%);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.urgent-card .card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #0f1a24;
}

.urgent-card .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.urgent-card .card-body {
  padding: 8px;
}

.urgent-card .price {
  color: #ff4757;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urgent-card .title {
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
  margin: 2px 0;
  min-height: 32px;
}

.urgent-card .meta {
  color: #6f8a9c;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ===== ТОП КАРТОЧКА ===== */
.top-card {
  flex: 0 0 auto;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  background: #1e2c38;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #2ed573;
  box-shadow: 0 2px 8px rgba(46, 213, 115, 0.3);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-card:active {
  transform: scale(0.96);
}

.top-card:hover {
  box-shadow: 0 4px 12px rgba(46, 213, 115, 0.4);
}

.top-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #2ed573 0%, #26af61 100%);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.top-card .card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #0f1a24;
}

.top-card .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-card .card-body {
  padding: 8px;
}

.top-card .price {
  color: #2ed573;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-card .title {
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
  margin: 2px 0;
  min-height: 32px;
}

.top-card .meta {
  color: #6f8a9c;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ===== Вақти боқимонда ===== */
.time-remaining {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  z-index: 5;
  white-space: nowrap;
}

/* ===== Ишораи скролл (optional) ===== */
.promoted-scroll::after {
  content: '';
  flex: 0 0 4px;  /* Ҷои холӣ дар охир */
}

/* ===== Аниматсия ===== */
@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateX(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

.vip-card,
.urgent-card,
.top-card {
  animation: slideIn 0.3s ease forwards;
}

/* ===== Responsive ===== */
@media (max-width: 360px) {
  .vip-card,
  .urgent-card,
  .top-card {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }
}

@media (min-width: 480px) {
  .vip-card,
  .urgent-card,
  .top-card {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
  }
}

