/* 
 * Custom WooCommerce styles cho HungViet theme
 * Cập nhật để tương thích với WooCommerce products
 */

/* Product grid styling */
.product {
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.product__img {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.product__img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product:hover .product__img img {
    transform: scale(1.05);
}

/* Product text styling */
.product__text {
    padding: 15px;
}

.product__text h2 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product__text h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product__text h2 a:hover {
    color: #007cba;
}

/* WooCommerce Price Styling */
.product-price-content {
    margin: 10px 0;
}

.product-price,
.woocommerce-Price-amount {
    font-weight: bold;
    color: #007cba;
    font-size: 18px;
}

.woocommerce-Price-currencySymbol {
    color: #007cba;
}

/* Sale price styling */
.price del {
    color: #999;
    text-decoration: line-through;
    margin-right: 5px;
}

.price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: bold;
}

/* Product Actions */
.product-actions {
    margin-top: 15px;
}

.add-to-cart-btn,
.add_to_cart_button,
.button.add_to_cart_button {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}

.add-to-cart-btn:hover,
.add_to_cart_button:hover,
.button.add_to_cart_button:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.add-to-cart-btn.loading,
.add_to_cart_button.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product__overlay-actions {
    display: flex;
    gap: 10px;
}

.product__overlay-actions a {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.product__overlay-actions a:hover {
    background: var(--theme-color, #f39c12);
    color: #fff;
}

/* Sale badge */
.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

/* Product category */
.product__category {
    font-size: 14px;
}

.product-cat-link {
    color: #666;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 500;
}

.product-cat-link:hover {
    color: var(--theme-color, #f39c12);
}

/* Product title */
.product__title a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    display: block;
}

.product__title a:hover {
    color: var(--theme-color, #f39c12);
}

/* Product rating */
.product__rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-rating i {
    color: #ffc107;
    font-size: 14px;
}

.rating-count {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

/* Product price */
.product__price {
    font-size: 18px;
    font-weight: bold;
}

.product__price .woocommerce-Price-amount {
    color: var(--theme-color, #f39c12);
}

.product__price del {
    color: #999;
    margin-right: 10px;
}

/* Product excerpt */
.product__excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Product meta */
.product__meta {
    font-size: 12px;
    color: #999;
}

.product-sku {
    margin-right: 15px;
}

.stock-status.out-of-stock {
    color: #e74c3c;
    font-weight: bold;
}

/* Add to cart button */
.add-to-cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Shop ordering */
.woocommerce-ordering select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
}

/* Product filters */
.price-filter-widget .price_slider {
    margin-bottom: 15px;
}

.price_slider_amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.price_slider_amount input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

/* Product category widget */
.product-category-widget ul {
    list-style: none;
    padding: 0;
}

.product-category-widget li {
    margin-bottom: 10px;
}

.product-category-widget li a {
    color: #333;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.product-category-widget li a:hover {
    color: var(--theme-color, #f39c12);
}

.product-category-widget .sub-category {
    margin-left: 20px;
    margin-top: 10px;
}

.product-category-widget .sub-category li a {
    padding: 5px 0;
    font-size: 14px;
}

/* Recent products widget */
.recent-product-widget .recent-product-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.recent-product-thumb {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 5px;
}

.recent-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-product-content h6 a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.recent-product-content h6 a:hover {
    color: var(--theme-color, #f39c12);
}

.recent-product-content .price {
    color: var(--theme-color, #f39c12);
    font-weight: bold;
    font-size: 14px;
}

/* Single product page */
.shop-thumb-tab .nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.shop-thumb-tab .nav-item {
    width: 80px;
    height: 80px;
    border: 2px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.shop-thumb-tab .nav-item:hover,
.shop-thumb-tab .nav-item.active {
    border-color: var(--theme-color, #f39c12);
}

.shop-thumb-tab .nav-link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
}

.shop-thumb-tab .nav-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-large-img {
    text-align: center;
}

.product-large-img img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Product details */
.product-details .product-title h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.product-details .new-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--theme-color, #f39c12);
    display: block;
    margin-bottom: 20px;
}

.product-meta p {
    margin-bottom: 10px;
    font-size: 14px;
}

.product-meta strong {
    color: #333;
}

.in-stock {
    color: #27ae60;
    font-weight: bold;
}

.out-of-stock {
    color: #e74c3c;
    font-weight: bold;
}

/* Product tabs */
.product-details-tab-02 .nav-tabs {
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.product-details-tab-02 .nav-link {
    border: none;
    background: none;
    color: #666;
    font-weight: 600;
    padding: 15px 20px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.product-details-tab-02 .nav-link.active,
.product-details-tab-02 .nav-link:hover {
    color: var(--theme-color, #f39c12);
    border-bottom-color: var(--theme-color, #f39c12);
    background: none;
}

.product-details-tab-02 .tab-content {
    padding: 20px 0;
}

/* Product attributes table */
.product-details-tab-02 table {
    width: 100%;
    margin-bottom: 20px;
}

.product-details-tab-02 table td {
    padding: 12px;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}

.product-details-tab-02 table td:first-child {
    width: 30%;
    font-weight: bold;
    background: #f8f9fa;
}

/* Social sharing */
.product-social {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-social a {
    color: #666;
    font-size: 20px;
    transition: color 0.3s ease;
}

.product-social a:hover {
    color: var(--theme-color, #f39c12);
}

/* Related products */
.related-products .product {
    text-align: center;
}

.related-products .product__img {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.related-products .product__text h6 {
    font-size: 16px;
    margin-bottom: 10px;
}

.related-products .product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--theme-color, #f39c12);
}

/* No products found */
.no-products-found {
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 10px;
}

.no-products-found h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.no-products-found p {
    color: #666;
    margin-bottom: 20px;
}

/* WooCommerce form styling */
.woocommerce form .form-row {
    margin-bottom: 20px;
}

.woocommerce form .form-row label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.woocommerce form input[type="number"],
.woocommerce form select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.woocommerce .single_add_to_cart_button {
    background: var(--theme-color, #f39c12);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.woocommerce .single_add_to_cart_button:hover {
    background: #e67e22;
}

/* Sidebar Featured Products */
.blog-widget-post .post {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.blog-widget-post .post:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.blog-widget-post .post__thumb {
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
}

.blog-widget-post .post__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-widget-post .post__content {
    flex: 1;
}

.blog-widget-post .post__content h4 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.blog-widget-post .post__content h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-widget-post .post__content h4 a:hover {
    color: #007cba;
}

.blog-widget-post .post__content .price {
    color: #007cba;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

.blog-widget-post .coment-date {
    font-size: 12px;
    color: #666;
}

/* Category List Styling */
.cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-list li {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.cat-list li:last-child {
    border-bottom: none;
}

.cat-list li:hover {
    background-color: #f8f9fa;
    padding-left: 10px;
}

.cat-list li a {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.cat-list li a:hover {
    color: #007cba;
}

/* Pagination Styling */
.page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.page-numbers:hover,
.page-numbers.current {
    background-color: #007cba;
    color: white;
    text-decoration: none;
    border-color: #007cba;
}

.page-numbers.prev,
.page-numbers.next {
    font-weight: bold;
}

/* WooCommerce Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
    position: relative;
}

.woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-message {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.woocommerce-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.woocommerce-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Product Status */
.out-of-stock {
    opacity: 0.6;
}

.out-of-stock .add_to_cart_button {
    background-color: #ccc;
    cursor: not-allowed;
}

.out-of-stock .add_to_cart_button:hover {
    background-color: #ccc;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product {
        margin-bottom: 30px;
    }
    
    .product-details {
        margin-left: 0;
        margin-top: 30px;
    }
    
    .shop-thumb-tab .nav {
        flex-wrap: wrap;
    }
    
    .shop-thumb-tab .nav-item {
        width: 60px;
        height: 60px;
    }
    
    .product-details .product-title h3 {
        font-size: 24px;
    }
    
    .product-social {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .product__text h2 {
        font-size: 14px;
    }
    
    .product-price,
    .woocommerce-Price-amount {
        font-size: 16px;
    }
    
    .product__img img {
        height: 150px;
    }
    
    .blog-widget-post .post__thumb {
        width: 60px;
        height: 60px;
    }
    
    .blog-widget-post .post__content h4 {
        font-size: 13px;
    }
    
    .add-to-cart-btn,
    .add_to_cart_button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .cat-list li {
        padding: 8px 0;
    }
}

@media (max-width: 576px) {
    .col-6 .product {
        margin-bottom: 20px;
    }
    
    .product__img img {
        height: 120px;
    }
    
    .product__text {
        padding: 10px;
    }
    
    .product__text h2 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .product-price,
    .woocommerce-Price-amount {
        font-size: 14px;
    }
    
    .add-to-cart-btn,
    .add_to_cart_button {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .page-numbers {
        padding: 6px 10px;
        font-size: 12px;
        margin: 0 2px;
    }
}

/* Loading state */
.woocommerce-loading {
    position: relative;
}

.woocommerce-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search form styling */
.catagory-search {
    position: relative;
}

.catagory-search .form-control {
    padding-right: 40px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.catagory-search span {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
}

.catagory-search span:hover {
    color: #007cba;
}
