/* Product Listing Modern Design */

/* Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 10px 0;
}

@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

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

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

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Image Container */
.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background-color: #f8f9fa;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: opacity 0.3s ease;
}

/* Loading State */
.image-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.image-loading-overlay.active {
    opacity: 1;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffc107;
    /* Warning color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Carousel Indicators */
.carousel-indicators-custom {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    z-index: 2;
    padding: 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .carousel-indicators-custom {
    opacity: 1;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.carousel-dot.active {
    background-color: #ffc107;
    transform: scale(1.2);
}

/* Badges */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge-custom {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-soldout {
    background-color: #dc3545;
    color: white;
}

.badge-sale {
    background-color: #28a745;
    color: white;
}

.badge-new {
    background-color: #17a2b8;
    color: white;
}

/* Content Area */
.product-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

.product-title:hover {
    color: #ffc107;
}

/* Price Section */
.product-price-wrapper {
    margin-top: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.current-price {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}

.original-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
}

.offer-tag {
    font-size: 0.7rem;
    color: #28a745;
    font-weight: 600;
}

/* Actions */
.product-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.btn-add-cart {
    flex-grow: 1;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-whatsapp {
    padding: 6px 10px;
    border-radius: 6px;
    color: #25D366;
    border: 1px solid #25D366;
    background: white;
}

.btn-whatsapp:hover {
    background: #25D366;
    color: white;
}

/* Quick View / Overlay Actions */
.overlay-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 3;
}

.product-card:hover .overlay-actions {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .overlay-actions {
        display: none;
        /* Disable hover actions on mobile */
    }

    .product-actions {
        display: flex;
        /* Always show buttons on mobile */
    }
}