/*
 * index.css: Styles specific to the index.php (Homepage).
 * Contains the new 3-column seafood category grid with text overlays.
*/

/* --- Product Categories Grid Section --- */
.product-categories-grid {
    padding-top: 30px; /* Reduced top padding further for less space from carousel */
    padding-bottom: 80px; /* Custom bottom padding for this section */
}

.category-grid-wrapper {
    display: flex;
    gap: 20px; /* Space between the columns */
    flex-wrap: wrap; /* Allows columns to wrap on smaller screens */
    justify-content: center; /* Centers items if less than 3 */
}

.category-grid-item {
    position: relative; /* Essential for positioning the text overlay */
    display: block; /* Makes the whole block clickable */
    /* Reverting width calculation to ensure 3-in-a-row fit */
    flex: 1 1 calc(33.333% - 20px); /* Adjusted width (increased subtracted value for more margin/less width per item) */
    max-width: calc(33.333% - 20px); /* Ensures consistent width */
    border-radius: 10px; /* Rounded corners for the entire card */
    overflow: hidden; /* Hides parts of image outside rounded corners */
    text-decoration: none; /* Removes underline from link */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover */
    background-color: #FFFFFF; /* Ensure white background for the card */
}

.category-grid-item:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Stronger shadow on hover */
}

.category-grid-item img {
    width: 100%; /* Image fills the container width */
    height: 400px; /* Maintained increased height for larger panels */
    object-fit: cover; /* Ensures image covers area, cropping if needed */
    display: block; /* Removes extra space below image */
}

/* --- Category Text Overlay Styling (Default Normal State for ALL Panels) --- */
.category-text-overlay {
    position: absolute; /* Position relative to .category-grid-item */
    bottom: 0; /* Align to the bottom of the image */
    left: 0;
    right: 0;
    padding: 15px 10px; /* Padding inside the text panel */
    text-align: center; /* Center the text */
    background-color: var(--white-color) !important; /* Default: WHITE background for ALL panels */
    border-radius: 0 0 10px 10px; /* Rounded corners only to the bottom of the panel */
    border-top: 1px solid var(--border-color); /* Subtle border at top for all white panels */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-text-overlay h3 {
    margin: 0; /* Remove default margin from h3 */
    font-size: 1.2rem; /* Font size for category name */
    font-weight: 600;
    text-transform: uppercase;
    color: var(--theme-color) !important; /* Default: BLUE text for ALL panels */
    transition: color 0.3s ease;
}


/* --- Universal Hover Effect for Text Overlay Panels (applied to all) --- */
.category-grid-item:hover .category-text-overlay {
    background-color: var(--theme-color) !important; /* Change background to blue on hover */
}
.category-grid-item:hover .category-text-overlay h3 {
    color: var(--white-color) !important; /* Change text to white on hover */
}


/* --- Responsive Adjustments --- */

@media (max-width: 991px) { /* Tablets */
    .category-grid-item {
        flex: 1 1 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
    .category-grid-item img {
        height: 350px; /* Adjusted image height for tablets */
    }
    .category-text-overlay {
        padding: 12px 8px;
    }
    .category-text-overlay h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) { /* Mobile */
    .category-grid-item {
        flex: 1 1 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
    .category-grid-item:last-child {
        margin-bottom: 0;
    }
    .category-grid-item img {
        height: 300px;
    }
    .category-text-overlay {
        padding: 10px 8px;
    }
    .category-text-overlay h3 {
        font-size: 1rem;
    }
}