/* ============================================
   HOME PAGE CSS - Từ Themes/Home
   ============================================ */

/* Banner Section */
.banner-section {
    padding: 20px 0;
    background-color: var(--text-color-light);
}

.banner-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.banner-item:hover img {
    transform: scale(1.05);
}

.banner-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary-color);
    opacity: 0.9;
    color: var(--text-color-light);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: bold;
    font-size: 14px;
}

.banner-label.red {
    background-color: #E74C3C;
    opacity: 0.9;
}

/* Motor Types */
.motor-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.motor-item {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s;
}

.motor-item:hover {
    transform: translateY(-5px);
}

.motor-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.motor-item h3 {
    padding: 15px;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: bold;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-top: 30px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-box {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
}

.sidebar-box h3 {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 12px 15px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-box.green h3 {
    background-color: var(--secondary-color);
}

.sidebar-box ul {
    padding: 15px;
}

.sidebar-box ul li {
    padding: 10px 0;
    border-bottom: var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 8px;
}

.sidebar-box ul li:last-child {
    border-bottom: none;
}

.sidebar-box ul li:hover {
    color: var(--primary-color);
}

.sidebar-box ul li i {
    font-size: 10px;
    color: var(--primary-color);
}

/* Category Dropdown Styles */
.home_category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home_category-item {
    border-bottom: var(--border);
    display: block;
    width: 100%;
    transition: background-color 0.2s ease;
}

.home_category-item:last-child {
    border-bottom: none;
}

.home_category-item:hover {
    background-color: var(--background-color);
}

.home_category-item .home_category-link {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    transition: var(--transition);
}

.home_category-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.home_category-item.has-children .home_category-row:hover {
    background-color: var(--hover-color);
}

.home_category-item.has-children.active .home_category-row {
    background-color: var(--light-color);
    font-weight: 500;
}

.home_category-toggle {
    font-size: 11px;
    color: var(--primary-color);
    transition: transform 0.3s ease, color 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home_category-toggle:hover {
    color: var(--secondary-color);
}

.home_category-item.has-children.active .home_category-toggle {
    transform: rotate(90deg);
    color: var(--active-color);
}

.home_category-link {
    flex: 1;
    color: var(--text-color-dark);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 13px;
    line-height: 1.5;
}

.home_category-link:hover {
    color: var(--primary-color);
}

.home_category-item.has-children.active .home_category-link {
    color: var(--active-color);
    font-weight: 500;
}

.home_category-link i {
    font-size: 10px;
    color: var(--primary-color);
    margin-right: 8px;
}

.home_category-children {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    display: none;
    opacity: 0;
}

.home_category-item.active .home_category-children {
    display: block;
    max-height: 2000px;
    width: 100%;
    padding-top: 8px;
    padding-bottom: 8px;
    opacity: 1;
}

.home_category-children li {
    padding: 0;
    border-bottom: none;
    font-size: 12px;
    display: block;
    width: 100%;
    transition: background-color 0.2s ease;
}

.home_category-children li:hover {
    background-color: var(--background-color);
}

.home_category-children li:last-child {
    border-bottom: none;
}

.home_category-children .home_category-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 15px 8px 35px;
    color: var(--text-color-dark);
    opacity: 0.8;
    font-size: 12px;
    font-weight: normal;
}

.home_category-children .home_category-link:hover {
    color: var(--primary-color);
    background-color: var(--background-color);
}

.home_category-children .home_category-link i {
    font-size: 9px;
    margin-right: 8px;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Product Category */
.product-category {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.category-header.green-bg {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.category-header.blue-bg {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.category-header h2 {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-filter button {
    padding: 8px 15px;
    border: var(--border);
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.category-filter button:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}

.category-filter button.active {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}

.view-all {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--secondary-color);
}

.view-all.white {
    color: var(--text-color-light);
}

.view-all.white:hover {
    opacity: 0.8;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--text-color-light);
    border: var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.15);
    transform: translateY(-3px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card h4 {
    padding: 15px 15px 10px;
    font-size: 13px;
    color: var(--text-color-dark);
    min-height: 60px;
    line-height: 1.4;
}

.product-card .price {
    padding: 0 15px 15px;
    color: #E74C3C;
    font-weight: bold;
    font-size: 13px;
}

.product-card .quick-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--text-color-light);
    opacity: 0.9;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.product-card:hover .quick-view {
    opacity: 1;
}

.product-card .quick-view i {
    color: var(--primary-color);
    font-size: 16px;
}

/* Product Card Actions - Add to Cart & Favorite */
.product-card-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.product-card:hover .product-card-actions {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.product-card-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--text-color-light);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.product-card-actions button:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-card-actions button i {
    font-size: 16px;
}

.btn-favorite-home.active {
    background-color: #E74C3C;
    color: var(--text-color-light);
}

.btn-favorite-home.active:hover {
    background-color: #C0392B;
}

.btn-compare-home.active {
    background-color: #667eea;
    color: var(--text-color-light);
}

.btn-compare-home.active:hover {
    background-color: #5568d3;
}

/* Brands Section */
.brands-section {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.brands-grid {
    margin-top: 20px;
}

.brand-logos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.brand-logos img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    padding: 10px;
    background: var(--text-color-light);
    border-radius: var(--border-radius);
}

/* Installation Section */
.installation-section {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.installation-preview {
    position: relative;
    margin-top: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.installation-preview img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.installation-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7), transparent);
    padding: 30px 20px 20px;
}

.installation-overlay p {
    color: var(--text-color-light);
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* News Section */
.news-section {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.news-card {
    border: var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.news-card:hover {
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.15);
    transform: translateY(-3px);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 15px;
}

.news-content h4 {
    font-size: 14px;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    line-height: 1.5;
    min-height: 60px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-color-dark);
    opacity: 0.6;
}

.news-meta i {
    color: var(--primary-color);
}

/* Responsive Home */
@media (max-width: 1024px) {
    .banner-grid {
        grid-template-columns: 1fr 1fr;
    }

    .banner-item.large {
        grid-column: 1 / -1;
    }

    .motor-types {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .banner-grid {
        grid-template-columns: 1fr;
    }

    .motor-types {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .brand-logos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Variant Selection Modal */
.variant-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.variant-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.variant-modal-content {
    position: relative;
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
}

.variant-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-color-dark);
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.variant-modal-close:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.variant-modal-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color-dark);
    margin-bottom: 20px;
    padding-right: 40px;
}

.variant-modal-product-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: var(--border);
}

.variant-modal-product-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: var(--border);
}

.variant-modal-product-info h4 {
    font-size: 16px;
    color: var(--text-color-dark);
    margin: 0;
    flex: 1;
}

.variant-modal-label {
    font-size: 14px;
    color: var(--text-color-dark);
    margin-bottom: 15px;
    font-weight: 500;
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.variant-option-modal {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--text-color-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.variant-option-modal:hover {
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.variant-option-modal.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.variant-option-modal.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.variant-option-modal.out-of-stock:hover {
    border-color: var(--border-color);
    background-color: var(--text-color-light);
}

.variant-option-modal .variant-name {
    font-size: 14px;
    font-weight: 500;
}

.variant-option-modal .variant-price {
    font-size: 14px;
    font-weight: bold;
}

.variant-option-modal .variant-price .sale-price {
    color: #E74C3C;
    margin-right: 8px;
}

.variant-option-modal .variant-price .old-price {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 12px;
}

.variant-option-modal.active .variant-price {
    color: var(--text-color-light);
}

.variant-option-modal.active .variant-price .sale-price {
    color: var(--text-color-light);
}

.variant-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.variant-modal-btn-cancel,
.variant-modal-btn-add {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.variant-modal-btn-cancel {
    background-color: var(--background-color);
    color: var(--text-color-dark);
}

.variant-modal-btn-cancel:hover {
    background-color: #e0e0e0;
}

.variant-modal-btn-add {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.variant-modal-btn-add:hover:not(:disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.variant-modal-btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .category-filter {
        flex-direction: column;
    }
    
    .product-card-actions {
        bottom: 5px;
    }
    
    .product-card-actions button {
        width: 35px;
        height: 35px;
    }
    
    .product-card-actions button i {
        font-size: 14px;
    }
    
    .variant-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .variant-modal-title {
        font-size: 18px;
    }
    
    .variant-modal-product-info {
        flex-direction: column;
    }
    
    .variant-modal-product-info img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
}
