/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.4;
    padding: 1.5rem;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* ==================== HEADER & SHOP HEADER ==================== */
.shop-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding-bottom: 1.25rem;
}

@media (min-width: 769px) {
    .shop-header {
        border-bottom: 1px #ededed solid;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .shop-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.title-badge h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #2d3a4e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

.title-badge p {
    font-size: 0.9rem;
    color: #475569;
    margin-top: 0.25rem;
}

.stats {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
}

.stats span {
    font-weight: 700;
    color: #0f3b5c;
}

/* ==================== BACK BUTTON ==================== */
.back-to-market {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    color: #6366f1;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.back-to-market:hover {
    color: #4f46e5;
    transform: translateX(-4px);
}

.back-to-market:active {
    transform: translateX(0);
}

/* ==================== PRODUCT GRID & CARDS ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
    margin-top: 0.5rem;
}

.product-card {
    background: #ffffff;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #edf2f7;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.12), 0 4px 8px -4px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

/* ==================== SLIDER STYLES (Shared across all pages) ==================== */
.img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .img-wrapper {
    height: 250px;
    cursor: pointer;
}

.slider-container {
    position: relative;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    height: 100%;
}

.slider-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: grab;
    will-change: transform;
    width: 100%;
    height: 100%;
    align-items: center;
}

.slider-track.dragging {
    transition: none;
    cursor: grabbing;
}

.slider-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Ensure slider container takes full height of img-wrapper */
.img-wrapper .slider-container {
    height: 100%;
    width: 100%;
}

/* Slider navigation buttons - hidden on mobile, shown on desktop */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
    transition: all 0.2s;
}

.slider-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(0, 0, 0, 0.8);
}

.slider-btn-prev {
    left: 8px;
}

.slider-btn-next {
    right: 8px;
}

.slider-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.image-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
}

/* ==================== DOT INDICATORS FOR MOBILE ==================== */
.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 20;
    pointer-events: auto;
    padding: 8px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    border: none;
    margin: 0;
    display: block;
}

.slider-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
	border: 1px #1e40af solid;
}

.slider-dot:active {
    transform: scale(1.2);
}

/* Product card hover effect for slider buttons */
.product-card .img-wrapper:hover .slider-btn {
    opacity: 1;
}

/* Mobile styles - hide arrows, show dots */
@media (max-width: 768px) {
    .slider-btn {
        display: none !important;
    }
    
    .image-counter {
        display: none !important;
    }
    
    .slider-dots {
        display: flex !important;
    }
}

/* Desktop styles - show arrows, hide dots */
@media (min-width: 769px) {
    .slider-btn {
        display: flex !important;
    }
    
    .image-counter {
        display: block !important;
    }
    
    .slider-dots {
        display: none !important;
    }
}

/* ==================== PRODUCT INFO ==================== */
.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    width: fit-content;
    margin-bottom: 0.7rem;
    background: #eef2ff;
    color: #1e40af;
}

/* ==================== CREATOR SECTION ==================== */
.creator-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 8px;
}

.creator-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    cursor: pointer;
}

.creator-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.creator-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
}

.creator-badge {
    font-size: 0.7rem;
    color: #64748b;
    display: inline-block;
    width: fit-content;
}

/* ==================== FOLLOW BUTTON ==================== */
.follow-btn {
    background: none;
    border: 1px solid #6366f1;
    color: #6366f1;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-btn:hover {
    background: #6366f1;
    color: white;
}

.follow-btn.following {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* ==================== HEART LIKE SECTION ==================== */
.heart-like-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.heart-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 50%;
    line-height: 1;
}

.heart-button:hover {
    transform: scale(1.12);
}

.heart-button:active {
    transform: scale(0.92);
}

.heart-icon {
    transition: all 0.1s ease;
    display: inline-block;
}

.heart-icon.liked {
    color: #e11d48;
    filter: drop-shadow(0 1px 2px rgba(225, 29, 72, 0.2));
}

.like-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 40px;
    letter-spacing: -0.2px;
}

/* ==================== ACTION BUTTON ==================== */
.btn-dummy {
    margin-top: 0.8rem;
    width: 100%;
    background: #f8fafc;
    border: none;
    padding: 0.55rem 0;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    text-align: center;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    transition: 0.1s;
    cursor: pointer;
}

/* ==================== FOOTER ==================== */
.footer-note {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: #5b6e8c;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.8rem;
}

/* ==================== LOADING & SCROLL SENTINEL ==================== */
.scroll-sentinel {
    grid-column: 1/-1;
    height: 60px;
    width: 100%;
    visibility: visible;
    pointer-events: none;
}

.loading-indicator {
    grid-column: 1/-1;
    text-align: center;
    padding: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== ERROR STATES ==================== */
.error-message {
    grid-column: 1/-1;
    text-align: center;
    padding: 3rem;
    color: #e11d48;
    background: #fef2f2;
    border-radius: 1rem;
    margin: 1rem;
}

.error-container {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1.5rem;
    margin-top: 2rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.8rem;
    color: #e11d48;
    margin-bottom: 1rem;
}

.error-message-text {
    color: #64748b;
    margin-bottom: 2rem;
}

/* ==================== PROFILE PAGE STYLES ==================== */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

.profile-info {
    color: white;
    flex: 1;
}

.profile-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
}

.profile-stats {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* Profile Follow Button */
.profile-follow-btn {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.profile-follow-btn:hover {
    background: white;
    color: #6366f1;
    transform: scale(1.02);
}

.profile-follow-btn:active {
    transform: scale(0.98);
}

.profile-follow-btn.following {
    background: white;
    color: #6366f1;
    border-color: white;
}

.profile-follow-btn.following:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #4f46e5;
}

/* Mobile styles for profile header */
@media (max-width: 768px) {
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-avatar {
        width: 70px;
        height: 70px;
    }
    
    .profile-header-content {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 1rem;
        align-items: center;
    }
    
    .profile-avatar {
        grid-row: 1 / 2;
        grid-column: 1 / 2;
    }
    
    .profile-info {
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        text-align: left;
        flex: none;
    }
    
    .profile-follow-btn {
        grid-row: 2 / 3;
        grid-column: 1 / 3;
        justify-self: stretch;
        width: 100%;
        text-align: center;
    }
}

/* ==================== PRODUCT DETAIL PAGE STYLES ==================== */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Product detail image wrapper */
.product-detail-container .img-wrapper {
    height: 500px;
    touch-action: pan-y pinch-zoom;
    -webkit-tap-highlight-color: transparent;
}

/* Product detail slider images - clickable for modal */
.product-detail-container .slider-track img {
    pointer-events: auto;
    cursor: pointer;
}

/* Product info section */
.product-detail-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
    line-height: 1.3;
}

/* Detail creator section */
.detail-creator-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin: 1rem 0;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-creator-section:hover {
    background: #f8fafc;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Detail description */
.detail-description {
    margin: 1rem 0;
    padding: 1rem 0;
	margin-top: 0px;
	padding-top: 10px;
}

.detail-description h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.detail-description p {
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Desktop view for product detail */
@media (min-width: 769px) {
    .product-detail-container .img-wrapper {
        margin: 1rem;
        height: calc(500px - 2rem);
        border-radius: 1rem;
        overflow: hidden;
    }
    
    .product-detail-container .slider-container {
        border-radius: 1rem;
    }
    
    .product-detail-info {
        padding: 2rem 2rem 2rem 0;
    }
}

/* ==================== EXCHANGE MODAL STYLES ==================== */
.exchange-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.2s ease-out;
}

.exchange-modal.active {
    display: flex;
}

.exchange-modal-content {
    background: white;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.exchange-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.exchange-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.exchange-modal-header p {
    color: #64748b;
    font-size: 0.9rem;
}

.exchange-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.exchange-close:hover {
    background: #f1f5f9;
    color: #e11d48;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    background: #f8fafc;
    color: #1e293b;
}

.social-btn:hover {
    transform: translateY(-3px);
}

.social-btn:active {
    transform: translateY(0);
}

.social-icon {
    font-size: 2rem;
}

.threads-icon {
    width: 32px;
    height: 32px;
}

.social-btn.instagram {
    background: linear-gradient(135deg, #feda77, #f58529, #dd2a7b, #8134af, #515bd4);
    color: white;
}

.social-btn.threads {
    background: #000000;
    color: white;
}

.social-btn.facebook {
    background: #1877f2;
    color: white;
}

.social-btn.line {
    background: #00b900;
    color: white;
}

.social-btn .platform-name {
    font-size: 0.85rem;
}

.exchange-note {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ==================== IMAGE MODAL (Enlarged Image) ==================== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
    animation: modalFadeIn 0.2s ease-out;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y pinch-zoom;
}

.modal-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    pointer-events: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.modal-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2010;
}

.modal-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.modal-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2010;
}

.modal-close:hover {
    background: #e11d48;
    transform: scale(1.05);
}

.modal-counter {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.9rem;
    z-index: 2010;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet and mobile */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .app-container {
        padding: 0.5rem;
    }
    
    .back-to-market {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .profile-follow-btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
    
    /* Product detail mobile */
    .product-detail-container {
        grid-template-columns: 1fr;
        border-radius: 1rem;
		margin-bottom:50px;
    }
    
    .product-detail-container .img-wrapper {
        margin: 0;
        height: 350px;
        border-radius: 0;
    }
    
    .product-detail-container .slider-container {
        border-radius: 0;
    }
    
    .product-detail-info {
        padding: 1.5rem;
    }
    
    .detail-title {
        font-size: 1.3rem;
    }
    
    /* Modal mobile */
    .modal-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 28px;
        top: 15px;
        right: 15px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-counter {
        bottom: 15px;
        font-size: 0.8rem;
        padding: 4px 12px;
    }
    
    /* Exchange modal mobile */
    .exchange-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .social-grid {
        gap: 0.75rem;
    }
    
    .social-btn {
        padding: 0.75rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .back-to-market {
        font-size: 0.85rem;
    }
    
    .profile-follow-btn {
        padding: 5px 14px;
        font-size: 0.75rem;
    }
    
    .creator-avatar {
        width: 40px;
        height: 40px;
    }
    
    .stats {
        align-self: flex-start;
    }
    
    /* Product detail small mobile */
    .product-detail-container .img-wrapper {
        height: 280px;
    }
    
    .product-detail-info {
        padding: 1rem;
    }
    
    .detail-title {
        font-size: 1.2rem;
    }
    
    .detail-creator-section {
        padding: 0.75rem 0;
    }
}