/**
 * Best Appliances - Frontend Styles
 * Marketing-focused design with conversion optimization
 */

:root {
    --ba-primary: #00C851;
    --ba-secondary: #2196F3;
    --ba-amazon: #FF9900;
    --ba-text: #37474F;
    --ba-light: #F5F5F5;
    --ba-white: #FFFFFF;
    --ba-border: #E0E0E0;
    --ba-shadow: rgba(0, 0, 0, 0.1);
}

/* === GALLERY WRAPPER === */
.ba-gallery-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* === SEARCH BAR === */
.ba-search-bar {
    margin-bottom: 25px;
}

.ba-search-bar input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--ba-border);
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.ba-search-bar input:focus {
    outline: none;
    border-color: var(--ba-primary);
    box-shadow: 0 4px 12px rgba(0, 200, 81, 0.2);
}

/* === FILTERS === */
.ba-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--ba-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--ba-shadow);
}

.ba-filter-item {
    flex: 1;
    min-width: 180px;
}

.ba-filter-item label {
    display: block;
    font-weight: 600;
    color: var(--ba-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.ba-filter-item select,
.ba-filter-item input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--ba-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ba-filter-item select:focus,
.ba-filter-item input:focus {
    outline: none;
    border-color: var(--ba-primary);
}

.ba-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* === PRODUCTS GRID === */
.ba-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* === PRODUCT CARD === */
.ba-product-card {
    background: var(--ba-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--ba-shadow);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ba-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Badge */
.ba-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    color: var(--ba-white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    z-index: 10;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-bestseller { background: #FFD700; color: #333; }
.badge-hotdeal { background: #FF6B35; }
.badge-limited { background: #FF9800; }
.badge-choice { background: #2196F3; }
.badge-new { background: #00C851; }

/* Image */
.ba-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--ba-light);
}

.ba-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.5s ease;
}

.ba-product-card:hover .ba-product-image img {
    transform: scale(1.05);
}

.ba-no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
}

/* Content */
.ba-product-content {
    padding: 20px;
    flex: 1;
}

.ba-product-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ba-text);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

/* Rating */
.ba-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ba-stars {
    color: #FFD700;
    font-size: 14px;
    line-height: 1;
}

.ba-rating-value {
    font-weight: 700;
    color: var(--ba-text);
    font-size: 14px;
}

.ba-reviews-count {
    color: #666;
    font-size: 13px;
}

/* Pricing */
.ba-product-pricing {
    margin-bottom: 12px;
}

.ba-price-original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.ba-price-current {
    font-size: 24px;
    font-weight: 800;
    color: var(--ba-primary);
    margin-bottom: 4px;
}

.ba-price-save {
    font-size: 14px;
    font-weight: 700;
    color: #FF6B35;
}

/* Benefits */
.ba-product-benefits {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ba-benefit {
    font-size: 12px;
    color: var(--ba-primary);
    font-weight: 600;
}

/* Actions */
.ba-product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    border-top: 1px solid var(--ba-border);
}

/* === BUTTONS === */
.ba-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
}

.ba-btn-details {
    background: var(--ba-secondary);
    color: var(--ba-white);
}

.ba-btn-details:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.ba-btn-video {
    background: var(--ba-primary);
    color: var(--ba-white);
}

.ba-btn-video:hover {
    background: #00A040;
    transform: translateY(-2px);
}

.ba-btn-amazon {
    background: var(--ba-amazon);
    color: var(--ba-white);
    font-size: 16px;
}

.ba-btn-amazon:hover {
    background: #E68A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.ba-btn-compare {
    background: #607D8B;
    color: var(--ba-white);
    font-size: 13px;
}

.ba-btn-compare:hover {
    background: #455A64;
}

.ba-filter-reset {
    background: #999;
    color: var(--ba-white);
}

.ba-filter-apply {
    background: var(--ba-secondary);
    color: var(--ba-white);
}

/* === LOADING === */
.ba-loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.ba-loading.active {
    display: block;
}

.ba-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ba-light);
    border-top-color: var(--ba-primary);
    border-radius: 50%;
    animation: ba-spin 0.8s linear infinite;
}

@keyframes ba-spin {
    to { transform: rotate(360deg); }
}

/* === COMPARE BAR === */
.ba-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ba-white);
    box-shadow: 0 -4px 12px var(--ba-shadow);
    padding: 15px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ba-compare-bar.active {
    transform: translateY(0);
}

.ba-compare-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ba-compare-items {
    display: flex;
    gap: 15px;
    flex: 1;
    overflow-x: auto;
}

.ba-compare-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--ba-light);
    border-radius: 8px;
    min-width: 200px;
}

.ba-compare-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
}

.ba-compare-remove {
    background: none;
    border: none;
    color: #FF6B35;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
}

.ba-btn-compare-view {
    background: var(--ba-primary);
    color: var(--ba-white);
    white-space: nowrap;
}

/* === MODAL === */
.ba-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ba-modal.active {
    display: flex;
}

.ba-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.ba-modal-content {
    position: relative;
    background: var(--ba-white);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
}

.ba-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--ba-text);
    color: var(--ba-white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ba-modal-body {
    padding: 30px;
}

/* Modal Details Content */
.ba-modal-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.ba-modal-gallery img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border: 2px solid var(--ba-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ba-modal-gallery img:hover {
    border-color: var(--ba-primary);
    transform: scale(1.05);
}

.ba-gallery-thumb {
    cursor: zoom-in;
}

/* === IMAGE LIGHTBOX === */
.ba-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ba-lightbox.active {
    display: flex;
}

.ba-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.ba-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 2;
}

.ba-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ba-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--ba-white);
    color: var(--ba-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.ba-lightbox-close:hover {
    background: var(--ba-primary);
    color: var(--ba-white);
    transform: rotate(90deg);
}

.ba-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.ba-modal-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.ba-modal-pricing {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ba-border);
}

.ba-modal-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #666;
}

.ba-modal-section {
    margin-bottom: 25px;
}

.ba-modal-section h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--ba-text);
}

.ba-modal-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ba-modal-section ul li {
    padding: 8px 0;
    line-height: 1.5;
}

.ba-modal-section .ba-pros li {
    color: var(--ba-primary);
}

.ba-modal-section .ba-cons li {
    color: #F44336;
}

.ba-modal-video iframe,
.ba-modal-video video {
    width: 100%;
    height: 500px;
    border-radius: 12px;
}

/* === COMPARE PAGE === */
.ba-compare-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.ba-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--ba-primary);
}

.ba-compare-header h2 {
    margin: 0;
    font-size: 28px;
}

.ba-compare-table-container {
    overflow-x: auto;
    background: var(--ba-white);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--ba-shadow);
}

.ba-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.ba-compare-table th,
.ba-compare-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--ba-border);
}

.ba-compare-label {
    font-weight: 700;
    color: var(--ba-text);
    background: var(--ba-light);
    width: 150px;
    position: sticky;
    left: 0;
}

.ba-compare-product {
    text-align: center;
    background: var(--ba-light);
}

.ba-compare-product img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.ba-compare-product h3 {
    font-size: 16px;
    margin: 0;
}

.ba-compare-value ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ba-compare-value .ba-pros li {
    color: var(--ba-primary);
}

.ba-compare-value .ba-cons li {
    color: #F44336;
}

.ba-no-products,
.ba-compare-empty {
    text-align: center;
    padding: 60px 20px;
}

.ba-no-products h3,
.ba-compare-empty h3 {
    font-size: 24px;
    color: #666;
    margin-bottom: 15px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .ba-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ba-filters {
        flex-direction: column;
    }
    
    .ba-filter-item {
        min-width: 100%;
    }
    
    .ba-product-content {
        padding: 15px;
    }
    
    .ba-product-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .ba-price-current {
        font-size: 20px;
    }
    
    .ba-product-actions {
        padding: 12px;
    }
    
    .ba-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .ba-modal-content {
        max-width: 95%;
    }
    
    .ba-modal-body {
        padding: 20px;
    }
    
    .ba-compare-items {
        flex-wrap: nowrap;
    }
}

@media (max-width: 480px) {
    .ba-gallery-wrapper {
        padding: 10px;
    }
    
    .ba-products-grid {
        gap: 10px;
    }
    
    .ba-product-title {
        font-size: 13px;
    }
    
    .ba-price-current {
        font-size: 18px;
    }
}