/**
 * Product Handler CSS - Styles for AJAX-based product management
 */

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Product Card Animations */
.da-product-card {
    transition: all 0.3s ease;
    /*border: 1px solid transparent;*/
}

.da-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #e9ecef;
    border-radius: 20px;
}

/* Product Actions */
.da-pro-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.da-product-card:hover .da-pro-actions {
    opacity: 1;
}

.da-pro-actions li {
    margin: 0 2px;
}

.da-pro-actions .da-btn-group a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.da-pro-actions .da-btn-group a:hover {
    background: #007bff;
    color: #fff;
    transform: scale(1.1);
}

/* Star Rating */
.da-pro-rating .ri-star-fill {
    color: #ffc107;
    font-size: 14px;
}

.da-pro-rating .ri-star-fill.grey {
    color: #e9ecef;
}

.da-pro-rating .ri-star-half-fill {
    color: #ffc107;
    font-size: 14px;
}

/* Price Styling */
.da-price .new-price {
    color: #28a745;
    font-weight: 600;
    font-size: 18px;
}

.da-price .old-price {
    color: #6c757d;
    text-decoration: line-through;
    font-size: 14px;
    margin-left: 8px;
}

.da-price .last-items {
    color: #6c757d;
    font-size: 12px;
    margin-left: 8px;
}

/* Toast Notifications */
.toast-container {
    z-index: 1055;
}

.toast {
    min-width: 300px;
}

/* Quick View Modal */
#bry_quickview_modal .modal-dialog {
    max-width: 800px;
}

#bry_quickview_modal .modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#bry_quickview_modal .quantity-selector {
    margin: 20px 0;
}

#bry_quickview_modal .quantity-selector input {
    width: 80px;
    display: inline-block;
    margin-left: 10px;
}

/* Category Tabs */
.da-pro-tab-nav .nav-link {
    color: #6c757d;
    border: none;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.da-pro-tab-nav .nav-link:hover,
.da-pro-tab-nav .nav-link.active {
    color: #007bff;
    background: transparent;
    border-bottom: 2px solid #007bff;
}

/* Product Grid Responsive */
@media (max-width: 768px) {
    .da-product-card {
        margin-bottom: 20px;
    }
    
    .da-pro-actions {
        opacity: 1;
    }
    
    .da-pro-actions .da-btn-group a {
        width: 35px;
        height: 35px;
    }
}

/* Fade In Animation for Products */
.product-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error States */
.product-error {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.product-error i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 20px;
}

/* Success States */
.product-success {
    text-align: center;
    padding: 40px 20px;
    color: #28a745;
}

.product-success i {
    font-size: 48px;
    margin-bottom: 20px;
}

/* Cart Count Badge */
.cart-count {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    text-align: center;
}

/* Wishlist Active State */
.da-wishlist.active {
    color: #dc3545;
}

.da-wishlist.active i:before {
    content: "\f004"; /* Heart filled */
}

/* Compare Active State */
.da-compare.active {
    color: #007bff;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 300px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Product Image Carousel */
.inner-img-slide-2 {
    position: relative;
    overflow: hidden;
}

.inner-img-slide-2 img {
    transition: transform 0.3s ease;
}

.inner-img-slide-2:hover img {
    transform: scale(1.05);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Product Actions Hover Effects */
.da-pro-actions .da-btn-group a:hover {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Featured Products Section */
.da-featured-products {
    min-height: 400px;
    position: relative;
}

#featured-products-container {
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

#featured-products-container:empty::after {
    content: "Loading featured products...";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    color: #6c757d;
    font-style: italic;
}

/* Ensure featured products are always visible */
.da-featured-products .da-product-card {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.da-featured-products .da-product-card.loading {
    opacity: 0.7;
}

/* Responsive Grid Adjustments */
@media (max-width: 576px) {
    .da-col-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .da-col-5 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .da-col-5 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 993px) {
    .da-col-5 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}
