/**
 * WooCommerce Categories Grid Styles
 * 
 * Responsive 3x3 grid layout with background images and overlay text
 */

.woocats-grid-container {
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
}

.woocats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 20px 20px 0;
    padding: 0;
    width: calc(100% - 20px);
}

.woocats-grid-item {
    position: relative;
    width: 100%;
    aspect-ratio: 611.2347412109375 / 407.4898376464844;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease-out;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.woocats-grid-item:hover,
.woocats-grid-item.woocats-loaded:hover,
.woocats-grid-item.woocats-loading:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15) !important;
}

.woocats-category-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.woocats-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.woocats-category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.woocats-grid-item:hover .woocats-category-image {
    transform: none;
}

.woocats-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(202.98deg, rgba(0, 0, 0, 0) 36.77%, rgba(0, 0, 0, 0.6) 79.85%);
    padding: 35px 25px 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.woocats-grid-item:hover .woocats-overlay {
    background: linear-gradient(202.98deg, rgba(0, 0, 0, 0) 36.77%, rgba(0, 0, 0, 0.6) 79.85%);
}

.woocats-content {
    color: white !important;
    text-align: left;
}

.woocats-category-title {
    margin: 0 0 12px 0;
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 31.74px !important;
    line-height: 120%;
    letter-spacing: 0%;
    color: white !important;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    margin-bottom: 5px !important;
}

.woocats-grid-item:hover .woocats-category-title {
    transform: none;
}

.woocats-category-description {
    margin: 0 0 15px 0;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 14px;
    line-height: 120%;
    letter-spacing: 0%;
    color: white !important;
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woocats-view-button {
    position: absolute;
    top: 25px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    background: #FF8C00;
    color: white;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
    z-index: 2;
}

.woocats-view-button i {
    background: rgba(0, 0, 0, 0.2) !important;
	padding: 5px !important;
	border-radius: 20px !important;
	margin: -4px -10px -4px 10px !important;
}

/* .woocats-view-button:after {
    content: "→";
    margin-left: 8px;
    transition: transform 0.3s ease;
} */

.woocats-view-button:hover {
    background: #FF7700;
    transform: scale(1.05);
}

.woocats-view-button:hover:after {
    transform: translateX(3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .woocats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin: 0 20px 20px 0;
        width: calc(100% - 20px);
    }
    
    .woocats-grid-container {
        padding: 25px 15px;
    }
    
    .woocats-category-title {
        font-size: 24px;
    }
    
    .woocats-category-description {
        font-size: 12px;
    }
    
    .woocats-overlay {
        padding: 30px 20px 20px;
    }
    
    .woocats-view-button {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .woocats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 0 20px 20px 0;
        width: calc(100% - 20px);
    }
    
    .woocats-grid-container {
        padding: 20px 15px;
    }
    
    .woocats-category-title {
        font-size: 20px;
    }
    
    .woocats-category-description {
        font-size: 12px;
    }
    
    .woocats-view-button {
        top: 12px;
        right: 12px;
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Animation for loading */
.woocats-grid-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.woocats-grid-item.woocats-loading {
    transform: translateY(20px);
}

.woocats-grid-item.woocats-loaded {
    transform: translateY(0);
}

.woocats-grid-item:nth-child(1) { animation-delay: 0.1s; }
.woocats-grid-item:nth-child(2) { animation-delay: 0.2s; }
.woocats-grid-item:nth-child(3) { animation-delay: 0.3s; }
.woocats-grid-item:nth-child(4) { animation-delay: 0.4s; }
.woocats-grid-item:nth-child(5) { animation-delay: 0.5s; }
.woocats-grid-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.woocats-category-link:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.woocats-category-link:focus .woocats-overlay {
    background: linear-gradient(
        to top,
        rgba(74, 144, 226, 0.9) 0%,
        rgba(74, 144, 226, 0.6) 60%,
        rgba(74, 144, 226, 0.2) 100%
    );
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .woocats-overlay {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.7) 50%,
            transparent 100%
        );
    }
    
    .woocats-category-title,
    .woocats-category-description {
        text-shadow: 0 0 4px rgba(0, 0, 0, 1);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .woocats-grid-item,
    .woocats-category-image,
    .woocats-overlay,
    .woocats-category-title {
        transition: none;
        animation: none;
    }
    
    .woocats-grid-item:hover {
        transform: none;
    }
    
    .woocats-grid-item:hover .woocats-category-image {
        transform: none;
    }
    
    .woocats-grid-item:hover .woocats-category-title {
        transform: none;
    }
}

.woocats-image-container img{
    width: 100%;
}