@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

body {
    margin: 0;
    background-color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

/* Hero Banner matching the split-screen aesthetic */
.hero-banner {
    height: 200px;
    background: linear-gradient(rgba(236, 31, 39, 0.7), rgba(236, 31, 39, 0.7)), 
                url('../image/reuhub_loginpage.png') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    margin-top: 0px; /* Offset for fixed header */
}

.banner-content h1 {
    font-size: 42px;
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 300;
}

/* Container & Grid */
.main-container {
    width: 90%;
    max-width: 1400px;
    margin: 60px auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #333;
}

.view-all-link {
    font-size: 11px;
    text-decoration: none;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
}

/* Product Card Styling */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-card a { text-decoration: none; color: inherit; }

.image-box {
    position: relative;
    height: 250px;
    background: #f1f5f9;
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.type-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ec1f27; /* Brand Red */
    color: white;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
}

.item-details { padding: 20px; }

.item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #333;
}

.item-category {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.item-price {
    font-size: 18px;
    font-weight: 700;
    color: #ec1f27; /* Brand Red */
}

/* Base style for all pages with a sidebar is managed centrally in header.css */

/* Ensure the hero banner image/background stays contained */
.hero-banner {
    width: 100%;
    overflow: hidden;
}

/* --- CATEGORY SECTION --- */
.category-section {
    padding: 20px 0;
    margin-bottom: 30px;
}

.category-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto; /* Allows side-by-side horizontal scrolling */
    padding: 10px 5px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.category-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.category-card {
    position: relative;
    min-width: 160px; /* Fixed width for side-by-side consistency */
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0; /* Prevents boxes from squishing */
}

/* Background Image */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Overlay for bottom-left text alignment */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 50%);
    display: flex;
    align-items: flex-end; /* Align text to the bottom */
    padding: 12px; /* Padding from the bottom and left edges */
}

/* Bottom-Left Text with Black Shadow */
.card-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Strong black shadow for high contrast */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* --- INTERACTIVE EFFECTS --- */
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.category-card:hover .card-image {
    transform: scale(1.1);
}

.category-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(236, 31, 39, 0.8) 0%, rgba(0,0,0,0) 70%); /* Red tint on hover */
}

/* --- SEAMLESS CATEGORY ROW --- */
.category-seamless-container {
    margin: 20px 0 40px 0;
    background: #fff;
    border: 1px solid #eee; /* Subtle outer border like Shopee */
    overflow: hidden;
}

.category-row {
    display: flex;
    gap: 0; /* Ensures boxes touch side-by-side */
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for clean UX */
}

.category-row::-webkit-scrollbar {
    display: none;
}

.cat-tile {
    position: relative;
    flex: 0 0 140px; /* Fixed width for standard tile look */
    height: 140px; /* Square tiles */
    text-decoration: none;
    overflow: hidden;
    border-right: 1px solid #eee; /* Minimalist separator */
}

/* Tile Image */
.cat-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Bottom-Left Overlay with Shadow */
.cat-tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient ensures white text is always readable */
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 40%);
    display: flex;
    align-items: flex-end; /* Anchors text to bottom */
    padding: 12px;
}

/* High-Contrast Label */
.cat-tile-label {
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Heavy black shadow for luxury look */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    line-height: 1.2;
}

/* --- HOVER INTERACTIONS --- */
.cat-tile:hover .cat-tile-img {
    transform: scale(1.1); /* Subtle zoom within the tile */
}

.cat-tile:hover .cat-tile-overlay {
    /* Brand Red tint on hover to match UTHM theme */
    background: linear-gradient(to top, rgba(236, 31, 39, 0.6) 0%, rgba(0,0,0,0) 60%);
}

/* Mobile Optimizations (Max width 768px) */
@media screen and (max-width: 768px) {
    /* Reduce sidebar impact on mobile */
    .main-wrapper {
        margin-left: 0 !important; /* Hide sidebar offset on small screens */
        padding: 15px;
    }

    /* Make category tiles smaller for mobile screens */
    .cat-tile {
        flex: 0 0 110px; /* Slimmer boxes for mobile */
        height: 110px;
    }

    .cat-tile-label {
        font-size: 9px; /* Smaller text for mobile readability */
        padding-bottom: 5px;
    }

    /* Welcome Banner scaling */
    .welcome-banner h1 {
        font-size: 18px;
    }
    
    .welcome-banner p {
        font-size: 10px;
    }
}

@media screen and (max-width: 480px) {
    .cat-tile {
        flex: 0 0 100px; /* Smaller tiles for a 3-column look on mobile */
        height: 100px;
    }
    
    .cat-tile-label {
        font-size: 10px; /* Readable but compact text */
        text-shadow: 1px 1px 3px rgba(0,0,0,1);
    }
}