/* DavronMarket — карточки файлов (категории и товары), формат 9:16 */
.file-page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 12px calc(72px + env(safe-area-inset-bottom, 0px));
}

body:has(.file-page) .dm-global-breadcrumb {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 4px;
}

.file-catalog-nav {
  margin-bottom: 18px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  position: relative;
}
.file-catalog-nav::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #ff6b2b, #f5c842, #ff6b2b);
}

.file-catalog-nav__head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fffdf6 0%, #ffffff 100%);
}

.file-catalog-nav__title {
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
  margin: 0;
  line-height: 1.2;
}

.file-catalog-nav__list {
  display: flex;
  flex-direction: column;
}

.file-catalog-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: background 0.2s, padding-left 0.2s;
}
.file-catalog-nav__item::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}
.file-catalog-nav__item--games::before { background: #a78bfa; }
.file-catalog-nav__item--programs::before { background: #2b9cff; }
.file-catalog-nav__item--video::before { background: #ff6b2b; }

.file-catalog-nav__item:last-child {
  border-bottom: none;
}

.file-catalog-nav__item:hover {
  background: rgba(245, 200, 66, 0.1);
  padding-left: 18px;
}

.file-catalog-nav__label {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.file-catalog-nav__item:hover .file-catalog-nav__label {
  color: #b7720f;
}

.file-catalog-nav__arrow {
  font-size: 14px;
  color: rgba(15, 23, 42, 0.28);
  transition: transform 0.2s, color 0.2s;
}

.file-catalog-nav__item:hover .file-catalog-nav__arrow {
  color: #f5c842;
  transform: translateX(3px);
}

.file-total {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.42);
  margin-bottom: 12px;
  padding: 0 4px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
}

.file-grid--products {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-card {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #eef1f6;
  text-decoration: none;
  color: inherit;
  min-height: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.file-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.file-card.games { --accent: #a78bfa; }
.file-card.programs { --accent: #2b9cff; }
.file-card.video { --accent: #ff6b2b; }

.file-card:hover { border-color: var(--accent); }

.file-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-card-emoji,
.file-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
}

.file-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 36px 10px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 34%, rgba(0, 0, 0, 0.92) 100%);
}

.file-card-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.file-card-count {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 18px);
}

.file-card-arrow {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.file-card-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: rgba(245, 200, 66, 0.22);
  color: #ffe066;
}

.file-card-price {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #f5c842;
  margin-top: 3px;
}

.file-card-size {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.file-empty,
.file-loading {
  grid-column: 1 / -1;
  padding: 32px 16px;
  text-align: center;
  color: rgba(15, 23, 42, 0.4);
  font-size: 14px;
  background: #ffffff;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 16px;
}

@media (min-width: 521px) {
  .file-grid--products {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
  }

  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 160px));
    justify-content: center;
    gap: 14px;
    max-width: none;
  }

  .file-card-name { font-size: 12px; }
}

@media (max-width: 380px) {
  .file-grid { gap: 8px; }
  .file-card-name { font-size: 10px; }
}
