/**
 * Enhanced Subcategories Styling for Classic Arms Theme
 * Modern grid layout with card design and responsive features
 */

/* Modern Grid Layout for Subcategories - Three Column Layout */
.amshopby-modern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.amshopby-modern-grid .amshopby-subcategory {
    margin: 0;
    padding: 0;
    border: none;
    line-height: normal;
}

/* Card Design */
.amshopby-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.amshopby-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.amshopby-card .am-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 16px;
    height: 100%;
    box-sizing: border-box;
}

.amshopby-card .am-link:hover {
    text-decoration: none;
}

/* Image Wrapper */
.am-img-wrapper {
    display: block;
    text-align: center;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 4px;
    background: #f8f9fa;
}

.am-img-wrapper .am-img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.amshopby-card:hover .am-img {
    transform: scale(1.05);
}

/* Title Styling */
.amshopby-card .am-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 0;
}

.amshopby-card:hover .am-title {
    color: #aa4301;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .amshopby-modern-grid {
        padding: 20px 16px;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 900px) {
    .amshopby-modern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 16px 12px;
    }
}

@media (max-width: 768px) {
    .amshopby-modern-grid {
        gap: 12px;
        padding: 16px 10px;
    }
    
    .amshopby-card .am-link {
        padding: 12px;
    }
    
    .amshopby-card .am-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .amshopby-modern-grid {
        gap: 10px;
        padding: 12px 8px;
    }
    
    .amshopby-card .am-link {
        padding: 10px;
    }
    
    .am-img-wrapper {
        margin-bottom: 8px;
    }
    
    .amshopby-card .am-title {
        font-size: 12px;
    }
}

/* Focus States for Accessibility */
.amshopby-card .am-link:focus {
    outline: 2px solid #aa4301;
    outline-offset: 2px;
}

.amshopby-card .am-link:focus .am-title {
    color: #aa4301;
}

/* Loading State */
.am-img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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