/* Product Label Styles */
.product-labels-container {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 15;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom to top */
    align-items: flex-end;
    gap: 4px;
    max-width: calc(100% - 16px);
    pointer-events: none; /* Allow clicking through to wishlist button */
}

/* For product cards - position at bottom of image */
.product-item .ratio-product-box {
    position: relative;
}

.product-item .product-labels-container,
.product-item-horizontal .product-labels-container {
    position: absolute;
    bottom: 8px;
    right: 8px;
    top: auto;
    left: auto;
    margin: 0;
    align-items: flex-end;
    flex-direction: column-reverse; /* Stack from bottom to top */
    flex-wrap: nowrap;
    gap: 6px;
}

/* Alternative: bottom-left positioning */
.product-labels-container.bottom-left {
    left: 8px;
    right: auto;
    align-items: flex-start;
}

.product-labels-container .product-label {
    pointer-events: auto; /* But make labels themselves clickable if needed */
}

.product-label {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    white-space: nowrap;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

/* Default label style */
.product-label {
    background: #666;
}

/* Specific label styles */
.product-label.label-top {
    background: #ff4136;
    background: linear-gradient(135deg, #ff4136 0%, #dc2626 100%);
}

.product-label.label-elite {
    background: #FFD700;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    text-shadow: none;
}

.product-label.label-vip {
    background: #9b59b6;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.product-label.label-new {
    background: #2ecc71;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.product-label.label-hot {
    background: #e74c3c;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.product-label.label-sale {
    background: #3498db;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Verified badge */
.product-label.label-verified {
    background: #1DA1F2;
    background: linear-gradient(135deg, #1DA1F2 0%, #1a91da 100%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-label.label-verified:before {
    content: "✓";
    font-weight: bold;
    font-size: 14px;
}

/* For grid/list views */
.product-item {
    position: relative;
}

.product-item-horizontal {
    position: relative;
}

.product-item-options {
    position: relative;
}

/* Hover effects */
.product-label:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-labels-container {
        bottom: 6px;
        right: 6px;
        max-width: calc(100% - 12px);
    }
    
    .product-label {
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .product-labels-container {
        bottom: 4px;
        right: 4px;
        gap: 2px;
    }
    
    .product-label {
        padding: 2px 5px;
        font-size: 9px;
        border-radius: 8px;
        letter-spacing: 0.3px;
    }
}

/* For product details page - position in non-obstructive area */
.product-details-labels {
    margin-top: 10px;
    margin-bottom: 15px;
    margin-left: 0; /* Reset previous negative margin */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Alternative placement for product details - below price */
.product-details-labels.below-price {
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Bottom position placement - below product details */
.product-details-labels.bottom-position {
    margin-top: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .product-details-labels {
        margin-left: 0; /* Reset on mobile */
    }
}

.product-details-labels .product-label {
    font-size: 13px;
    padding: 5px 15px;
}

/* Alternative position - top right */
.product-labels-container.top-right {
    top: 8px;
    bottom: auto;
    left: auto;
    right: 10px;
    flex-direction: column; /* Normal stacking for top position */
}

/* Animation on hover */
.product-label {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-label:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
} 