/* Product Category Widget Styles */

.product-category-widget {
    width: 100%;
    direction: rtl;
    text-align: right;
}

/* Header Styles */
.category-header {
    margin-bottom: 30px;
}

.category-header.layout-stacked {
    text-align: center;
}

.category-header.layout-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-header.alignment-left {
    text-align: left;
}

.category-header.alignment-center {
    text-align: center;
}

.category-header.alignment-right {
    text-align: right;
}

.category-header-title {
    font-size: 18px;
    font-weight: 400;
    color: #D2691E;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.category-header-subtitle {
    font-size: 28px;
    font-weight: 700;
    color: #8B4513;
    margin: 0;
    line-height: 1.2;
}

/* Grid Layout */
.product-category-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Desktop Columns */
.columns-desktop-1 {
    grid-template-columns: 1fr;
}

.columns-desktop-2 {
    grid-template-columns: repeat(2, 1fr);
}

.columns-desktop-3 {
    grid-template-columns: repeat(3, 1fr);
}

.columns-desktop-4 {
    grid-template-columns: repeat(4, 1fr);
}

.columns-desktop-5 {
    grid-template-columns: repeat(5, 1fr);
}

.columns-desktop-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Category Item Styles */
.category-item {
    position: relative;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* Category Image Styles */
.category-image {
	width: 100%;
	height: 100%;
}

.category-image img {
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.category-item:hover .category-image img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Icon Styles */
.category-icon {
	position: absolute;
	top: -19px;
	right: 0 !important;
	width: 42px;
	height: 42px;
	background-color: #FFA500;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 20px;
	z-index: 3;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	margin: 0 auto;
	/* width: 100%; */
}
.category-item:hover .category-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Text Overlay Styles */
.category-text-overlay {
	position: absolute;
	bottom: 15px;
	left: 15px;
	right: 15px;
	padding: 15px;
	z-index: 2;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
    line-height: 1.3;
    text-align: center;
}

.product-count {
    font-size: 14px;
    color: #fff;
    margin: 0;
    text-align: center;
    opacity: 0.9;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .columns-tablet-1 {
        grid-template-columns: 1fr;
    }
    
    .columns-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .columns-tablet-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .columns-tablet-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .category-item {
        height: 280px;
    }
    
    .category-image img {
        width: 100px;
        height: 100px;
    }
    
    .category-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .category-title {
        font-size: 16px;
    }
    
    .product-count {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .category-header.layout-inline {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .category-header-title {
        font-size: 16px;
    }
    
    .category-header-subtitle {
        font-size: 24px;
    }
    
    .columns-mobile-1 {
        grid-template-columns: 1fr;
    }
    
    .columns-mobile-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-item {
        height: 250px;
    }
    
    .category-image img {
        width: 80px;
        height: 80px;
    }
    
.category-icon {
	width: 30px;
	height: 30px;
	font-size: 16px;
	top: -16px;
	right: 10px;
}
    
.category-text-overlay {
	padding: 12px;
	bottom: 8px;
	left: 8px;
	right: 8px;
	background-size: cover !important;
}
    
    .category-title {
        font-size: 15px;
    }
    
    .product-count {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-category-grid {
        gap: 15px;
    }
    
.category-item {
	height: 156px !important;
}
    
    .category-image {
        top: 15px;
    }
    
    .category-image img {
        width: 70px;
        height: 70px;
    }
    
    .category-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
.category-text-overlay {
	padding: 15px 10px !important;
}
    
.category-title {
	font-size: 12px !important;
	padding-top: 8px;
}
.product-count {
	font-size: 9px !important;
}
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item {
    animation: fadeInUp 0.6s ease forwards;
}

.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; }

/* Hover Effects */
.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.category-item:hover::before {
    opacity: 1;
}

/* Loading State */
.product-category-widget.loading .category-item {
    opacity: 0.5;
    pointer-events: none;
}

/* RTL Support */
[dir="rtl"] .category-header.layout-inline {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-icon {
	right: auto;
	left: 0;
}



/* Print Styles */
@media print {
    .product-category-widget {
        break-inside: avoid;
    }
    
    .category-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .category-icon {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .category-item {
        border: 2px solid #000;
    }
    
    .category-text-overlay {
        background: #000;
    }
    
    .category-title,
    .product-count {
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .category-item {
        animation: none;
        transition: none;
    }
    
    .category-item:hover {
        transform: none;
    }
    
    .category-image img,
    .category-icon {
        transition: none;
    }
}

/* Focus Styles for Accessibility */
.category-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.category-link:focus .category-item {
    transform: translateY(-2px);
}

/* Custom Scrollbar for Webkit Browsers */
.product-category-widget::-webkit-scrollbar {
    width: 8px;
}

.product-category-widget::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.product-category-widget::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 4px;
}

.product-category-widget::-webkit-scrollbar-thumb:hover {
    background: #A0522D;
}
