/* Product Stock Display Plugin Styles */

/* Main stock display container */
.product-stock-display {
    display: inline-block;
    margin: 5px 0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Stock label styling */
.product-stock-display .stock-label {
    font-weight: 600;
    margin-left: 3px;
}

/* Stock quantity styling */
.product-stock-display .stock-quantity {
    font-weight: 700;
}

/* Color classes for different stock levels */
.product-stock-display.stock-low {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545 !important;
}

.product-stock-display.stock-medium {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #856404 !important;
}

.product-stock-display.stock-high {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #155724 !important;
}

/* Shop page specific styles */
.woocommerce ul.products li.product .product-stock-display,
.woocommerce-page ul.products li.product .product-stock-display {
    display: block;
    margin: 8px 0;
    text-align: center;
    font-size: 11px;
}

/* Single product page styles */
.single-product .product-stock-display {
    margin: 10px 0;
    font-size: 14px;
    padding: 5px 10px;
}

/* Cart page styles */
.cart-stock {
    font-size: 11px !important;
    margin-top: 3px !important;
    padding: 2px 6px !important;
}

/* AJAX loaded stock display */
.ajax-stock {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Digiland theme specific styles */
.digiland-stock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
    background: rgba(0,0,0,0.05) !important;
    margin: 2px 0 !important;
    text-align: center;
    min-width: 60px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.digiland-stock:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.digiland-stock svg {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0.8;
}

.digiland-stock .stock-quantity {
    font-weight: 600;
    font-size: inherit;
}

/* Actions list integration */
.add-to-links .digiland-stock {
    margin: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.add-to-links .digiland-stock svg {
    display: none;
}

/* Theme compatibility styles */

/* Digiland theme compatibility */
.digiland .product-stock-display,
.theme-digiland .product-stock-display {
    margin: 8px auto;
    display: block;
    text-align: center;
    max-width: 120px;
}

/* Storefront theme compatibility */
.storefront .product-stock-display {
    margin: 5px 0;
}

/* Astra theme compatibility */
.astra-theme .product-stock-display {
    margin: 6px 0;
}

/* OceanWP theme compatibility */
.oceanwp-theme .product-stock-display {
    margin: 7px 0;
}

/* General theme compatibility */
.woocommerce .product .product-stock-display {
    clear: both;
    width: 100%;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .product-stock-display {
        font-size: 10px;
        padding: 2px 6px;
        margin: 4px 0;
    }
    
    .single-product .product-stock-display {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .digiland-stock {
        font-size: 9px !important;
        min-width: 50px;
    }
    
    .add-to-links .digiland-stock {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .product-stock-display {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .digiland-stock {
        font-size: 8px !important;
        min-width: 45px;
    }
    
    .add-to-links .digiland-stock {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 7px;
    }
}

/* RTL support */
.rtl .product-stock-display {
    direction: rtl;
    text-align: right;
}

.rtl .product-stock-display .stock-label {
    margin-right: 3px;
    margin-left: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .product-stock-display {
        border-width: 2px;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ajax-stock {
        animation: none;
    }
}

/* Print styles */
@media print {
    .product-stock-display {
        background: none !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}