/* ==================== SEARCH RESULTS SKELETON ==================== */
.search-results-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

@media (max-width: 1200px) {
    .search-results-skeleton {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-results-skeleton {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .search-results-skeleton {
        grid-template-columns: 1fr;
    }
}

/* ==================== SKELETON SCREENS ==================== */

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Product Skeleton - Match Product Card Exactly */
.product-skeleton {
    background: var(--card-background);
    border-radius: 15px; /* Match product-card border-radius */
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); /* Match product-card box-shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex !important; /* Force flex display */
    flex-direction: column;
    min-height: 400px; /* Match product-card min-height */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
    /* Force box-sizing on all child elements */
}

.product-skeleton * {
    box-sizing: border-box;
}

.skeleton-image {
    width: 100%;
    flex: 0 0 70%; /* Match product-image flex: 0 0 70% */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.skeleton-content {
    padding: 10px; /* Match product-info padding */
    display: flex;
    flex-direction: column;
    flex: 1; /* Match product-info flex: 1 */
    gap: 0; /* Remove gap, use margins instead */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.skeleton-line {
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    box-sizing: border-box;
    max-width: 100%;
}

.skeleton-title {
    width: 80%;
    min-height: 34px; /* Match product-name min-height */
    height: 34px;
    margin-bottom: 8px; /* Match product-name margin-bottom */
}

.skeleton-rating {
    width: 60%;
    min-height: 18px; /* Match product-rating min-height */
    height: 18px;
    margin-bottom: 8px; /* Match product-rating margin-bottom */
}

.skeleton-spacer {
    flex: 1; /* Match product-spacer flex: 1 */
    min-height: 1px;
}

.skeleton-price {
    width: 60%;
    height: 20px;
    margin-top: auto; /* Match product-price-section margin-top: auto */
}

.skeleton-button {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    margin-top: 12px; /* Match add-to-cart-btn margin-top */
}

/* Campaign Skeleton */
.campaign-skeleton {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-shimmer {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.5s infinite;
}

/* Category Skeleton */
.category-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.skeleton-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Flash Sale Skeleton Container - Match products-slider EXACTLY */
/* Use display: contents to make skeleton cards direct children of products-slider grid */
.flash-sale-skeleton-container {
    display: contents; /* Remove container, let skeleton cards be direct grid children */
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    overflow: visible;
    margin: 0;
    padding: 0;
    gap: 0; /* No gap, parent grid handles gap */
}

/* Responsive breakpoints are now handled in style.css for .products-slider .flash-sale-skeleton-container */
/* Skeleton container uses display: contents, so responsive grid is handled by parent .products-slider */

/* Skeleton Container */
/* Product Skeleton Container - For todaysProducts section */
/* Use grid to match parent grid structure */
.product-skeleton-container {
    display: grid; /* Use grid instead of contents for better visibility */
    grid-template-columns: repeat(5, 1fr); /* Match parent grid (will be overridden by #todaysProducts .product-skeleton-container) */
    gap: 20px; /* Match parent gap (will be overridden by #todaysProducts .product-skeleton-container) */
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    overflow: visible;
    margin: 0;
    padding: 0;
}

/* Responsive breakpoints are now handled in style.css for #todaysProducts .product-skeleton-container */
/* Skeleton container uses display: contents, so responsive grid is handled by parent #todaysProducts */

/* Skeleton image maintains flex: 0 0 70% on all screen sizes */
@media (max-width: 768px) {
    .product-skeleton {
        min-height: 360px; /* Match product-card responsive min-height */
    }
    
    .campaign-skeleton {
        height: 280px;
    }
}

