
/* Modern edge-to-edge design */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

main.container {
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    background: white;
}

/* Header */
.item-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.shop-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #eee;
}

.shop-name {
    font-weight: 600;
    font-size: 16px;
}

/* Item title */
.item-title {
    padding: 0 15px;
    margin: 15px 0;
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

/* Media container */
.item-media-container {
    width: 100%;
    margin: 0;
    position: relative;
}

.item-image, .item-video {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    background: #000;
}

.item-video {
    background: black;
}

/* Action bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.action-icons {
    display: flex;
    gap: 15px;
}

.action-icon {
    font-size: 24px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon:hover {
    transform: scale(1.1);
}

.heart-icon.liked {
    color: #ff2e63;
}

.item-price {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

/* Item details */
.item-details {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.item-description {
    margin-bottom: 15px;
    font-size: 16px;
    color: #444;
}

.item-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.owner-message {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.contact-button {
    background: #4CAF50;
    color: white;
}

.chat-button {
    background: #2196F3;
    color: white;
}

.edit-button {
    background: #FF9800;
    color: white;
    width: 100%;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Gallery */
.gallery-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #222;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.thumbnail {
    width: calc(33.33% - 5px);
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.thumbnail:hover {
    transform: scale(1.02);
}

.no-images {
    color: #888;
    font-style: italic;
}

/* Related items */
.related-items {
    padding: 15px;
}

.related-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-item {
    width: calc(50% - 5px);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.related-item:hover {
    transform: translateY(-3px);
}

.related-item-image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

.related-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-item-info {
    padding: 8px 0;
}

.related-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

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

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
}

.modal-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

#prev-image {
    left: 20px;
}

#next-image {
    right: 20px;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid #eee;
    z-index: 100;
}

.nav-icon {
    font-size: 20px;
    color: #555;
}

/* Message */
.message {
    padding: 10px 15px;
    margin: 10px 15px;
    border-radius: 5px;
    background: #f0f0f0;
    text-align: center;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    main.container {
        max-width: 600px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin: 20px auto;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .related-item {
        width: calc(33.33% - 7px);
    }
}