/* Listing Detail Page Styles */

.breadcrumbs {
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
    color: var(--text-light);
}

/* Loading and Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.loading-state i {
    font-size: 48px;
    color: var(--primary-green);
    margin-bottom: 20px;
}

.loading-state p {
    color: var(--text-light);
    font-size: 16px;
}

.error-state i {
    font-size: 48px;
    color: var(--accent-red);
    margin-bottom: 20px;
}

.error-state h2 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.error-state p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-green);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Listing Detail Container */
.listing-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
    padding-bottom: 40px;
}

/* Images Gallery */
.listing-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-light);
    border: 2px solid var(--camo-medium);
    box-shadow: var(--shadow);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.main-image img:hover {
    transform: scale(1.05);
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--camo-medium);
    transition: all 0.3s;
    background: var(--bg-light);
}

.thumbnail:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(74, 93, 49, 0.3);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Listing Info */
.listing-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.listing-header h1 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.listing-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-light);
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.listing-category {
    background: var(--camo-light);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.listing-views i {
    color: var(--primary-green);
}

/* Price Section */
.listing-price-section {
    padding: 25px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 2px solid var(--camo-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price span:first-child {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-green);
}

.currency {
    font-size: 20px;
    color: var(--text-light);
}

.condition-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-green);
    color: white;
    border-radius: 6px;
    font-weight: 600;
}

.condition-badge.used {
    background: var(--camo-medium);
}

.condition-badge.refurbished {
    background: var(--camo-accent);
    color: var(--text-dark);
}

/* Description */
.listing-description {
    padding: 25px;
    background: var(--bg-white);
    border-radius: 8px;
    border: 2px solid var(--camo-medium);
    /* Переопределяем стили из styles.css для карточек */
    display: block !important;
    overflow: visible !important;
}

.listing-description h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--camo-light);
}

.listing-description p {
    color: var(--text-dark);
    line-height: 1.8;
    display: block !important;
    overflow: visible !important;
    word-wrap: break-word;
    word-break: break-word;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* Seller Info */
.seller-info,
.contact-info {
    padding: 25px;
    background: var(--bg-white);
    border-radius: 8px;
    border: 2px solid var(--camo-medium);
}

.seller-info h3,
.contact-info h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--camo-light);
}

.seller-details,
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.seller-item,
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    transition: all 0.3s;
}

.seller-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.seller-link:hover {
    background: var(--camo-light);
    transform: translateX(5px);
}

.seller-item:hover,
.contact-item:hover {
    background: var(--camo-light);
    transform: translateX(5px);
}

.seller-item i,
.contact-item i {
    font-size: 20px;
    color: var(--primary-green);
    width: 24px;
    text-align: center;
}

.btn-message-seller {
    margin-top: 20px;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--camo-medium) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.btn-message-seller:hover {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--primary-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-message-seller i {
    font-size: 24px;
}

.contact-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.contact-link:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 968px) {
    .listing-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .listing-header h1 {
        font-size: 24px;
    }

    .price span:first-child {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .listing-header h1 {
        font-size: 20px;
    }

    .listing-meta {
        font-size: 12px;
        gap: 10px;
    }

    .main-image {
        aspect-ratio: 1/1;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .listing-price-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Image Gallery Modal */
.image-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-gallery-modal.active {
    display: flex;
    opacity: 1;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10002;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10002;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-image-wrapper {
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    cursor: move;
}

.gallery-image-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    transition: transform 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-image-wrapper.zoomed img {
    cursor: grab;
}

.gallery-image-wrapper.zoomed img:active {
    cursor: grabbing;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    z-index: 10002;
}

.gallery-zoom-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.gallery-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.gallery-zoom-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-counter {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-top: 15px;
    z-index: 10002;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    z-index: 10002;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.gallery-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.gallery-thumbnail.active {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(74, 93, 49, 0.5);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive для галереї */
@media (max-width: 768px) {
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

    .gallery-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }

    .gallery-image-wrapper {
        max-width: 95%;
        max-height: 60vh;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}

