/* Final listing-detail polish: mobile/tablet presentation only. */
.ad-action-icon { display: none; }

@media (max-width: 820px) {
  .layout {
    gap: clamp(12px, 3vw, 17px);
  }

  .layout > .box,
  .layout .details,
  .layout .ad-primary-summary {
    display: contents;
  }

  .layout .ad-primary-summary > .dzm-store-follow-ad {
    order: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .layout .ad-primary-summary > .dzmarket-category-breadcrumb,
  .layout .ad-primary-summary > .category {
    order: 2;
    align-self: flex-start;
    max-width: 100%;
    margin: 0;
  }

  .layout .ad-primary-summary > .dzmarket-category-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 13px;
  }

  .layout .ad-primary-summary > .dzmarket-category-breadcrumb a {
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #d8e8de;
    border-radius: 999px;
    background: #edf6f0;
    color: #225c3f;
    font-weight: 750;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .layout .ad-primary-summary > .category {
    padding: 5px 10px;
    border: 1px solid #d8e8de;
    border-radius: 999px;
    background: #edf6f0;
    color: #225c3f;
    font-size: 13px;
    font-weight: 750;
  }

  .layout .ad-primary-summary > .ad-sold-notice {
    order: 3;
    width: 100%;
    box-sizing: border-box;
  }

  .layout .ad-primary-summary > h1 {
    order: 4;
    margin: 0;
    padding-inline-start: 11px;
    border-inline-start: 4px solid #2f7d5a;
    font-size: clamp(22px, 5.9vw, 29px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .layout #galleryStage {
    order: 5;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 0.94;
    border: 1px solid #e0e9e3;
    border-radius: 16px;
    background: #eaf1ec;
    overflow: hidden;
  }

  .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: 6;
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 4px 1px 7px;
    overflow-x: auto;
    box-sizing: border-box;
  }

  .layout > .ad-primary-box > .ad-gallery-actions {
    order: 7;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 9px;
    width: 100%;
    min-width: 0;
    margin: -2px 0 0;
    padding: 4px 2px 6px;
    border: 0;
    background: transparent;
  }

  .layout .ad-gallery-actions > .favorite-form,
  .layout .ad-gallery-actions #likes,
  .layout .ad-gallery-actions .share-ad-button {
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    min-height: 46px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .layout .ad-gallery-actions > .favorite-form {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .layout .ad-gallery-actions #likes,
  .layout .ad-gallery-actions #likes .social-actions,
  .layout .ad-gallery-actions #likes form {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .layout .ad-gallery-actions #likes {
    overflow: visible;
  }

  .layout .ad-gallery-actions .ad-icon-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid #d6e4dc;
    border-radius: 50%;
    background: #fff;
    color: #24583c;
    box-shadow: 0 2px 8px rgba(25, 61, 41, 0.12);
    text-decoration: none;
    cursor: pointer;
    overflow: visible;
  }

  .layout .ad-gallery-actions .ad-icon-action:hover {
    border-color: #8fb8a0;
    background: #f1f8f3;
  }

  .layout .ad-gallery-actions .ad-icon-action:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
  }

  .layout .ad-gallery-actions .ad-action-icon {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .layout .ad-gallery-actions .favorite-btn.active .ad-action-icon,
  .layout .ad-gallery-actions .ad-icon-action.liked .ad-action-icon,
  .layout .ad-gallery-actions .ad-icon-action[aria-pressed="true"] .ad-action-icon {
    fill: #c83e4d;
    stroke: #a82b3b;
  }

  .layout .ad-gallery-actions .ad-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .layout .ad-gallery-actions .ad-like-count {
    position: absolute;
    top: -5px;
    inset-inline-end: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #e64e4e;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
  }

  .layout .ad-gallery-actions #likes .social-actions {
    width: 46px;
    min-height: 46px;
    gap: 0;
    margin: 0;
  }

  .layout .ad-gallery-actions #likes .social-button,
  .layout .ad-gallery-actions #likes .ad-icon-action {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .layout .ad-gallery-actions .share-ad-button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #d6e4dc;
    border-radius: 50%;
    background: #fff;
    color: #24583c;
    box-shadow: 0 2px 8px rgba(25, 61, 41, 0.12);
  }

  .layout .ad-gallery-actions .share-ad-button::before {
    content: none;
  }

  .layout .ad-gallery-actions .share-ad-status {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .layout > .ad-primary-box > .description-box {
    order: 8;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 15px;
    border: 1px solid #dfe9e2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(25, 61, 41, 0.045);
  }

  .layout .ad-primary-summary > .price {
    order: 9;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 9px 14px;
    border-radius: 12px;
    background: #e8f3eb;
    color: #205d3a;
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 850;
  }

  .layout .price bdi {
    unicode-bidi: isolate;
  }

  .layout .details > .info {
    order: 10;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .layout .details > .seller-box {
    order: 11;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 15px;
    border: 1px solid #dfe9e2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(25, 61, 41, 0.045);
  }

  .layout .seller-phone-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
  }

  .layout .seller-box .phone {
    flex: 0 1 auto;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 11px;
    background: #2f7d5a;
    color: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .layout .seller-box .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .layout .details > #comments {
    order: 12;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .layout .details > #contact-actions {
    order: 13;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .layout .details > .date {
    order: 14;
    width: 100%;
  }

  body.dark-theme .layout .ad-primary-summary > .dzmarket-category-breadcrumb a,
  body.dark-theme .layout .ad-primary-summary > .category {
    border-color: #3d5e4a;
    background: #263c2d;
    color: #c7ecd2;
  }

  body.dark-theme .layout .ad-gallery-actions .ad-icon-action,
  body.dark-theme .layout .ad-gallery-actions .share-ad-button {
    border-color: #43584a;
    background: #202d25;
    color: #d8eadc;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.22);
  }

  body.dark-theme .layout .ad-gallery-actions .ad-icon-action:hover,
  body.dark-theme .layout .ad-gallery-actions .share-ad-button:hover {
    background: #2b3d32;
  }

  body.dark-theme .layout .ad-gallery-actions .ad-like-count {
    border-color: #202d25;
  }

  body.dark-theme .layout .ad-primary-summary > .price {
    background: #263c2d;
    color: #c3ebcf;
  }

  body.dark-theme .layout > .ad-primary-box > .description-box,
  body.dark-theme .layout .details > .seller-box {
    border-color: #3a4b3e;
    background: #202d25;
    box-shadow: none;
  }

  body.dark-theme .layout #galleryStage {
    border-color: #3d5144;
    background: #202d25;
  }
}
@media (max-width: 820px) {
  .layout .seller-box .seller-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 0 0 6px;
  }

  .layout .seller-box .seller-heading-row h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    text-align: start;
  }

  .layout .seller-box .seller-heading-row .presence {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    align-self: center;
    white-space: nowrap;
    text-align: end;
  }
}