/* Base Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #fafafa;
    color: #262626;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.marketplace-container {
    max-width: 935px;
    margin: 0 auto;
    padding: 20px;
}

/* Instagram-style Header */
.marketplace-header {
    background-color: white;
    border-bottom: 1px solid #dbdbdb;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 935px;
    margin: 0 auto;
    padding: 0 20px;
}

.marketplace-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(45deg, #405DE6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.header-icons {
    display: flex;
    gap: 20px;
}

.header-icons i {
    font-size: 22px;
    color: #262626;
    cursor: pointer;
}

/* Instagram Card */
.instagram-card {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
}

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

.default-avatar {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details strong {
    font-weight: 600;
    font-size: 14px;
}

.post-location {
    font-size: 12px;
    color: #8e8e8e;
}

.post-options i {
    color: #262626;
    cursor: pointer;
}

/* Media Content */
.post-media {
    width: 100%;
    background-color: #000;
}

.instagram-image-container {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
}

.instagram-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.instagram-video-container {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
}

.instagram-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.unsupported-media {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    background-color: #f0f0f0;
}

.unsupported-media i {
    font-size: 50px;
    margin-bottom: 15px;
}

/* Engagement Buttons */
.engagement-buttons {
    padding: 6px 16px;
    display: flex;
    align-items: center;
}

.engagement-btn {
    background: none;
    border: none;
    font-size: 24px;
    margin-right: 16px;
    padding: 8px;
    cursor: pointer;
    color: #262626;
}

.engagement-btn .fas.fa-heart {
    color: #ed4956;
}

.share-btn {
    margin-left: auto;
    margin-right: 0;
}

/* Post Details */
.post-details {
    padding: 0 16px 8px;
}

.likes-count {
    margin-bottom: 8px;
}

.likes-count strong {
    font-weight: 600;
    font-size: 14px;
}

.post-description {
    margin-bottom: 8px;
    font-size: 14px;
}

.username {
    font-weight: 600;
    margin-right: 5px;
}

.view-comments {
    margin-bottom: 8px;
}

.view-all {
    color: #8e8e8e;
    font-size: 14px;
    text-decoration: none;
}

.post-time {
    color: #8e8e8e;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Comment Box */
.comment-box {
    border-top: 1px solid #efefef;
    padding: 16px;
    display: flex;
    align-items: center;
}

.comment-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

.post-comment-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.3;
}

.comment-input:not(:placeholder-shown) + .post-comment-btn {
    opacity: 1;
}

/* Marketplace Details */
.marketplace-details {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.price-section {
    margin-bottom: 20px;
}

.item-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    font-family: 'Montserrat', sans-serif;
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.discounted-price {
    font-size: 22px;
    font-weight: 700;
    color: #ed4956;
}

.discount-badge {
    background-color: #ed4956;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn i {
    font-size: 16px;
}

.contact-btn {
    background-color: #0095f6;
    color: white;
}

.offer-btn {
    background-color: #f56040;
    color: white;
}

.wishlist-btn {
    background-color: transparent;
    border: 1px solid #dbdbdb;
    color: #262626;
}

.edit-btn {
    background-color: #3897f0;
    color: white;
}

.delete-btn {
    background-color: #ed4956;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Product Info */
.product-info {
    margin: 25px 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
}

.info-label {
    color: #8e8e8e;
}

.info-value {
    font-weight: 500;
}

/* Seller Info */
.seller-card {
    display: flex;
    align-items: center;
    background-color: #fafafa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.seller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
}

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

.default-avatar.seller {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 20px;
}

.seller-details {
    flex-grow: 1;
}

.seller-rating {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.seller-rating i {
    color: #f5a623;
    font-size: 14px;
    margin-right: 5px;
}

.seller-rating span {
    font-size: 12px;
    color: #8e8e8e;
}

.seller-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #8e8e8e;
}

.seller-stats strong {
    color: #262626;
}

.view-profile-btn {
    background-color: #efefef;
    color: #262626;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.view-profile-btn:hover {
    background-color: #dbdbdb;
}

/* Instagram Gallery */
.instagram-gallery {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.gallery-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    font-family: 'Montserrat', sans-serif;
}

.gallery-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
}

.gallery-item {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

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

.empty-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #8e8e8e;
}

.empty-gallery i {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Related Items */
.related-items {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-card {
    border: 1px solid #efefef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #ed4956;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-info h4 {
    font-size: 14px;
    margin: 0 0 5px 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 5px;
}

.current-price {
    font-weight: 600;
    color: #262626;
}

.original-price {
    font-size: 12px;
    color: #8e8e8e;
    text-decoration: line-through;
}

.product-location {
    font-size: 12px;
    color: #8e8e8e;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
}

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

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
}

.modal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 80vh;
}

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

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

.modal-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

#prev-image {
    left: 20px;
}

#next-image {
    right: 20px;
}

.modal-caption {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #efefef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .marketplace-container {
        padding: 10px;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-nav {
        height: 60vh;
    }
    
    .modal-image {
        max-height: 60vh;
    }
}

/* Alerts */
.instagram-alert {
    background-color: #fafafa;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: center;
    color: #262626;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.instagram-card, .marketplace-details, .instagram-gallery, .related-items {
    animation: fadeIn 0.5s ease-out;
}

/* Base Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #fafafa;
    color: #262626;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Force full width on mobile */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Main container - edge-to-edge on mobile */
.marketplace-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 20px;
}

/* Full-width components */
.marketplace-header,
.instagram-card,
.marketplace-details,
.instagram-gallery,
.related-items {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.marketplace-header {
    padding: 15px 0;
}

/* Desktop styles - revert to centered layout */
@media (min-width: 768px) {
    .marketplace-container,
    .marketplace-header,
    .instagram-card,
    .marketplace-details,
    .instagram-gallery,
    .related-items {
        width: auto;
        margin-left: auto;
    }
    
    .marketplace-container {
        max-width: 935px;
        margin: 0 auto;
    }
}

/* All your existing styles below remain exactly the same */
/* ... rest of your CSS ... */