/* ============================================================
   Categories Section - Beautiful Centered Design
   Red Primary, Black Text, Light Grey Accents
   ============================================================ */

:root {
    --wadai-red: #d90217;
    --wadai-red-dark: #a60112;
    --wadai-red-soft: rgba(217, 2, 23, 0.08);
    --wadai-red-medium: rgba(217, 2, 23, 0.12);
    --wadai-blue: #0066cc;
    --wadai-green: #00a86b;
    --wadai-orange: #ff6b35;
    --wadai-purple: #6c5ce7;
    --wadai-yellow: #fdcb6e;
    --wadai-text-black: #000000;
    --wadai-light-grey: #e9ecef;
    --wadai-grey: #6c757d;
}

.categories-modern-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    position: relative;
    overflow: hidden;
}

.categories-header {
    margin-bottom: 3rem !important;
}

/* Grid Container with proper spacing */
.category-grid-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 5 Columns Grid Layout - 2 Rows */
.category-grid-5cols {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
    justify-content: center;
    align-items: stretch;
    gap: 0;
}

.category-grid-5cols .category-col {
    flex: 0 0 20%;
    max-width: 20%;
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: stretch;
}

/* Large screens: 5 columns */
@media (min-width: 1200px) {
    .category-grid-5cols .category-col {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Medium screens: 4 columns */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .category-grid-5cols .category-col {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Tablet: 3 columns */
@media (max-width: 991.98px) and (min-width: 768px) {
    .category-grid-5cols .category-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Mobile: 2 columns */
@media (max-width: 767.98px) {
    .category-grid-5cols .category-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.categories-modern-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
}

.category-modern-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 18px;
    border: 2px solid var(--wadai-light-grey);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.category-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
}

.category-modern-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.category-modern-item:hover::before {
    transform: scaleX(1);
}

.category-modern-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(217, 2, 23, 0.18);
    border-color: rgba(217, 2, 23, 0.2);
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
}

.category-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
    box-shadow: 0 6px 20px rgba(217, 2, 23, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin: 0 auto 1.5rem auto;
    flex-shrink: 0;
    flex-grow: 0;
    z-index: 2;
}

.category-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.category-modern-item:hover .category-icon-wrapper::after {
    opacity: 1;
}

.category-modern-item:hover .category-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(217, 2, 23, 0.35);
}

.category-modern-item:hover .category-content {
    transform: translateY(-2px);
}

/* Secondary colors for different categories with light grey backgrounds */
.category-modern-item:nth-child(1) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
}

.category-modern-item:nth-child(2) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-purple) 0%, #5a4bc7 100%);
}

.category-modern-item:nth-child(3) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-blue) 0%, #0052a3 100%);
}

.category-modern-item:nth-child(4) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-green) 0%, #008a5a 100%);
}

.category-modern-item:nth-child(5) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-orange) 0%, #e55a2b 100%);
}

.category-modern-item:nth-child(6) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-yellow) 0%, #f5b84a 100%);
}

.category-modern-item:nth-child(7) .category-icon-wrapper {
    background: linear-gradient(135deg, #6c5ce7 0%, #5a4bc7 100%);
}

.category-modern-item:nth-child(8) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
}

.category-modern-item:nth-child(9) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-blue) 0%, #0052a3 100%);
}

.category-modern-item:nth-child(10) .category-icon-wrapper {
    background: linear-gradient(135deg, var(--wadai-green) 0%, #008a5a 100%);
}

.category-icon {
    font-size: 2.5rem;
    color: white;
    z-index: 1;
    transition: transform 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.category-modern-item:hover .category-icon {
    transform: scale(1.2);
}

.category-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wadai-text-black) !important;
    line-height: 1.5;
    transition: color 0.3s ease;
    text-align: center;
    width: 100%;
    padding: 0;
    display: block;
    word-wrap: break-word;
    hyphens: auto;
}

.category-modern-item:hover .category-title {
    color: var(--wadai-red) !important;
}


/* Badge styling */
.categories-modern-section .badge {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    background: rgba(217, 2, 23, 0.1) !important;
    border: 1px solid rgba(217, 2, 23, 0.2);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .categories-modern-section {
        padding: 4rem 0;
    }
    
    .categories-header {
        margin-bottom: 2.5rem !important;
    }
    
    .category-modern-item {
        min-height: 190px;
    }
    
    .category-content {
        padding: 1.75rem 1rem;
    }
    
    .category-icon-wrapper {
        width: 75px;
        height: 75px;
        margin: 0 auto 1.25rem auto;
    }
    
    .category-icon {
        font-size: 2.25rem;
    }
    
    .category-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .categories-modern-section {
        padding: 3.5rem 0;
    }
    
    .category-modern-item {
        min-height: 180px;
    }
    
    .category-content {
        padding: 1.5rem 0.875rem;
    }
    
    .category-icon-wrapper {
        width: 70px;
        height: 70px;
        border-radius: 18px;
        margin: 0 auto 1rem auto;
    }
    
    .category-icon {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 0.875rem;
        line-height: 1.4;
    }
}

/* Animation delays for staggered effect */
.category-modern-item[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.category-modern-item[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.category-modern-item[data-delay="100"] {
    transition-delay: 0.1s;
}

.category-modern-item[data-delay="200"] {
    transition-delay: 0.2s;
}

.category-modern-item[data-delay="300"] {
    transition-delay: 0.3s;
}

.category-modern-item[data-delay="400"] {
    transition-delay: 0.4s;
}

.category-modern-item[data-delay="500"] {
    transition-delay: 0.5s;
}

.category-modern-item[data-delay="600"] {
    transition-delay: 0.6s;
}

.category-modern-item[data-delay="700"] {
    transition-delay: 0.7s;
}

.category-modern-item[data-delay="800"] {
    transition-delay: 0.8s;
}

.category-modern-item[data-delay="900"] {
    transition-delay: 0.9s;
}

/* Hover glow effect */
.category-modern-item::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--wadai-red) 0%, var(--wadai-red-dark) 100%);
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: opacity 0.4s ease;
}

.category-modern-item:hover::after {
    opacity: 0.15;
}
