/* Listing pages */

.listing-photo-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.listing-photo-heading span {
    font-size: 14px;
    color: #657269;
}

.listing-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.listing-photo-slot {
    min-width: 0;
}

.listing-photo-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    border: 1px dashed #aab9af;
    background: #f5f8f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.listing-photo-picker:hover {
    border-color: #28734d;
    background: #eaf3ec;
}

.listing-photo-picker [hidden],
.listing-photo-slot [hidden] {
    display: none !important;
}

.listing-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #657269;
    font-size: 13px;
}

.listing-photo-plus {
    font-size: 34px;
    font-weight: 300;
    color: #28734d;
}

.listing-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-photo-slot input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.listing-photo-slot:focus-within .listing-photo-picker {
    outline: 2px solid #28734d;
}

.listing-photo-remove {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: #b42318;
    font-size: 12px;
    padding: 8px;
    cursor: pointer;
}

.listing-manage-card {
    display: flex;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #dbe5dd;
}

.listing-thumbnail {
    width: 150px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.listing-no-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f3f0;
    color: #657269;
    font-size: 13px;
}

.listing-manage-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.listing-manage-info h3 {
    margin: 10px 0;
}

.listing-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    background: #edf0ed;
    color: #657269;
    font-size: 12px;
}

.listing-status-active {
    background: #e8f5ed;
    color: #28734d;
}

.listing-status-reserved {
    background: #fff3dc;
    color: #986519;
}

.listing-price {
    font-size: 20px;
    color: #28734d;
}

.listing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.listing-empty {
    padding: 35px 15px;
    text-align: center;
    background: #f5f8f5;
    border-radius: 8px;
    color: #657269;
}

.listing-main-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f0f3f0;
    border-radius: 8px;
    margin-top: 20px;
}

.listing-gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 25px;
}

.listing-gallery-button {
    border: 1px solid #dbe5dd;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #f0f3f0;
}

.listing-gallery-button img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.listing-detail-price {
    font-size: 30px;
    color: #28734d;
}

.listing-description {
    line-height: 1.9;
    overflow-wrap: anywhere;
    padding-bottom: 25px;
}

@media (max-width: 600px) {

    .listing-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .listing-thumbnail {
        width: 100px;
        height: 90px;
    }

    .listing-manage-card {
        gap: 12px;
    }

    .listing-price {
        font-size: 17px;
    }
}


/* Fix photo upload and remove button overlap */

.listing-photo-slot {
    position: relative;
}

.form-container .listing-photo-slot input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;
}

.form-container .listing-photo-picker {
    display: flex;
    position: relative;
    cursor: pointer;
}

.listing-photo-remove {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    background: #fff1f0;
    border: 1px solid #f0ceca;
    border-radius: 5px;
    margin-top: 6px;
    padding: 8px;
}

.listing-photo-remove:hover {
    background: #ffe2df;
    color: #a61b1b;
}
