/* Product Details Page Styling */
.product-container {
    padding: 2rem 0;
    background: #fff;
}

/* Product Images */
.product-images {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-images:hover {
    box-shadow: 0 8px 15px rgba(0,0,0,0.04);
}

.image-gallery {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.main-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
    opacity: 0;
}

.image-gallery:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

.gallery-nav.prev {
    left: 1rem;
}

.gallery-nav.next {
    right: 1rem;
}

.thumbnail-container {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumbnail-container::-webkit-scrollbar {
    display: none;
}

.thumbnail-image {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    padding: 2px;
    background: white;
    flex-shrink: 0;
}

.thumbnail-image:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.thumbnail-image.active {
    opacity: 1;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

/* Loading States */
.loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,123,255,0.1);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Product Info Section */
.product-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.product-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: #718096;
    font-size: 0.875rem;
}

/* Price Range Section */
.price-range {
    background: rgba(0,123,255,0.05);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.price-range-title {
    font-size: 1.125rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.price-value {
    color: #38a169;
    font-size: 1.25rem;
    font-weight: 600;
    direction: ltr;
    display: inline-block;
}

/* Store Comparison Table */
.price-table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.price-table th {
    background: #f8f9fa;
    color: #2d3748;
    font-weight: 600;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

.price-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.03);
    vertical-align: middle;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.store-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.store-name {
    color: #2d3748;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Price Chart Styling */
.price-chart-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.price-chart-container:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.price-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.price-chart-header h5 {
    font-size: 1.25rem;
    color: #2d3748;
    font-weight: 600;
    margin: 0;
}

.chart-legend-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #4a5568;
    transition: all 0.2s ease;
}

.chart-legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-label {
    font-weight: 500;
}

.price-chart-wrapper {
    height: 400px;
    position: relative;
}

.no-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #718096;
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Features Section */
.features-container {
    display: grid;
    gap: 1.5rem;
}

.feature-group {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.feature-group:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.feature-group-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.feature-group-header h6 {
    color: #2d3748;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.feature-count {
    background: rgba(0,123,255,0.1);
    color: #007bff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.feature-list {
    padding: 1rem 1.5rem;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

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

.feature-name {
    color: #718096;
    font-size: 0.875rem;
    padding-left: 1rem;
    flex: 1;
}

.feature-value {
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    flex: 2;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,123,255,0.2);
}

.btn-outline-primary {
    border: 1px solid #007bff;
    color: #007bff;
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

/* Social Share */
.social-share {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.share-button {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .product-container {
        padding: 1rem 0;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .thumbnail-image {
        width: 48px;
        height: 48px;
    }

    .price-table th,
    .price-table td {
        padding: 0.75rem 1rem;
    }

    .price-chart {
        height: 300px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .social-share {
        flex-wrap: wrap;
    }

    .share-button {
        flex: 1;
        justify-content: center;
    }
}

/* Loading States & Animations */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skeleton.visible {
    opacity: 1;
}

.loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    transition: all 0.3s ease;
}

.loading-placeholder.visible {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,123,255,0.1);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animated Elements */
.image-gallery {
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.features-container {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.thumbnail-image,
.feature-group {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease forwards;
    will-change: opacity, transform;
}

.feature-item {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    animation-delay: 0.1s;
}

.feature-count {
    opacity: 0;
    transform: scale(0.9);
    animation: popIn 0.3s ease forwards;
    animation-delay: 0.2s;
}

/* Staggered Animation Delays */
.thumbnail-image:nth-child(1),
.feature-group:nth-child(1) { animation-delay: 0.1s; }

.thumbnail-image:nth-child(2),
.feature-group:nth-child(2) { animation-delay: 0.2s; }

.thumbnail-image:nth-child(3),
.feature-group:nth-child(3) { animation-delay: 0.3s; }

.thumbnail-image:nth-child(4),
.feature-group:nth-child(4) { animation-delay: 0.4s; }

.thumbnail-image:nth-child(5),
.feature-group:nth-child(5) { animation-delay: 0.5s; }

/* Print Styles */
@media print {
    .social-share,
    .action-buttons {
        display: none !important;
    }

    .product-images,
    .product-info,
    .price-table,
    .features-section {
        box-shadow: none !important;
        border: 1px solid #eee;
    }

    .price-chart {
        break-before: page;
    }
}
