﻿/* Base Skeleton Styles */
.product-detail-skeleton {
    animation: fadeIn 0.3s ease-in;
}

/* ==========================================================================
   Top Banner Skeleton
   ========================================================================== */
.top-banner-skeleton-section {
    height: 500px;
    display: flex;
    justify-content: center;
    background-color: #f4f4f4;
    position: relative;
    overflow: hidden;
}

.skeleton-banner {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient( 90deg, #f0f0f0 0%, #f8f8f8 20%, #f0f0f0 40%, #f0f0f0 100% );
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Skeleton Elements */
.skeleton-text {
    background: #e0e0e0;
    border-radius: 4px;
    height: 16px;
    position: relative;
    overflow: hidden;
}

    .skeleton-text::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        height: 100%;
        width: 100%;
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.5), transparent );
        animation: loading 1.5s infinite;
    }

@keyframes loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Specific Skeleton Sizes */
.skeleton-breadcrumb {
    width: 200px;
    height: 12px;
}

.skeleton-category {
    width: 150px;
    height: 14px;
}

.skeleton-title {
    width: 80%;
    height: 32px;
}

.skeleton-price {
    width: 200px;
    height: 36px;
}

.skeleton-subprice {
    width: 150px;
    height: 14px;
}

.skeleton-stock {
    width: 120px;
    height: 20px;
}

.skeleton-desc-line {
    width: 100%;
    height: 14px;
}

.skeleton-desc-line-short {
    width: 60%;
    height: 14px;
}

.skeleton-label {
    width: 80px;
    height: 14px;
}

.skeleton-input {
    width: 150px;
    height: 42px;
}

.skeleton-button {
    height: 48px;
    border-radius: 6px;
    background: #e0e0e0;
}

.skeleton-button-primary {
    flex: 1;
}

.skeleton-button-secondary {
    width: 48px;
}

.skeleton-info-row {
    width: 100%;
    height: 40px;
}

.skeleton-tab {
    width: 100px;
    height: 24px;
}

.skeleton-content-line {
    width: 100%;
    height: 14px;
}

.skeleton-section-title {
    width: 200px;
    height: 28px;
    margin: 0 auto;
}

/* Gallery Skeleton */
.skeleton-main-image {
    width: 100%;
    padding-bottom: 100%;
    background: #e0e0e0;
    border-radius: 8px;
    position: relative;
}

.skeleton-thumbnails {
    display: flex;
    gap: 8px;
}

.skeleton-thumbnail {
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Product Card Skeleton */
.skeleton-product-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.skeleton-product-image {
    width: 100%;
    padding-bottom: 100%;
    background: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-product-title {
    width: 100%;
    height: 18px;
}

.skeleton-product-price {
    width: 60%;
    height: 20px;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .skeleton-title {
        width: 100%;
        height: 24px;
    }

    .skeleton-price {
        width: 150px;
        height: 28px;
    }

    .skeleton-button-primary {
        width: 100%;
    }
}

/* Dark Mode Support */
body.dark .skeleton-text,
body.dark .skeleton-main-image,
body.dark .skeleton-thumbnail,
body.dark .skeleton-button,
body.dark .skeleton-product-image {
    background: #2a2a2a;
}

body.dark .skeleton-shimmer {
    background: linear-gradient( 90deg, #2a2a2a 0%, #333 20%, #2a2a2a 40%, #2a2a2a 100% );
}

body.dark .skeleton-product-card {
    background: #1a1a1a;
}

/* Smooth transitions */
.skeleton-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}
