/**
 * Brand Enhancer CSS
 * Styles for enhanced brand pages with product showcase
 */

.livora-brand-products-section {
    margin: 40px 0;
}

/* Brand Categories Grid */
.livora-brand-categories {
    margin-bottom: 40px;
}

.livora-brand-categories h3 {
    margin-bottom: 20px;
    color: var(--lv-text, #1f1f1f);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.livora-brand-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.livora-brand-category-card {
    display: block;
    background: var(--lv-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(72, 56, 36, 0.12);
    box-shadow: var(--lv-shadow-sm, 0 10px 30px rgba(0,0,0,0.06));
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.livora-brand-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--lv-shadow-md, 0 16px 42px rgba(0,0,0,0.1));
}

.livora-brand-category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.livora-brand-category-card h4 {
    padding: 15px;
    margin: 0;
    font-size: 16px;
    color: #333;
}

.livora-brand-category-card span {
    display: block;
    padding: 0 15px 15px;
    color: #666;
    font-size: 14px;
}

/* Brand Filters */
.livora-brand-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.livora-filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(72, 56, 36, 0.18);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.livora-filter-btn:hover {
    border-color: rgba(200, 161, 101, 0.7);
    color: var(--lv-secondary, #C8A165);
}

.livora-filter-btn.active {
    background: var(--lv-secondary, #C8A165);
    color: #fff;
    border-color: var(--lv-secondary, #C8A165);
}

/* Products Grid */
.livora-brand-products-grid {
    display: grid;
    gap: 25px;
}

.livora-products-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.livora-products-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.livora-products-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Card */
.livora-brand-product-card {
    background: var(--lv-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(72, 56, 36, 0.12);
    box-shadow: var(--lv-shadow-sm, 0 10px 30px rgba(0,0,0,0.06));
    transition: transform 0.3s, box-shadow 0.3s;
}

.livora-brand-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--lv-shadow-md, 0 16px 42px rgba(0,0,0,0.1));
}

.livora-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.livora-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.livora-product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.livora-brand-product-card:hover .livora-product-image-wrapper img {
    transform: scale(1.05);
}

.livora-placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #f5f5f5;
}

.livora-product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.livora-price-regular {
    font-weight: 800;
    color: var(--lv-text, #1f1f1f);
}

.livora-price-regular--old {
    font-weight: 700;
    color: rgba(72, 56, 36, 0.55);
    text-decoration: line-through;
}

.livora-price-sale {
    font-weight: 900;
    color: #b42318;
}

/* Badges */
.livora-sale-badge,
.livora-new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

.livora-sale-badge {
    background: #d63638;
    color: white;
}

.livora-new-badge {
    background: #00a32a;
    color: white;
}

/* Product Info */
.livora-product-info {
    padding: 15px;
}

.livora-product-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.livora-product-category {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.livora-product-rating {
    margin-bottom: 10px;
    font-size: 14px;
}

.livora-product-price {
    margin-bottom: 15px;
}

.livora-price-regular {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.livora-price-sale {
    font-size: 18px;
    font-weight: bold;
}

/* Buttons */
.livora-add-to-cart-btn,
.livora-out-of-stock-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.livora-add-to-cart-btn {
    background: #2271b1;
    color: white;
}

.livora-add-to-cart-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
}

.livora-out-of-stock-btn {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

/* Load More */
.livora-load-more-btn {
    padding: 15px 40px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.livora-load-more-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .livora-products-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .livora-products-grid-4,
    .livora-products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .livora-brand-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .livora-brand-filters {
        gap: 8px;
    }
    
    .livora-filter-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .livora-products-grid-4,
    .livora-products-grid-3,
    .livora-products-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Image Optimization */
.livora-product-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lazy Loading */
.livora-product-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s, filter 0.3s;
    filter: blur(5px);
}

.livora-product-image[loading="lazy"].loaded {
    opacity: 1;
    filter: blur(0);
}

/* Cart Bounce Animation */
.livora-cart-bounce {
    animation: livoraBounce 0.6s ease;
}

@keyframes livoraBounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
}

/* Loading States */
.livora-product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.livora-product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: livoraSpin 0.8s linear infinite;
}

/* Enhanced Hover Effects */
.livora-brand-product-card:hover .livora-product-info {
    background: linear-gradient(to top, rgba(34, 113, 177, 0.05), transparent));
}

.livora-product-card:hover .livora-product-price {
    color: #2271b1;
    font-weight: bold;
}

/* Smooth Transitions */
.livora-brand-product-card,
.livora-product-card {
    will-change: transform;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Enhanced Badge Animations */
.livora-sale-badge,
.livora-new-badge {
    animation: livoraPulse 2s ease-in-out infinite;
}

@keyframes livoraPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Improved Grid Layout */
.livora-brand-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

@media (min-width: 1200px) {
    .livora-brand-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) and (min-width: 768px) {
    .livora-brand-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .livora-brand-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .livora-brand-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Button Styles */
.livora-add-to-cart-btn {
    position: relative;
    overflow: hidden;
}

.livora-add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.livora-add-to-cart-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Filter Improvements */
.livora-filter-btn.active {
    position: relative;
}

.livora-filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* Load More Animation */
.livora-load-more-btn {
    position: relative;
}

.livora-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.livora-load-more-btn.loading {
    color: transparent;
}

.livora-load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: livoraSpin 0.6s linear infinite;
}

