/* Common Section Styles */
.section {
    padding: 4rem 0;
}

.section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-title {
    font-family: var(--font-bold);
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #008163;
}

.section-subtitle {
    font-family: var(--font-regular);
    font-size: 1rem;
    color: #666;
    margin-top: 1rem;
}

/* Category Cards */
/* Categories Section - Overlay Content Style */
.section-categories {
    padding: 4rem 0;
    background-color: var(--light-gray);
}

.category-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.category-item {
    margin-bottom: 1.5rem;
    height: 100%;
    cursor: pointer;
}

.category-image-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    /* 4:3 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-item:hover .category-image-wrapper {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-item:hover .category-image {
    transform: scale(1.05);
}

/* Overlay để tạo độ tương phản */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.category-item:hover .category-overlay {
    opacity: 0.9;
}

/* Content styling */
.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    color: var(--white);
    z-index: 2;
    transition: transform 0.3s ease;
}

.category-item:hover .category-content {
    transform: translateY(-10px);
}

.category-title {
    font-family: var(--font-bold);
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.category-description {
    font-size: 0.95rem;
    margin: 0 0 1rem;
    opacity: 0.9;
    max-width: 90%;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.category-link {
    display: inline-flex;
    align-items: center;
    color: var(--white);
    font-family: var(--font-medium);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.category-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: width 0.3s ease;
}

.category-item:hover .category-link::after {
    width: 100%;
}

.category-link i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.category-item:hover .category-link i {
    transform: translateX(5px);
}

/* Đảm bảo độ tương phản */
.category-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .section {
        padding: 2rem 0;
    }

    .category-title {
        font-size: 1.35rem;
    }

    .category-description {
        font-size: 0.9rem;
    }

    .category-content {
        padding: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .section-categories {
        padding: 3rem 0;
    }

    .category-title {
        font-size: 1.25rem;
    }

    .category-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .category-content {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .section-categories {
        padding: 2rem 0;
    }

    .category-image-wrapper {
        padding-bottom: 66.67%;
        /* 3:2 aspect ratio on mobile */
    }

    .category-content {
        padding: 1rem;
    }

    .category-title {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .category-description {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .category-link {
        font-size: 0.85rem;
    }
}

/* Enhanced contrast for mobile */
.category-content.enhanced-contrast {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 8px 8px;
}

.category-content.enhanced-contrast .category-title,
.category-content.enhanced-contrast .category-description,
.category-content.enhanced-contrast .category-link {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* Product Cards */
.product-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.product-image-link {
    display: block;
    text-decoration: none;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    aspect-ratio: 1/1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-family: var(--font-medium);
    font-size: 14px;
    font-weight: 400;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: var(--black);
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    font-family: var(--font-bold);
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: auto;
}

/* Project Cards */
.project-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.project-image-link {
    display: block;
    text-decoration: none;
}

.project-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    aspect-ratio: 4/3;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-content {
    padding: 1.25rem;
}

.project-title {
    font-family: var(--font-medium);
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.project-title a {
    color: var(--black);
    text-decoration: none;
    transition: color 0.3s;
}

.project-title a:hover {
    color: var(--primary-color);
}

.project-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .category-title,
    .project-title {
        font-size: 1rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .section {
        padding: 1.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .project-description {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 575.98px) {
    .section {
        padding: 1rem 0;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .category-content,
    .product-content,
    .project-content {
        padding: 0.75rem;
    }

    .product-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 1;
    }

    .product-price {
        font-size: 0.9rem;
    }
}