/**
 * ============================================================================
 * GURABASNEED ULTRA-PREMIUM GLOBAL SKELETON ENGINE (CSS)
 * High-Performance, Vibrant Shining/Shimmer Wave, Zero-Layout-Shift System
 * ============================================================================
 */

:root {
    --gb-skel-bg: #e2e8f0;
    --gb-skel-bg-subtle: #edf2f7;
    --gb-skel-radius: 8px;
    --gb-skel-card-border: #e2e8f0;
}

/* Base Skeleton Element with High-Gloss Shining Animation */
.gb-skeleton,
.skeleton-placeholder,
.skeleton-img,
.skeleton-text,
.skeleton-price,
.skeleton-btn {
    background-color: var(--gb-skel-bg);
    position: relative;
    overflow: hidden;
    border-radius: var(--gb-skel-radius);
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

/* 🌟 Ultra-Vivid Shining Wave Sweeping Across */
.gb-skeleton::after,
.skeleton-placeholder::after,
.shimmer-load::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 20%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0.35) 80%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: gb-shimmer-sweep 1.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    pointer-events: none;
}

@keyframes gb-shimmer-sweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Reduced-Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gb-skeleton::after,
    .skeleton-placeholder::after,
    .shimmer-load::after {
        animation: none !important;
        background: none !important;
    }
}

/* --------------------------------------------------------------------------
 * Container Transitions & Cross-fade
 * -------------------------------------------------------------------------- */
.gb-skeleton-wrapper {
    width: 100%;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    display: block;
}

.gb-skeleton-wrapper.gb-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.gb-content-wrapper {
    width: 100%;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gb-content-wrapper.gb-init-loading {
    display: none;
    opacity: 0;
}

.gb-content-wrapper.gb-loaded {
    display: block !important;
    opacity: 1 !important;
}

/* --------------------------------------------------------------------------
 * 1. Geometric Primitives
 * -------------------------------------------------------------------------- */
.gb-skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}
.gb-skeleton-text.short {
    width: 60%;
}
.gb-skeleton-text.medium {
    width: 80%;
}
.gb-skeleton-text.long {
    width: 100%;
}

.gb-skeleton-title {
    height: 24px;
    width: 85%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.gb-skeleton-price {
    height: 22px;
    width: 45%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.gb-skeleton-btn {
    height: 38px;
    width: 100%;
    border-radius: 8px;
}

.gb-skeleton-pill {
    height: 32px;
    width: 65px;
    border-radius: 20px;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
 * 2. Product Card Skeleton (Matches .product_item on Mobile & Desktop)
 * -------------------------------------------------------------------------- */
.gb-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .gb-skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 992px) {
    .gb-skeleton-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1200px) {
    .gb-skeleton-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }
}

.gb-skeleton-card {
    background: #ffffff;
    border: 1px solid var(--gb-skel-card-border);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.gb-skeleton-card .gb-skeleton-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    margin-bottom: 10px;
}

.gb-skeleton-card .gb-skeleton-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gb-skeleton-card .gb-skeleton-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
 * 3. Hero & Banner Skeletons
 * -------------------------------------------------------------------------- */
.gb-skeleton-hero {
    width: 100%;
    aspect-ratio: 2054 / 766;
    height: auto;
    max-height: 380px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .gb-skeleton-hero {
        aspect-ratio: 2054 / 766;
        height: auto;
        border-radius: 8px;
    }
}

.gb-slider-skeleton-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.gb-slider-skeleton-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    display: inline-block;
}

.gb-slider-skeleton-dots span.active {
    width: 18px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.32);
}

.gb-skeleton-category-icons {
    display: flex;
    gap: 12px;
    overflow-x: hidden;
    padding: 10px 0;
    margin-bottom: 20px;
}

.gb-skeleton-cat-item {
    flex: 0 0 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gb-skeleton-cat-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.gb-skeleton-cat-label {
    width: 50px;
    height: 10px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
 * 4. Product Details Skeleton (Exact Reference Match to Details Page)
 * -------------------------------------------------------------------------- */
.gb-skeleton-details {
    padding: 15px 0;
}

.gb-skeleton-main-img {
    width: 100%;
    height: 460px;
    border-radius: 12px;
    margin-bottom: 15px;
}

@media (max-width: 767px) {
    .gb-skeleton-main-img {
        height: 300px;
        border-radius: 8px;
    }
}

.gb-skeleton-thumbs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.gb-skeleton-thumb {
    width: 75px;
    height: 75px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
 * 5. Catalog Sidebar, Checkout & Cart Skeletons
 * -------------------------------------------------------------------------- */
.gb-skeleton-sidebar {
    background: #ffffff;
    border: 1px solid var(--gb-skel-card-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.gb-skeleton-checkout-form {
    background: #ffffff;
    border: 1px solid var(--gb-skel-card-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.gb-skeleton-input {
    height: 44px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.gb-skeleton-table-row {
    height: 48px;
    width: 100%;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
 * 6. Global Top Navigation Progress Indicator (Sleek Black Brand Styling)
 * -------------------------------------------------------------------------- */
#gb-top-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #111827 0%, #000000 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    width: 0%;
    opacity: 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    pointer-events: none;
    transform: translateZ(0);
}

/* Mobile & Tablet Ultra-Smooth Rendering Hints */
@media (max-width: 991px) {
    .gb-skeleton-wrapper,
    .gb-content-wrapper {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}
