/* Shared by the public-listing forms (site + /filing + /admin): money inputs
   (money-input.js) and the photo picker (image-uploader.js). */

.money-input { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.money-words {
    display: block;
    margin-top: 4px;
    color: #1e7a3a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}
.money-words[hidden] { display: none; }

.deal-group { display: contents; }
.deal-group[hidden] { display: none; }

.lp { display: flex; flex-direction: column; gap: 8px; }
.lp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.lp-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #eef0f4;
    border: 2px solid transparent;
}
.lp-tile.is-cover { border-color: #c9a449; }
.lp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-cover-badge, .lp-new-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #c9a449;
    color: #0d1429;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.lp-new-badge { top: auto; bottom: 34px; background: #1e7a3a; color: #fff; }
.lp-btn {
    border: 0;
    cursor: pointer;
    font: inherit;
    line-height: 1;
}
.lp-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(179, 38, 30, 0.92);
    color: #fff;
    font-size: 13px;
}
.lp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    background: rgba(13, 20, 41, 0.6);
}
.lp-bar .lp-btn {
    min-width: 28px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #0d1429;
    font-size: 13px;
}
.lp-bar .lp-btn:hover, .lp-remove:hover { filter: brightness(1.1); }
.lp-add {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    border: 2px dashed #c3c8d4;
    background: #fafbfc;
    color: #596173;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
}
.lp-add:hover { border-color: #c9a449; color: #0d1429; }
.lp-add-plus { font-size: 26px; font-weight: 300; }
.lp-meta, .lp-hint { color: #808594; font-size: 11px; line-height: 1.7; }
.lp-error {
    background: #fdecec;
    color: #b3261e;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.8;
}
.lp-error[hidden] { display: none; }

/* Per-listing رهن->اجاره rate field (partials/listing_rate_field.php). */
.rate-input { direction: ltr; text-align: right; max-width: 140px; }
.rate-badge { font-weight: 500; font-size: 11px; color: #808594; }
.rate-badge.is-own { color: #8a6d1d; font-weight: 700; }
.rate-reset {
    margin-right: 6px;
    padding: 1px 8px;
    border: 1px solid #c9a449;
    border-radius: 6px;
    background: #fff;
    color: #0d1429;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}
.rate-reset[hidden] { display: none; }

/* Phones: two photos per row, with the action buttons in a fixed 2x2 grid
   under each photo (not over it), each button ~60x36px, so every tile has the
   same height and nothing is a tiny tap target. */
@media (max-width: 600px) {
    .lp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .lp-tile { aspect-ratio: auto; display: flex; flex-direction: column; background: #0d1429; }
    .lp-tile img { aspect-ratio: 4 / 3; height: auto; }
    .lp-bar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 36px; align-content: start; min-height: 80px; gap: 4px; padding: 4px; background: #0d1429; }
    .lp-bar .lp-btn { min-width: 0; height: 36px; font-size: 16px; }
    .lp-remove { width: 36px; height: 36px; font-size: 15px; top: 4px; left: 4px; }
    .lp-cover-badge { top: 4px; right: 4px; }
    .lp-new-badge { top: 30px; right: 4px; bottom: auto; }
    .rate-reset { padding: 6px 10px; margin-top: 4px; }
}
