/* Shared advertisement and auction detail shell. Presentation only. */
.item-detail-page {
    padding: 24px 0;
    background: #ffffff;
    min-height: calc(100vh - 140px);
}

/* Price history is a page-level modal and must be above gallery/navigation layers. */
.item-detail-page .price-history-modal,
body > .price-history-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    isolation: isolate;
}

.item-detail-page .price-history-modal__scrim,
body > .price-history-modal .price-history-modal__scrim {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
}

.item-detail-page .price-history-modal__card,
body > .price-history-modal .price-history-modal__card {
    position: relative !important;
    z-index: 1 !important;
}


.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb-link {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #4b5563;
}

.breadcrumb-current {
    color: #6b7280;
}

.item-detail-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    margin-bottom: 48px;
}

.item-detail-main {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    min-width: 0;
}

.item-images__container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.item-images__thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
    min-width: 80px;
    flex-shrink: 0;
    position: relative;
}

.item-images__thumbnails::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 8px;
    height: 20px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-images__thumbnails.scrollable::after {
    opacity: 1;
}

.item-images__thumbnails::-webkit-scrollbar {
    width: 4px;
}

.item-images__thumbnails::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.item-images__thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.item-images__thumbnails::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar for Firefox */
.item-images__thumbnails {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Hide scrollbar for IE and Edge */
.item-images__thumbnails {
    -ms-overflow-style: none;
}

.item-images__main {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.item-images__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.item-images__nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.item-images__nav--prev {
    left: 16px;
}

.item-images__nav--next {
    right: 16px;
}

.item-images__nav .material-icons {
    color: #4f46e5;
    font-size: 28px;
}

.item-images__nav:hover .material-icons {
    color: #4f46e5;
}

.item-images__nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.item-images__nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.thumbnail.active,
.thumbnail:hover {
    border-color: #4f46e5;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.no-image-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f3f4f6;
    border-radius: 8px;
    color: #9ca3af;
}

.no-image-large .material-icons {
    font-size: 64px;
    margin-bottom: 16px;
}

.item-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.3;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.item-meta__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.item-meta__item .material-icons {
    font-size: 18px;
}

.item-price {
    margin-bottom: 32px;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
}

.price-negotiable {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.item-description,
.item-details {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 24px;
    min-width: 0;
    box-sizing: border-box;
}

.item-description h3,
.item-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.description-content {
    line-height: 1.6;
    color: #374151;
    font-size: 15px;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 18px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.description-hashtag {
    color: #6b7280;
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid #e5e7eb;
    display: inline-block;
    border-radius: 50px;
    margin: 2px 5px 2px 5px;
    padding: 2px 10px 2px 10px;
}

.details-grid {
    display: grid;
    gap: 12px;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 18px;
    min-width: 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

.detail-value {
    color: #111827;
    font-weight: 500;
    font-size: 15px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}


.product-info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 24px;
}

.product-info__header {
    margin-bottom: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.product-price {
    margin-bottom: 16px;
}

.product-price .price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #290e39;
}

.product-price .price-negotiable {
    font-size: 24px;
    font-weight: 600;
    color: #6b7280;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-meta__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.product-meta__item .material-icons {
    font-size: 18px;
    color: #4f46e5;
}

.contact-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 24px;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.seller-avatar {
    width: 68px;
    height: 68px;
    min-width: 68px;
    min-height: 68px;
    max-width: 68px;
    max-height: 68px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.seller-avatar .material-icons {
    font-size: 24px;
    color: #9ca3af;
}

.seller-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.seller-status {
    font-size: 14px;
    color: #6b7280;
}

.seller-last-seen {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    margin-top: 2px;
}

.contact-card__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.contact-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    border: none;
    border-radius: 50% !important;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
    color: transparent !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    flex-shrink: 0;
}

.contact-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.contact-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contact-btn .material-icons {
    display: inline-block !important;
    font-size: 28px !important;
    color: #ffffff !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    visibility: visible !important;
    font-weight: 500 !important;
}

.contact-btn--phone {
    background: #22c55e;
    color: #ffffff;
    border-color: #22c55e;
}

.contact-btn--phone:hover {
    background: #16a34a;
}


.contact-btn--message {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.contact-btn--message:hover {
    background: #6057f5;
}

.contact-btn--edit {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
}

.contact-btn--edit:hover {
    background: #d97706;
}

.contact-btn--favorite {
    background: #ec4848;
    color: #ffffff;
    border-color: #ec4848;
}

.contact-btn--favorite:hover {
    background: #fd5f5f;
    border-color: #fd5f5f;
}

.contact-btn--blog {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

.contact-btn--blog:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Button disabled state styles */
.contact-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #9ca3af !important;
}

.contact-btn--disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #9ca3af !important;
}

.contact-btn--disabled .material-icons {
    color: #ffffff !important;
}

/* Offer Actions Styles - Material 3 Design with theme adaptation */
.offer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.profile-nav-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--outline, #e5e7eb);
    border-radius: 50px;
    color: var(--on-surface, #1f2937);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.profile-nav-btn:hover {
    background: var(--surface-variant, #f8fafc);
    border-color: var(--primary, #4f46e5);
    color: var(--primary, #4f46e5);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.profile-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-nav-btn .material-icons {
    font-size: 20px;
    color: currentColor;
}

.profile-nav-btn.offer-price-btn:hover {
    background: var(--surface-variant, #f8fafc);
    border-color: var(--primary, #4f46e5);
    color: var(--primary, #4f46e5);
}

.profile-nav-btn.offer-exchange-btn:hover {
    background: var(--surface-variant, #eff6ff);
    border-color: var(--secondary, #3b82f6);
    color: var(--secondary, #1d4ed8);
}

.profile-nav-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--surface-disabled, #f5f5f5) !important;
}

/* Modal Offer Actions Styles */
.modal-offer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 0;
}

.modal-offer-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    color: #1f2937;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.modal-offer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modal-offer-btn:hover::before {
    border-color: #4f46e5;
    color: #4f46e5;
}

.modal-offer-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.modal-offer-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.modal-offer-btn .material-icons {
    font-size: 18px;
    color: currentColor;
}

.modal-offer-btn span:not(.material-icons) {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-offer-price-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    color: #1f2937;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.modal-offer-price-btn:hover {
    background: #f8fafc;
    border-color: #4f46e5;
    color: #4f46e5;
}

.modal-offer-exchange-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    color: #1f2937;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.modal-offer-exchange-btn:hover {
    background: #f8fafc;
    border-color: #4f46e5;
    color: #4f46e5;
}

.modal-offer-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #9ca3af !important;
    box-shadow: none !important;
}

.modal-offer-btn--disabled:hover {
    transform: none;
    box-shadow: none !important;
    background: #9ca3af !important;
}

/* Safety tips */
.safety-tips {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 20px;
}

.safety-tips h4 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.safety-tips ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.safety-tips li {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.safety-tips li:last-child {
    margin-bottom: 0;
}

.map-section {
    margin-top: 24px;
}

.map-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-section h4::before {
    content: "📍";
    font-size: 18px;
}

.map-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.map-info {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
}

.map-coordinates {
    font-size: 12px;
    color: #6b7280;
    font-family: monospace;
}


.related-ads {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
}

.related-ads .section-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.related-ads .items-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

/* Match recommendation cards to the detail-page section surface in dark mode. */
html[data-theme='dark'] .item-detail-page .related-ads .item-card,
html[data-theme='dark'] .item-detail-page .related-ads .item-card__link,
html[data-theme='dark'] .item-detail-page .related-ads .item-card__content {
    background-color: var(--app-surface) !important;
}

/*
 * Detail-page recommendations have their own responsive contract.
 * style.css contains a legacy global .items-grid rule with !important and
 * four columns for desktop layouts, so this scoped rule must deliberately
 * use the same priority without changing any catalog/home grids.
 */
@media (min-width: 1024px) {
    .item-detail-page .related-ads .items-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }

    .item-detail-page .related-ads .item-card {
        min-width: 0;
        max-width: none;
        width: auto;
    }
}

.item-card__title--truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 50px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .item-detail-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .item-detail-main {
        padding: 20px;
        min-width: 0;
    }
    
    .product-title {
        font-size: 20px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    .product-price .price-amount {
        font-size: 24px;
    }
    
    .product-price .price-negotiable {
        font-size: 20px;
    }
    
    .product-meta {
        gap: 8px;
    }
    
    .product-meta__item {
        font-size: 13px;
    }
    
    .item-images__container {
        flex-direction: column;
        gap: 12px;
    }
    
    .item-images__thumbnails {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: 8px;
        min-width: auto;
    }
    
    .item-images__thumbnails::-webkit-scrollbar {
        height: 4px;
        width: auto;
    }
    
    .main-image {
        height: 250px;
    }
    
    .item-images__nav {
        width: 40px;
        height: 40px;
    }
    
    .item-images__nav--prev {
        left: 12px;
    }
    
    .item-images__nav--next {
        right: 12px;
    }
    
    .item-images__nav .material-icons {
        font-size: 24px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    /* Mobile styles for description and details */
    .item-description,
    .item-details {
        padding: 16px;
        margin-bottom: 16px;
        min-width: 0;
    }
    
    .item-description h3,
    .item-details h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .description-content {
        padding: 12px;
        font-size: 14px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    
    .details-grid {
        padding: 12px;
        gap: 8px;
    }
    
    .detail-item {
        padding: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-label {
        font-size: 13px;
    }
    
    .detail-value {
        font-size: 14px;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    
    /* Mobile styles for image modal */
    .image-modal {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .image-modal__content {
        width: 100vw;
        max-width: 100vw;
        flex-direction: column;
        min-height: 100vh;
        max-height: none;
        padding: 60px 16px 24px;
        gap: 20px;
        position: relative;
    }
    
    .image-modal__main {
        order: 1;
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        flex-shrink: 0;
    }
    
    .image-modal__sidebar {
        width: 100%;
        max-width: 100%;
        max-height: none;
        order: 2;
        gap: 16px;
        overflow-y: visible;
        flex-shrink: 0;
    }
    
    .image-modal__image {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }
    
    .image-modal__close {
        position: fixed !important;
        top: 12px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(0, 0, 0, 0.8) !important;
        z-index: 10003 !important;
    }
    
    .image-modal__close .material-icons {
        font-size: 22px !important;
    }
    
    .product-info-card,
    .contact-card {
        padding: 16px;
    }
    
    .product-title {
        font-size: 18px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    .product-price .price-amount {
        font-size: 20px;
    }
    
    .contact-card__actions {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }
    
    .contact-btn {
        width: 48px;
    }
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.image-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.image-modal__content {
    position: relative;
    width: 1318px;
    max-width: 1318px;
    max-height: 95vh;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    z-index: 10001;
    gap: 24px;
    padding: 20px;
}

.image-modal__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-left: 60px;
    padding-right: 60px;
}

.image-modal__sidebar {
    width: 280px;
    max-width: 280px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-title--modal {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.image-modal__close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10003;
    backdrop-filter: blur(10px);
}

.image-modal__close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-modal__close:active {
    transform: scale(0.95);
}

.image-modal__close .material-icons {
    color: white;
    font-size: 24px;
}

.image-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10002;
}

.image-modal__nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-modal__nav--prev {
    left: 0;
}

.image-modal__nav--next {
    right: 0;
}

.image-modal__nav .material-icons {
    color: white;
    font-size: 28px;
}

.image-modal__image-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: normal;
    justify-content: center;
}

.image-modal__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: zoom-in;
    user-select: none;
    transform-origin: center center;
}

.image-modal__image.loaded {
    opacity: 1;
}

.image-modal__image.zoomed {
    transform: scale(2);
    cursor: zoom-out;
    transition: transform 0.3s ease, transform-origin 0.3s ease;
    z-index: 10004;
}

.image-modal__image.zoomed:hover {
    transform: scale(2.1);
}

/* Zoom hint tooltip */
.image-modal__zoom-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10005;
}

.image-modal__zoom-hint.show {
    opacity: 1;
}

.image-modal__zoom-hint .material-icons {
    font-size: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.image-modal__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 32px;
    animation: spin 1s linear infinite;
    z-index: 10003;
}

.image-modal__loading.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.image-modal__info {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
}

.image-modal__counter {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .image-modal__nav {
        width: 40px;
        height: 40px;
    }
    
    .image-modal__nav--prev {
        left: 10px;
    }
    
    .image-modal__nav--next {
        right: 10px;
    }
    
    .image-modal__nav .material-icons {
        font-size: 24px;
    }
    
    .image-modal__image {
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .related-ads .items-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .item-card__title--truncated {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
}
