/* Category Page Styles */

/* Category Banner */
.category-banner {
    padding: 40px 0;
    background-color: var(--color-light, #f9f9f9);
    margin-bottom: 40px;
}

.category-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-description {
    flex: 1;
    max-width: 70%;
}

.category-description h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text, #666);
    margin-bottom: 20px;
}

/* MODIFIED: Banner image changed from a circle to a rounded square */
.category-image { /* This is for the banner */
    width: 310px;
    height: 310px;
    border-radius: var(--radius-md, 8px); /* CHANGED from 50% */
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 4px solid #fff;
    flex-shrink: 0;
    background-color: #f5f5f5; /* Added for consistency */
}

.category-image img { /* This is for the banner image */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Related Categories - THIS IS THE "SHOP BY CATEGORY" PART MODIFIED TO MATCH STYLE.CSS */
.related-categories {
    padding: 60px 0; /* Or var(--section-spacing) from style.css */
    /* background-color: var(--color-light, #f9f9f9); /* Removed, style.css doesn't apply this to the main wrapper */
}

/* MODIFIED: Grid to match style.css's .categories-grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Matches style.css */
    gap: 30px; /* MODIFIED: Was 20px, now matches style.css */
    margin-top: 30px;
}

/* MODIFIED: Category Card to match style.css's .category-card */
.category-card {
    position: relative;
    border-radius: var(--radius-md, 8px); /* Using variable from style.css */
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08)); /* Using variable from style.css */
    transition: all var(--transition-base, 0.3s ease); /* Using variable from style.css */
    height: 0; /* KEY CHANGE: For aspect ratio, matches style.css */
    padding-bottom: 100%; /* KEY CHANGE: For 1:1 aspect ratio (square), matches style.css */
    /* REMOVED: background-color: #fff; (style.css doesn't have this here, image covers) */
    /* REMOVED: height: 200px; (this was the main cause of the different look) */
}

.category-card:hover {
    transform: translateY(-10px); /* Matches style.css */
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12)); /* Matches style.css */
}

/* MODIFIED: Image container to fill the card, like style.css's .category-image */
.category-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Fills the new aspect ratio card */
    overflow: hidden;
    background-color: #f5f5f5; /* Matches style.css placeholder bg */
    /* REMOVED: height: 140px; */
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area, matches style.css */
    transition: transform var(--transition-slow, 0.5s ease); /* Matches style.css */
}

.category-card:hover .category-card-image img {
    transform: scale(1.1); /* Matches style.css */
}

/* MODIFIED: Content to be an overlay, like style.css's .category-content */
.category-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px; /* Matches style.css */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); /* Matches style.css */
    color: var(--color-white, #ffffff); /* Matches style.css */
    transform: translateY(20px); /* Initial state for hover animation, matches style.css */
    opacity: 0; /* Initial state for hover animation, matches style.css */
    transition: all var(--transition-slow, 0.5s ease); /* Matches style.css */
    /* REMOVED: text-align: center; */
}

.category-card:hover .category-card-content { /* Matches style.css */
    transform: translateY(0);
    opacity: 1;
}

/* MODIFIED: Title to match style.css's h3 within .category-content */
.category-card-title {
    font-size: 1.5rem; /* Matches style.css */
    font-weight: 600;
    margin: 0 0 10px 0; /* Matches style.css */
    color: var(--color-white, #ffffff); /* Ensures white on overlay */
}

/* MODIFIED: Count to be styled for overlay, similar to .shop-link in style.css */
.category-card-count {
    font-size: 0.875rem; /* Matches style.css .shop-link */
    color: var(--color-white, #ffffff); /* Ensures white on overlay */
    opacity: 0.8; /* For softer look on overlay, matches style.css */
    margin-top: 5px;
    font-weight: 500; /* Matches style.css .shop-link */
}

/* Loading Animation */
.loading-categories {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

/* Responsive Styles - These should generally align with style.css or be reviewed */
@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr); /* Matches style.css */
    }
}

@media (max-width: 768px) {
    .category-banner-content {
        flex-direction: column;
    }
    
    .category-description {
        max-width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* Matches style.css */
    }
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: 1fr; /* Matches style.css */
    }
}