/* Professional Product Loading Animation */

/* Loading Overlay */
.product-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.product-loading-overlay.active {
    display: flex;
}

/* Loading Container */
.product-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeInScale 0.8s ease-out;
}

/* Brand Logo */
.product-loading-brand {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #d4a574 0%, #c4956f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: fadeInScale 1s ease-out;
}

/* Loading Spinner */
.product-loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.product-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spinRing 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.product-spinner-ring:nth-child(1) {
    border-top-color: #d4a574;
    border-right-color: #d4a574;
    animation-delay: 0s;
}

.product-spinner-ring:nth-child(2) {
    border-top-color: #c4956f;
    animation-delay: -0.3s;
}

.product-spinner-ring:nth-child(3) {
    border-right-color: #8b6f47;
    animation-delay: -0.6s;
}

/* Animated Dots */
.loading-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4a574;
    animation: dotBounce 2s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Loading Text */
.product-loading-text {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    animation: fadeIn 1.2s ease-out 0.3s both;
}

.product-loading-subtext {
    color: #999;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.2px;
    animation: fadeIn 1.2s ease-out 0.6s both;
}

/* Skeleton Loading for Products Grid */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px;
    width: 100%;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: pulse 2.2s ease-in-out infinite;
}

.skeleton-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: shimmer 3s infinite;
}

.skeleton-title {
    width: 80%;
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 3s infinite;
}

.skeleton-text {
    width: 60%;
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 3s infinite;
}

.skeleton-price {
    width: 40%;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 3s infinite;
    margin-top: 4px;
}

/* Category Loading Spinner */
.category-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(212, 165, 116, 0.1);
}

.category-loading.active {
    display: flex;
}

.category-spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.category-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2.5px solid transparent;
    border-radius: 50%;
    animation: spinRing 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.category-spinner-ring:nth-child(1) {
    border-top-color: #d4a574;
    animation-delay: 0s;
}

.category-spinner-ring:nth-child(2) {
    border-top-color: #c4956f;
    animation-delay: -0.5s;
}

/* Animations */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    40% {
        transform: scale(1.4);
        opacity: 0.8;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-loading-brand {
        font-size: 28px;
    }

    .product-loading-spinner {
        width: 50px;
        height: 50px;
    }

    .product-loading-text {
        font-size: 15px;
    }

    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .category-loading {
        padding: 30px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .product-loading-brand {
        font-size: 24px;
    }

    .product-loading-spinner {
        width: 45px;
        height: 45px;
    }

    .product-loading-text {
        font-size: 14px;
    }

    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .category-loading {
        width: 90%;
        padding: 25px 20px;
    }
}
