/* MarketDG interface corrections: isolated candidate, 2026-10-30. */
.layout > .ad-primary-box {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}
.ad-primary-summary {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.ad-primary-summary h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ad-primary-summary .price {
  width: fit-content;
  max-width: 100%;
}
.ad-primary-box .description-box {
  min-width: 0;
  margin: 0;
}
.ad-primary-box .description {
  overflow-wrap: anywhere;
}
.ad-gallery-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.ad-gallery-actions > .favorite-form {
  flex: 1 1 190px;
  min-width: 0;
  margin: 0;
}
.ad-gallery-actions .favorite-btn,
.ad-gallery-actions .login-favorite {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.3;
}
.ad-gallery-actions #likes {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.ad-gallery-actions #likes .social-actions,
.ad-gallery-actions #likes form {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}
.ad-gallery-actions #likes .social-button {
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.3;
}
#contact-actions {
  box-sizing: border-box;
  width: 100%;
}
#contact-actions .social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#contact-actions .social-actions form {
  margin: 0;
}
#contact-actions .social-button {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.3;
}
#galleryStage {
  min-width: 0;
}
#galleryStage > .announcement-views-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  width: max-content;
  overflow: visible;
  white-space: nowrap;
}
#galleryStage > .announcement-views-badge svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}
#galleryStage > .announcement-views-badge span {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}
html[dir="rtl"] #galleryStage > .announcement-views-badge {
  right: auto;
  left: 12px;
}
.ad-gallery-actions .share-ad-button {
  min-height: 44px;
  max-width: 100%;
  padding: 9px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.share-ad-status {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #446154;
  font-size: .925rem;
}
.comment-character-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 10px;
  color: #64748b;
  font-size: .875rem;
}
.comment-character-counter bdi {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}
body.dark-theme .share-ad-status,
body.dark-theme .comment-character-counter {
  color: #cbd5e1;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand settings navigation-toggle"
      "settings-menu settings-menu settings-menu"
      "navigation navigation navigation";
    align-items: center;
    column-gap: 8px;
    row-gap: 10px;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded > .logo {
    grid-area: brand;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded .dzmarket-settings-anchor {
    display: contents !important;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded .theme-menu-button {
    grid-area: settings;
    justify-self: end;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded .theme-menu {
    grid-area: settings-menu;
    position: static !important;
    justify-self: end;
    margin: 0;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded > .mobile-navigation-toggle {
    grid-area: navigation-toggle;
    justify-self: end;
}
.ad-detail-header .header-inner.dzmarket-settings-expanded > .nav {
    grid-area: navigation;
}
html[dir="rtl"] .ad-detail-header .header-inner.dzmarket-settings-expanded .theme-menu {
    justify-self: start;
}
body.dark-theme .ad-primary-box .description-box {
  background: #202d25;
  border-color: #3a4b3e;
  color: #e2ece5;
}
@media (max-width: 820px) {
  .header-container > .dzm-header-actions,
  .header-container > .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 6px 0 0;
  }
  .header-container > .dzm-header-actions > .dzm-user-greeting,
  .header-container > .header-actions > .dzm-user-greeting {
    grid-column: 1 / -1;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    overflow: hidden;
  }
  .header-container > .header-actions > .dzm-user-greeting {
    border: 1px solid #dbeafe;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    text-align: start;
  }
  .header-container > .dzm-header-actions .dzm-user-name,
  .header-container > .header-actions .dzm-user-name {
    min-width: 0;
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-container > .header-actions .dzm-user-name {
    color: #1e3a8a;
    font-weight: 700;
  }
  body.dark-theme .header-container > .header-actions > .dzm-user-greeting {
    border-color: #31517b;
    background: #1b2d47;
    color: #bfdbfe;
  }
  body.dark-theme .header-container > .header-actions .dzm-user-name {
    color: #eff6ff;
  }
  .header-container > .dzm-header-actions > .dzm-action-link,
  .header-container > .header-actions > .btn-login,
  .header-container > .header-actions > .btn-post {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    padding: 6px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.25;
  }
  .header-container > .dzm-header-actions > .dzm-post-action,
  .header-container > .header-actions > .btn-post {
    grid-column: 1 / -1;
  }
  .layout {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
  }
  .layout > .box {
    display: contents;
  }
  .layout .details,
  .layout .ad-primary-summary {
    display: contents;
  }
  .layout .ad-primary-summary > .dzmarket-category-breadcrumb { order: 1; }
  .layout .ad-primary-summary > .category {
    order: 2;
    align-self: flex-start;
    max-width: 100%;
  }
  .layout .ad-primary-summary > .ad-sold-notice { order: 3; }
  .layout .ad-primary-summary > h1 {
    order: 4;
    margin: 0;
    font-size: clamp(21px, 6vw, 28px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .layout .ad-primary-summary > .dzm-store-follow-ad { order: 5; }
  .layout .ad-primary-summary > .price {
    order: 6;
    width: fit-content;
    max-width: 100%;
    padding: 9px 13px;
    border-radius: 12px;
    background: #e8f3eb;
    color: #205d3a;
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 850;
  }
  .layout > .ad-primary-box > .description-box {
    order: 7;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid #dfe9e2;
    border-radius: 14px;
    background: #fff;
  }
  .layout > .ad-primary-box > .ad-gallery-actions {
    order: 8;
    width: 100%;
  }
  .layout #galleryStage {
    order: 9;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 0.94;
    border-radius: 15px;
  }
  .layout #galleryStage .main-image-open {
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .layout #galleryStage #mainImage {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
  }
  .layout #thumbnails {
    order: 10;
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 4px 1px 7px;
    overflow-x: auto;
    box-sizing: border-box;
  }
  .layout .details > #contact-actions {
    order: 11;
    width: 100%;
    box-sizing: border-box;
  }
  .layout .details > .info {
    order: 12;
    width: 100%;
    box-sizing: border-box;
  }
  .layout .details > .seller-box {
    order: 13;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px;
    border: 1px solid #dfe9e2;
    border-radius: 15px;
    background: #fff;
  }
  .layout .details > #comments {
    order: 14;
    width: 100%;
    box-sizing: border-box;
  }
  .layout .details > .date { order: 15; }
  .layout .price bdi { unicode-bidi: isolate; }
  .layout .seller-box .phone,
  .layout .seller-box .social-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    padding: 8px 11px;
    border-radius: 10px;
    background: #2f7d5a;
    color: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .layout .seller-box .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  #contact-actions .social-actions {
    flex-direction: column;
    align-items: stretch;
  }
  body.dark-theme .layout .price {
    background: #263c2d;
    color: #c3ebcf;
  }
  body.dark-theme .layout > .ad-primary-box > .description-box,
  body.dark-theme .layout .details > .seller-box {
    background: #202d25;
    border-color: #3a4b3e;
  }
}
@media (max-width: 420px) {
  .ad-gallery-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .ad-gallery-actions > .favorite-form,
  .ad-gallery-actions #likes {
    width: 100%;
  }
  .ad-gallery-actions #likes .social-actions,
  .ad-gallery-actions #likes form,
  .ad-gallery-actions #likes .social-button {
    width: 100%;
  }
}
