/*
Theme Name: Vibratex Child Theme
Theme URI: http://vibratex.like-themes.com/
Author: Like Themes
Author URI: http://like-themes.com/
Description: Blank Child Theme for Vibratex
Template: vibratex
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: four-columns, right-sidebar, full-width-template
Text Domain: vibratex

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

.product-categories-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
    grid-template-columns: repeat(4, 1fr); /* PC端默认4列 */
}

.category-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 宽高比 */
    overflow: hidden;
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-item:hover .category-image {
    transform: scale(1.05);
}

.product-count {
    position: absolute;
	top: 10px;
	left: 10px;
	background: unset;
	color: #fff;
	padding: 0px 25px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: bold;
	min-width: 20px;
	text-align: center;
	z-index: 2;
	border: 1px solid #dedede;
}

.category-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    line-height: 1.4;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    z-index: 2;
}

.category-item:hover .category-name {
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .product-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* 移动设备 (最大768px) */
@media (max-width: 768px) {
    .product-categories-grid {
        grid-template-columns: repeat(3, 1fr); /* 移动端3列 */
        gap: 10px;
        margin: 15px 0;
    }
    
    .category-name {
        padding: 10px;
        font-size: 14px;
    }
    
    .product-count {
        top: 8px;
        left: 8px;
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* 小屏移动设备 (最大480px) */
@media (max-width: 480px) {
    .product-categories-grid {
        gap: 8px;
    }
    
    .category-name {
        padding: 8px;
        font-size: 13px;
    }
    
    .product-count {
        top: 6px;
        left: 6px;
        padding: 0px 20px;
        font-size: 10px;
    }
}

/* 动态列数支持 */
.product-categories-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.product-categories-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.product-categories-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.product-categories-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* 移动端动态列数 */
@media (max-width: 768px) {
    .product-categories-grid[data-mobile-columns="1"] {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .product-categories-grid[data-mobile-columns="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-categories-grid[data-mobile-columns="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 加载动画 */
.category-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.2s; }
.category-item:nth-child(3) { animation-delay: 0.3s; }
.category-item:nth-child(4) { animation-delay: 0.4s; }
.category-item:nth-child(5) { animation-delay: 0.5s; }
.category-item:nth-child(6) { animation-delay: 0.6s; }
.category-item:nth-child(7) { animation-delay: 0.7s; }
.category-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 无分类时的提示样式 */
.product-categories-grid + p {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 40px 0;
}