/* Shop Section Styles */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#backFromShopBtn {
    margin-left: 70px;
    max-width:100px;
    padding: 8px 16px;
    border: none;
    background: #88887b;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.shop-subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    text-align: center;
}

body.dark-theme .shop-subtitle {
    color: #aaa;
}

.shop-controls {
    margin-bottom: 20px;
}

.shop-search {
    position: relative;
    margin-bottom: 15px;
}

.shop-search input {
    width: 100%;
    padding: 12px 40px 12px 20px;
    border-radius: 25px;
    border: 1px solid #ddd;
    font-size: 16px;
}

body.dark-theme .shop-search input {
    background: #444;
    border-color: #555;
    color: white;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: #666;
}

.shop-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.shop-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: #333;
}

.shop-filter-btn.active {
    background: #88887b;
    color: white;
    border-color: #88887b;
}

.shop-filter-btn:hover:not(.active) {
    background: #f5f5f5;
}

body.dark-theme .shop-filter-btn {
    background: #444;
    border-color: #555;
    color: white;
}

body.dark-theme .shop-filter-btn:hover:not(.active) {
    background: #555;
}

.shop-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #666;
}

.shop-sorting select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
}

body.dark-theme .shop-sorting select {
    background: #444;
    border-color: #555;
    color: white;
}

body.dark-theme .shop-sorting {
    color: #aaa;
}

/* Product Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.product-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

body.dark-theme .product-card {
    background: rgba(50, 50, 50, 0.8);
    border-color: #444;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #7c7c7c;
}

body.dark-theme .product-image-container {
    background-color: #4f4f4f;
}


.product-image-container::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' opacity='0.70'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
    opacity: 0.50;
    mix-blend-mode: overlay;
    animation: noise 10s steps(10) infinite;
}

/* Dark theme adjustment */
body.dark-theme .product-image-container::before {
    opacity: 0.35;
    mix-blend-mode: screen;
}

/* Optional: Add a subtle vignette for depth */
.product-image-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
}

body.dark-theme .product-image-container::after {
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0.4;
}

#productMainImage::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' opacity='0.70'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
    opacity: 0.50;
    mix-blend-mode: overlay;
    animation: noise 10s steps(10) infinite;
}

/* Dark theme adjustment */
body.dark-theme #productMainImage::before {
    opacity: 0.35;
    mix-blend-mode: screen;
}


@keyframes noise {
		0% {
			transform: translate3d(0, 2rem, 0);
		}

		10% {
			transform: translate3d(-1rem, -2rem, 0);
		}

		20% {
			transform: translate3d(-4rem, 1rem, 0);
		}

		30% {
			transform: translate3d(4.5rem, -4.5rem, 0);
		}

		40% {
			transform: translate3d(-1rem, 3.5rem, 0);
		}

		50% {
			transform: translate3d(-4.5rem, -2rem, 0);
		}

		60% {
			transform: translate3d(1rem, 3rem, 0);
		}

		70% {
			transform: translate3d(3.5rem, -4rem, 0);
		}

		80% {
			transform: translate3d(-4.5rem, 0.5rem, 0);
		}

		90% {
			transform: translate3d(3rem, -2.5rem, 0);
		}

		to {
			transform: translate3d(-3.5rem, 0, 0);
		}
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s ease;
}

.product-card{
    background: #e6e6e6;
}

body.dark-theme .product-card {
    background-color: #4f4f4f;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description-short {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .product-description-short {
    color: #aaa;
}

.product-price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #f39c12;
}

.stars {
    color: #f39c12;
    letter-spacing: -2px;
}

.rating-count {
    color: #666;
    margin-left: 4px;
}

body.dark-theme .rating-count {
    color: #aaa;
}

/* Platform badges */
.platform-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    z-index: 2;
}

.amazon-badge {
    background: #ff9900; /* Amazon orange */
}

.aliexpress-badge {
    background: #ff6b00; /* AliExpress orange */
}

/* Affiliate indicator next to price */
.affiliate-indicator {
    font-size: 0.6rem;
    background: #6ab1b200;
    color: rgb(0, 0, 0);
    padding: 2px 6px;
    border-radius: 3px;
    text-align: right;
    margin-right: 5px;
    width: fit-content;
    vertical-align: middle;
}

body.dark-theme .affiliate-indicator {
    color: #fbfbfb;
}

/* Shop compliance banner */
.shop-compliance-banner {
    background: #f0f8ff;
    border-left: 4px solid #3498db;
    padding: 12px;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3e50;
}

body.dark-theme .shop-compliance-banner {
    background: #2c3e50;
    color: #ecf0f1;
}

/* Product Detail Modal */
.product-detail {
    max-width: 900px;
    display: flex;
    gap: 30px;
    padding: 0;
}

.product-detail-images {
    flex: 1;
    min-width: 300px;
}

.product-main-image {
    width: 100%;
    height: 400px;
    background: #7c7c7c;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.dark-theme .product-main-image {
    background: #4f4f4f;
}

.product-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    background: #f8f8f8;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 5px;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: #88887b;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-info {
    flex: 1;
    padding: 20px 20px 20px 0;
}

.product-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f1f1;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

body.dark-theme .product-category {
    background: #333;
    color: #aaa;
}

.product-detail-info h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
}

.product-detail .product-price {
    font-size: 28px;
    margin: 15px 0;
}

.product-detail .product-description {
    line-height: 1.6;
    margin: 20px 0;
    color: #333;
}

body.dark-theme .product-detail .product-description {
    color: #ddd;
}

.product-specs {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

body.dark-theme .product-specs {
    background: #333;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.spec-item:last-child {
    margin-bottom: 0;
}

.spec-label {
    color: #666;
    font-weight: 500;
}

body.dark-theme .spec-label {
    color: #aaa;
}

.spec-value {
    color: #333;
    font-weight: 600;
}

body.dark-theme .spec-value {
    color: #ddd;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin: 25px 0;
}

.primary-btn {
    flex: 1;
    padding: 14px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.primary-btn:hover {
    background: #ff5252;
}

.secondary-btn {
    flex: 1;
    padding: 14px 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.secondary-btn:hover {
    background: #555;
}

.affiliate-disclaimer {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    padding: 10px;
    background: #fff8e1;
    border-radius: 5px;
    margin-top: 20px;
    border-left: 3px solid #ffd54f;
}

body.dark-theme .affiliate-disclaimer {
    background: #3e3e2e;
    color: #ddd;
    border-left-color: #ffd54f;
}

.external-icon {
    font-size: 14px;
}

/* Loading & Empty States */
.shop-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.shop-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

body.dark-theme .shop-loading,
body.dark-theme .shop-empty {
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .product-detail-images {
        min-width: 100%;
    }
    
    .product-main-image {
        height: 300px;
    }
    
    .product-detail-info {
        padding: 20px;
    }
    
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
    }
}