/**
 * Becar Product Details - Frontend Styles
 * Compatible with Flatsome theme
 */

.becar-product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 12px;
}
.becar-product-actions {
    gap: 5px;
}

.becar-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.becar-sales .sales-label,
.becar-stock-status .stock-label,
.becar-views .views-label {
    margin-right: 2px;
}

.becar-meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.becar-stock-status .stock-value {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Stock status colors */
.becar-product-meta.in-stock .becar-stock-status .stock-value {
    background-color: rgb(40 167 69 / 4%);
    color: #28a745;
}

.becar-product-meta.out-of-stock .becar-stock-status .stock-value {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.becar-product-meta.backorder .becar-stock-status .stock-value {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .becar-product-meta {
        align-items: flex-start;
        gap: 8px;
        padding: 10px;
    }

    .becar-meta-item {
        font-size: 13px;
    }
}

/* Flatsome compatibility */
.theme-flatsome .becar-product-meta {
    background: transparent;
    border: none;
    padding: 0;
    margin: 5px 0;
}

.theme-flatsome .becar-meta-item:not(:last-child)::after {
    display: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .becar-product-meta {
        background: #2d3748;
        border-color: #4a5568;
        color: #98a2b3;
        font-weight: 100;
    }

    .becar-meta-item:not(:last-child)::after {
        color: #718096;
    }
}

.becar-like-btn,
.becar-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 11px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 25px;
    box-sizing: border-box;
    vertical-align: middle;
    border: 0;
}
.becar-share-btn {
    margin-left: 6px !important;
}
.becar-like-btn.liked {
    background: #1877f2;
    color: #ffffff;
}
.becar-share-btn :hover {
    color: #ffffff;
}
.becar-share-btn {
    font-size: 12px !important;
}



.becar-like-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.becar-like-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.becar-like-btn .like-icon,
.becar-share-btn .share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 4px;
}
.becar-share-btn .share-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.like-count {margin-left: 6px;}

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

/* Responsive */
@media (max-width: 768px) {
    .becar-product-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .becar-like-btn,
    .becar-share-btn {
        justify-content: center;
        padding: 12px 16px;
        font-size: 16px;
    }

}

/* Dark mode support */
@media (prefers-color-scheme: dark) {

    .becar-like-btn,
    .becar-share-btn {
        background: #1877f2;
        color: #ffffff;
        font-size: 10px;
        margin: 0;
    }


}

/* Print styles */
@media print {
    .becar-product-meta {
        background: white !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .becar-product-actions {
        display: none !important;
    }
}
