/* =====================================================
   Enhanced Category Cards - Modern & Professional
   ===================================================== */

/* Categories Section - Main Container */
.categories-section {
    padding: 3rem 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Page Header Enhancement */
.page-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, #006600 50%, var(--primary-orange) 100%);
    color: var(--white);
    padding: 80px 0 60px 0;
    text-align: center;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
    animation: fadeInDown 0.8s ease;
}

.page-header p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Category Filters - Modern Tab Style */
.category-filters-wrapper {
    margin-bottom: 2rem;
    position: relative;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 0 1rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: var(--white);
    color: var(--dark-gray);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-orange) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.filter-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 128, 0, 0.2);
}

.filter-btn.active {
    border-color: transparent;
    color: var(--white);
}

.filter-btn.active::before {
    opacity: 1;
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

/* Categories Grid - Masonry Style */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* Modern Professional Category Card */
.category-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.6s ease both;
}

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

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 128, 0, 0.2);
}

/* Gradient Top Border on Hover */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-orange));
    transform: scaleX(0);
    transition: transform 0.5s ease;
    z-index: 10;
}

.category-card:hover::before {
    transform: scaleX(1);
}

/* Category Image Container */
.category-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    z-index: 2;
}

.category-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 128, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.category-card:hover .category-image::before {
    opacity: 1;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    background: transparent;
}

.category-card:hover .category-image img {
    transform: scale(1.15) rotate(2deg);
}

/* Floating Icon Overlay */
.category-icon-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-icon-overlay i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-card:hover .category-icon-overlay {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 6px 20px rgba(0, 128, 0, 0.3);
}

/* Category Content */
.category-content {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
    position: relative;
    background: var(--white);
}

.category-content h3 {
    color: var(--dark-gray);
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    transition: color 0.3s ease;
    position: relative;
}

.category-card:hover .category-content h3 {
    color: var(--primary-green);
}

.category-content p {
    color: var(--medium-gray);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Product Count Badge */
.product-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(0, 128, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    color: var(--primary-green);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 128, 0, 0.15);
}

/* Browse Button */
.category-content .btn {
    padding: 0.875rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    position: relative;
    overflow: hidden;
}

.category-content .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-orange) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.category-content .btn:hover::before {
    opacity: 1;
}

.category-content .btn:hover {
    border-color: transparent;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 128, 0, 0.3);
}

.category-content .btn span {
    position: relative;
    z-index: 1;
}

/* Category Card Arrow Icon */
.category-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #006400 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-20px) scale(0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0, 128, 0, 0.3);
}

.category-arrow i {
    color: var(--white);
    font-size: 1.1rem;
    transition: transform 0.4s ease;
}

.category-card:hover .category-arrow {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.category-card:hover .category-arrow i {
    transform: translateX(4px);
}

/* Shine Effect */
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    z-index: 4;
    pointer-events: none;
}

.category-card:hover::after {
    left: 100%;
}

/* =====================================================
   Animations
   ===================================================== */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* =====================================================
   Category-Specific Colors
   ===================================================== */

/* Kitchen Appliances */
.category-card[data-category="kitchen-appliances"]:hover {
    border-color: rgba(255, 112, 67, 0.3);
}

.category-card[data-category="kitchen-appliances"] .category-icon-overlay i {
    background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Beauty & Personal Care */
.category-card[data-category="beauty-personal-care"]:hover {
    border-color: rgba(233, 30, 99, 0.3);
}

.category-card[data-category="beauty-personal-care"] .category-icon-overlay i {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Photography */
.category-card[data-category="photography-tools"]:hover {
    border-color: rgba(33, 150, 243, 0.3);
}

.category-card[data-category="photography-tools"] .category-icon-overlay i {
    background: linear-gradient(135deg, #2196f3 0%, #03a9f4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nail Supplies */
.category-card[data-category="nail-supplies"]:hover {
    border-color: rgba(236, 64, 122, 0.3);
}

.category-card[data-category="nail-supplies"] .category-icon-overlay i {
    background: linear-gradient(135deg, #ec407a 0%, #e91e63 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Kids & Babies */
.category-card[data-category="kids-babies"]:hover {
    border-color: rgba(255, 152, 0, 0.3);
}

.category-card[data-category="kids-babies"] .category-icon-overlay i {
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Home Essentials */
.category-card[data-category="home-essentials"]:hover {
    border-color: rgba(76, 175, 80, 0.3);
}

.category-card[data-category="home-essentials"] .category-icon-overlay i {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Lighting & Home Decor */
.category-card[data-category="lighting-home-decor"]:hover {
    border-color: rgba(156, 39, 176, 0.3);
}

.category-card[data-category="lighting-home-decor"] .category-icon-overlay i {
    background: linear-gradient(135deg, #9c27b0 0%, #ab47bc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .category-filters-wrapper {
        margin: 0 0 1rem 0;
        padding: 0;
        position: relative;
    }
    
    .category-filters {
        gap: 0.5rem;
        padding: 0.75rem;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        /* Add visual indicator for scrollable content */
        background: var(--white);
        padding-right: 3rem;
        /* Shadow to indicate more content */
        mask-image: linear-gradient(90deg, var(--white) 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, var(--white) 85%, transparent 100%);
    }
    
    .filter-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: 20px;
        border: 1.5px solid #e0e0e0;
        background: var(--white);
        color: var(--dark-gray);
        cursor: pointer;
        transition: all 0.3s ease;
        /* Better touch target */
        min-height: 44px;
        /* Add shadow for depth */
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    
    .filter-btn:hover {
        border-color: var(--primary-green);
        color: var(--primary-green);
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 128, 0, 0.15);
    }
    
    .filter-btn.active {
        border-color: var(--primary-green);
        background: var(--primary-green);
        color: var(--white);
        box-shadow: 0 3px 10px rgba(0, 128, 0, 0.25);
    }
    
    .filter-btn span {
        position: relative;
        z-index: 1;
    }
    
    .page-header {
        padding: 60px 0 40px 0;
        margin-top: 70px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .category-card {
        margin: 0 0.5rem;
    }
    
    .category-image {
        height: 180px;
    }
    
    .category-content {
        padding: 1.25rem 1.5rem 1.5rem;
    }
    
    .category-content h3 {
        font-size: 1.2rem;
    }
    
    .category-content p {
        font-size: 0.9rem;
    }
    
    .category-arrow {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .category-icon-overlay {
        width: 45px;
        height: 45px;
        top: 12px;
        right: 12px;
    }
    
    .category-icon-overlay i {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .category-content {
        padding: 1rem 1.25rem 1.25rem;
    }
    
    .category-content h3 {
        font-size: 1.1rem;
    }
    
    .product-count {
        font-size: 0.8rem;
        padding: 0.4rem 0.875rem;
    }
}

/* =====================================================
   Hover Scale Effect for Mobile
   ===================================================== */

@media (hover: none) {
    .category-card:active {
        transform: scale(0.98);
    }
    
    .category-card:hover::before {
        transform: scaleX(0);
    }
}

/* =====================================================
   Loading Skeleton Animation
   ===================================================== */

.category-card.skeleton {
    pointer-events: none;
}

.category-card.skeleton .category-image,
.category-card.skeleton .category-content h3,
.category-card.skeleton .category-content p,
.category-card.skeleton .product-count {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
    .category-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .category-filters {
        display: none;
    }
}
