/* ===== СТОРІНКА ОГОЛОШЕННЯ ===== */

.listing-page {
    width: min(1100px, 92%);
    margin: 30px auto;
}

.listing-back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #f0c96b;
    text-decoration: none;
}

.listing-back-link:hover {
    text-decoration: underline;
}

/* ===== ВМІСТ ОГОЛОШЕННЯ ===== */

.listing-details {
    display: grid;
    gap: 22px;
}

.listing-card {
    padding: 24px;
    background: rgba(8, 34, 74, 0.92);
    border: 1px solid rgba(240, 201, 107, 0.35);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ===== ГОЛОВНЕ ФОТО ===== */

.listing-main-photo {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #07182e;
    border-radius: 12px;
}

.listing-no-photo {
    display: grid;
    min-height: 300px;
    place-items: center;
    font-size: 32px;
}

/* ===== ЦІНА ТА ПАРАМЕТРИ ===== */

.listing-price {
    margin: 12px 0 5px;
    color: #f0c96b;
}

.listing-parameters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 30px;
}

.listing-description {
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== ПРОДАВЕЦЬ ===== */

.seller-card button {
    margin: 10px 10px 0 0;
}

/* ===== МОБІЛЬНА ВЕРСІЯ ===== */

@media (max-width: 650px) {
    .listing-card {
        padding: 16px;
    }

    .listing-parameters {
        grid-template-columns: 1fr;
    }

    .seller-card button {
        width: 100%;
        margin-right: 0;
    }
}

/* ===== ПОВНОЕКРАННИЙ ПЕРЕГЛЯД ФОТО ===== */

.listing-main-photo {
    cursor: zoom-in;
}

.listing-main-photo:focus-visible {
    outline: 3px solid #f0c96b;
    outline-offset: 4px;
}

.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(5px);
}

.photo-viewer.open {
    display: flex;
}

.photo-viewer-image {
    display: block;

    max-width: 96vw;
    max-height: 92vh;

    object-fit: contain;

    border-radius: 10px;

    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.55);
}

.photo-viewer-close {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 10000;

    width: 46px;
    height: 46px;

    color: #ffffff;
    background: rgba(8, 34, 74, 0.92);

    border: 1px solid rgba(240, 201, 107, 0.65);
    border-radius: 50%;

    cursor: pointer;

    font-size: 32px;
    line-height: 1;
}

.photo-viewer-close:hover {
    color: #07182e;
    background: #f0c96b;
}

body.photo-viewer-open {
    overflow: hidden;
}

/* ===== ФОТО НА ТЕЛЕФОНІ ===== */

@media (max-width: 650px) {
    .photo-viewer {
        padding: 12px;
    }

    .photo-viewer-image {
        max-width: 100%;
        max-height: 88vh;
    }

    .photo-viewer-close {
        top: 12px;
        right: 12px;

        width: 42px;
        height: 42px;
    }
}

/* ===== ВИПРАВЛЕННЯ МІНІАТЮР ГАЛЕРЕЇ ===== */

.listing-photo-thumbnails {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 10px;

    width: 100%;
    margin-top: 14px;
    padding: 4px 0 8px;

    overflow-x: auto;
    overflow-y: hidden;
}

.listing-photo-thumbnail {
    display: block;

    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    height: 74px;

    flex: 0 0 100px;

    padding: 0 !important;
    margin: 0 !important;

    background: #07182e;
    border: 2px solid transparent;
    border-radius: 9px;

    overflow: hidden;
    cursor: pointer;
}

.listing-photo-thumbnail.is-active {
    border-color: #f0c96b;

    box-shadow:
        0 0 14px rgba(240, 201, 107, 0.4);
}

.listing-photo-thumbnail img {
    display: block;

    width: 100% !important;
    height: 100% !important;

    max-width: none;
    object-fit: cover;
}


/* ===== ГОЛОВНЕ ФОТО ===== */

.listing-photo-stage {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 300px;

    background: #07182e;
    border-radius: 12px;
    overflow: hidden;
}

.listing-photo-stage .listing-main-photo {
    display: block;

    width: 100%;
    max-width: 100%;
    max-height: 600px;

    object-fit: contain;
}


/* ===== ТЕЛЕФОН ===== */

@media (max-width: 650px) {
    .listing-photo-stage {
        min-height: 240px;
    }

    .listing-photo-thumbnail {
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        height: 60px;

        flex-basis: 78px;
    }
}

/* ===== СТРІЛКИ ПОВНОЕКРАННОЇ ГАЛЕРЕЇ ===== */

.photo-viewer-arrow {
    position: fixed;
    top: 50%;
    z-index: 10001;

    display: grid;
    place-items: center;

    width: 54px;
    height: 54px;

    color: #ffffff;
    background: rgba(8, 34, 74, 0.92);

    border: 1px solid rgba(240, 201, 107, 0.7);
    border-radius: 50%;

    cursor: pointer;

    font-size: 40px;
    line-height: 1;

    transform: translateY(-50%);
}

.photo-viewer-arrow-left {
    left: 20px;
}

.photo-viewer-arrow-right {
    right: 20px;
}

.photo-viewer-arrow:hover {
    color: #07182e;
    background: #f0c96b;
}

@media (max-width: 650px) {
    .photo-viewer-arrow {
        width: 42px;
        height: 42px;
        font-size: 31px;
    }

    .photo-viewer-arrow-left {
        left: 8px;
    }

    .photo-viewer-arrow-right {
        right: 8px;
    }
}

/* ===== РЕПУТАЦІЯ ПРОДАВЦЯ ===== */

.seller-reputation {
    margin: 16px 0 20px;
    padding: 18px;

    background:
        rgba(5, 23, 52, 0.72);

    border:
        1px solid
        rgba(240, 201, 107, 0.32);

    border-radius: 14px;
}

.seller-rating-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.seller-rating-display {
    display: flex;
    gap: 3px;

    line-height: 1;
}

.seller-display-star {
    color:
        rgba(255, 255, 255, 0.28);

    font-size: 24px;

    text-shadow:
        none;
}

.seller-display-star.is-filled {
    color: #f0c96b;

    text-shadow:
        0 0 8px
        rgba(240, 201, 107, 0.55);
}

.seller-rating-number {
    color: #f0c96b;

    font-size: 24px;
}

.seller-rating-count {
    color:
        rgba(255, 255, 255, 0.72);
}

.seller-rating-message {
    margin: 12px 0 0;

    color:
        rgba(255, 255, 255, 0.72);
}

.seller-rating-form {
    margin-top: 16px;
}

.seller-rating-form p {
    margin: 0 0 10px;
}

.seller-rating-buttons {
    display: flex;
    gap: 7px;
}

.seller-rating-button {
    width: 44px;
    height: 44px;
    padding: 0;

    color:
        rgba(255, 255, 255, 0.3);

    background:
        rgba(7, 24, 46, 0.92);

    border:
        1px solid
        rgba(255, 255, 255, 0.18);

    border-radius: 10px;

    cursor: pointer;

    font-size: 29px;
    line-height: 1;

    transition:
        transform 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.seller-rating-button:hover {
    color: #f0c96b;

    border-color:
        rgba(240, 201, 107, 0.8);

    transform:
        translateY(-2px)
        scale(1.05);
}

.seller-rating-button:focus-visible {
    outline:
        3px solid
        rgba(240, 201, 107, 0.55);

    outline-offset: 3px;
}

.seller-rating-button.is-selected {
    color: #f0c96b;

    background:
        rgba(75, 57, 11, 0.76);

    border-color:
        rgba(240, 201, 107, 0.9);

    box-shadow:
        0 0 10px
        rgba(240, 201, 107, 0.35);
}

.seller-rating-status {
    min-height: 20px;
    margin-top: 10px !important;

    color:
        rgba(255, 255, 255, 0.72);

    font-size: 14px;
}

@media (max-width: 650px) {
    .seller-reputation {
        padding: 14px;
    }

    .seller-rating-summary {
        align-items: flex-start;
    }

    .seller-rating-button {
        width: 42px;
        height: 42px;

        font-size: 27px;
    }
}

/* ===== ВІДГУКИ ПРО ПРОДАВЦЯ ===== */

.seller-reviews-section {
    margin-top: 18px;
}

.seller-reviews-title {
    margin: 0 0 14px;

    color: #f0c96b;

    font-size: 22px;
}

.seller-reviews-empty {
    margin: 0;

    color:
        rgba(255, 255, 255, 0.7);
}

.seller-review-card {
    margin-top: 12px;
    padding: 16px;

    background:
        rgba(5, 23, 52, 0.72);

    border:
        1px solid
        rgba(240, 201, 107, 0.28);

    border-radius: 12px;
}

.seller-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 8px;
}

.seller-review-author {
    color: #ffffff;

    font-size: 16px;
}

.seller-review-date {
    color:
        rgba(255, 255, 255, 0.55);

    font-size: 13px;
}

.seller-review-stars {
    display: flex;
    gap: 2px;

    margin-bottom: 8px;
}

.seller-review-star {
    color:
        rgba(255, 255, 255, 0.25);

    font-size: 20px;
}

.seller-review-star.is-filled {
    color: #f0c96b;

    text-shadow:
        0 0 7px
        rgba(240, 201, 107, 0.45);
}

.seller-review-text {
    margin: 0;

    color:
        rgba(255, 255, 255, 0.9);

    line-height: 1.5;

    white-space: pre-wrap;
}


/* ===== АНІМАЦІЯ ПІСЛЯ ЗБЕРЕЖЕННЯ ===== */

.rating-success
.seller-rating-button.is-selected {
    animation:
        seller-star-success
        0.65s ease;
}

@keyframes seller-star-success {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.18);

        box-shadow:
            0 0 20px
            rgba(240, 201, 107, 0.8);
    }

    100% {
        transform: scale(1);
    }
}


/* ===== МОБІЛЬНА ВЕРСІЯ ВІДГУКІВ ===== */

@media (max-width: 650px) {
    .seller-reviews-title {
        font-size: 20px;
    }

    .seller-review-card {
        padding: 14px;
    }

    .seller-review-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;
    }
}

/* ===== ЗАХИСТ МОБІЛЬНОЇ ШИРИНИ LISTING ===== */

.listing-page,
.listing-details,
.listing-card,
.listing-photo-stage,
.listing-photo-thumbnails {
    box-sizing: border-box;
    max-width: 100%;
}

@media (max-width: 650px) {
    .listing-page {
        width: 100%;
        margin: 20px 0;
        padding: 0 14px;
        overflow-x: hidden;
    }

    .listing-card {
        width: 100%;
        min-width: 0;
    }

    .listing-photo-stage {
        width: 100%;
        min-width: 0;
    }
}

.listing-photo-counter {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 5;

    padding: 6px 12px;

    color: #ffffff;
    background: rgba(0, 0, 0, 0.65);

    border-radius: 20px;

    font-size: 15px;
    font-weight: 700;
}
/* ===== LISTING НА НОУТБУЦІ / ПК ===== */

@media (min-width: 651px) {
    .listing-gallery {
        width: 100%;
        max-width: 850px;
        margin-left: auto;
        margin-right: auto;
    }

    .listing-photo-stage {
        width: 100%;
        height: 520px;
        min-height: 0;
        background: #07182e;
        overflow: hidden;
    }

    .listing-photo-stage .listing-main-photo {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: none;
        object-fit: contain;
        margin: 0 auto;
    }

    .listing-photo-thumbnails {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .listing-photo-thumbnail {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        height: 68px;
        flex: 0 0 90px;
    }
}
/* ===== КРАПОЧКИ ГАЛЕРЕЇ ROYAL GARAGE ===== */
.listing-photo-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    max-width: 100%;
    padding: 14px 8px 6px;
}
.listing-photo-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    background: #8a8d96;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
}
.listing-photo-dot.is-active {
    background: #f0c96b;
    border-color: #f0c96b;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(240,201,107,.5);
}
.listing-photo-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}
.photo-viewer {
    flex-direction: column;
}
.photo-viewer-image {
    max-height: calc(92vh - 55px);
}
.photo-viewer-dots {
    flex: 0 0 auto;
    max-height: 80px;
    overflow-y: auto;
    padding: 18px 8px 8px;
    z-index: 10001;
}
@media (max-width: 650px) {
    .photo-viewer-image {
        max-height: calc(88vh - 55px);
    }
    .listing-photo-dots { gap: 8px; }
}


/* Consistent listing action buttons, independent of browser defaults. */
.listing-card.seller-card > button,
.listing-card.seller-card .primary-button,
.listing-card.seller-card .secondary-button {
  box-sizing: border-box; min-height: 42px; padding: 10px 14px;
  background: #0b2b53; color: #f0c96b;
  border: 1px solid rgba(240,201,107,.7); border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 700;
  line-height: 1.35; white-space: normal; cursor: pointer;
}
.listing-card.seller-card > button:hover,
.listing-card.seller-card > button:focus-visible {
  background: #173c6d; border-color: #f0c96b;
}
.listing-parameters { gap: 6px 22px; }
.listing-parameters p { margin: 6px 0; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .listing-parameters { gap: 2px; }
  .listing-parameters p { margin: 5px 0; }
  .listing-card.seller-card > button { display: block; width: 100%; margin: 8px 0 0; }
}


/* Royal Garage: targeted listing presentation fixes (2026-10-11). */
/* Share action is in the information card, not the seller card. */
.listing-card #shareListingButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 44px;
    padding: 11px 16px;
    margin: 8px 0;
    background: #0b2b53;
    color: #f0c96b;
    border: 1px solid rgba(240, 201, 107, .75);
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    cursor: pointer;
}
.listing-card #shareListingButton:hover,
.listing-card #shareListingButton:focus-visible {
    background: #173c6d;
    border-color: #f0c96b;
}
/* Seller review form: restore the label and full-width dark input. */
.listing-card .seller-rating-form .seller-review-label {
    display: block;
    width: 100%;
    margin: 14px 0 7px;
    color: #f0c96b;
    font-size: 15px;
    font-weight: 700;
}
.listing-card .seller-rating-form .seller-review-textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 110px;
    padding: 12px 14px;
    margin: 0;
    color: #fff;
    background: #07182e;
    border: 1px solid rgba(240, 201, 107, .65);
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}
.listing-card .seller-rating-form .seller-review-textarea::placeholder {
    color: rgba(255, 255, 255, .55);
}
.listing-card .seller-rating-form .seller-review-textarea:focus {
    outline: 2px solid rgba(240, 201, 107, .4);
    outline-offset: 1px;
}
.listing-card .seller-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.listing-card .seller-review-counter {
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
}
.listing-card .seller-review-save-button {
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
}
/* VIN copy button and description layout. */
.listing-card .copy-vin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 34px;
    padding: 6px 11px;
    margin: 6px 0 0 8px;
    color: #f0c96b;
    background: #0b2b53;
    border: 1px solid rgba(240, 201, 107, .65);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}
.listing-card .copy-vin-button:hover,
.listing-card .copy-vin-button:focus-visible {
    background: #173c6d;
    border-color: #f0c96b;
}
.listing-card .listing-description {
    margin: 12px 0 0;
    padding: 0;
    text-align: left;
    text-indent: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
@media (max-width: 650px) {
    .listing-card #shareListingButton { width: 100%; }
    .listing-card .seller-review-footer { align-items: stretch; flex-direction: column; }
    .listing-card .seller-review-save-button { width: 100%; }
    .listing-card .copy-vin-button { margin-left: 0; }
}

/* Compact vertical rhythm for description and seller rating (2026-10-11). */
.listing-card:has(> .listing-description) > h2 {
    margin-bottom: 8px;
}
.listing-card .listing-description {
    margin-top: 0;
}
.listing-card .seller-rating-form .seller-rating-status:empty {
    display: none;
}
.listing-card .seller-rating-form .seller-rating-status {
    margin: 6px 0 0;
}
.listing-card .seller-rating-form .seller-review-label {
    margin-top: 10px;
}
