/* Homepage Skeleton Loading Animation */

@keyframes homepage-skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Popular This Month Skeleton Cards */
.skeleton-homepage-popular-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: homepage-skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-homepage-popular-image-container {
    width: 100%;
    padding-top: 75%;
    position: relative;
    background-color: #f0f0f0;
}

.skeleton-homepage-popular-info {
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    justify-content: space-between;
    animation: homepage-skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-homepage-popular-title {
    height: 2.4em; /* Matches 2-line title height */
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-homepage-popular-rating {
    height: 1em;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    width: 60%;
}

.skeleton-homepage-popular-price {
    height: 1.2em;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    width: 30%;
}

.skeleton-homepage-popular-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.skeleton-homepage-popular-button {
    height: 2.5em;
    background-color: #f0f0f0;
    border-radius: 4px;
    flex-grow: 1;
    flex-basis: calc(50% - 0.25rem);
}

/* Unsorted Gifts Skeleton Cards */
.skeleton-homepage-product-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: homepage-skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-homepage-product-image-container {
    position: relative;
    height: auto;
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
}

.skeleton-homepage-product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    animation: homepage-skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-homepage-product-title {
    height: 2.4em; /* Matches 2-line title height */
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-homepage-product-rating {
    height: 1em;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    width: 60%;
}

.skeleton-homepage-product-price-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    margin-bottom: 0.5rem;
    min-height: 3rem;
}

.skeleton-homepage-product-price {
    height: 1.2em;
    background-color: #f0f0f0;
    border-radius: 3px;
    width: 30%;
}

.skeleton-homepage-product-info-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.skeleton-homepage-product-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
}

.skeleton-homepage-product-button {
    height: 2.5em;
    background-color: #f0f0f0;
    border-radius: 4px;
    flex-grow: 1;
    flex-basis: calc(50% - 0.25rem);
}

.skeleton-homepage-product-button.large {
    flex-basis: 100%;
    margin-top: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .skeleton-homepage-product-info {
        padding: 0.8rem;
    }

    .skeleton-homepage-popular-info {
        padding: 0.8rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .skeleton-homepage-product-info {
        padding: 0.6rem;
    }

    .skeleton-homepage-product-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .skeleton-homepage-product-button,
    .skeleton-homepage-popular-button {
        height: 2.3em;
        flex-basis: 100%;
        margin-bottom: 0;
    }

    .skeleton-homepage-product-button.large {
        margin-top: 0;
    }
}

@media (max-width: 520px) {
    .skeleton-homepage-product-title,
    .skeleton-homepage-popular-title {
        height: 2em;
        margin-bottom: 0.25rem;
    }

    .skeleton-homepage-product-price-container {
        min-height: 2rem;
    }

    .skeleton-homepage-product-price {
        height: 1em;
    }

    .skeleton-homepage-product-info {
        padding: 0.5rem;
    }

    .skeleton-homepage-popular-info {
        padding: 0.6rem 0.4rem;
    }

    .skeleton-homepage-popular-title {
        height: 2em;
        margin-bottom: 0.4rem;
    }

    .skeleton-homepage-popular-price {
        height: 1em;
        margin-bottom: 0.4rem;
    }

    .skeleton-homepage-popular-buttons {
        gap: 0.5rem;
    }

    .skeleton-homepage-popular-button {
        height: 2em;
    }
}
