/* PRODUCTS SECTION */

#products-title {
    max-width: 1350px;
    margin: 0px auto;
    padding: 40px 0px 10px 40px;
}

#products-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-template-rows: 335px;
    justify-items: center;
    max-width: 1350px;
    margin: 0px auto;
    justify-content: center;
    padding: 0px 30px 40px 30px;
}

.error-statement {
    padding-top: 170px;
}

/* PRODUCT HOLDER */

.product-holder {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 230px;
    height: 330px;
    padding: 23px;
}

.category-card {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.category-card:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

.product-holder img {
    display: flex;
    flex-direction: row;
    align-self: center;
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
}

.product-holder div {
    display: flex;
    flex-direction: column;
}

.product-price {
    font-weight: 700;
    align-self: flex-end;
    margin-top: 15px;
}

.product-name {
    font-weight: 700;
}

/* CATEGORIES */

#categories-title {
    max-width: 1350px;
    margin: 0px auto;
    padding: 30px 0px 20px 40px;
}

#categories-section {
    display: flex;
    flex-wrap: wrap;
    margin: 0px auto;
    margin-bottom: 40px;
    padding: 0px 30px;
    max-width: 1350px;
}

.category-card {
    height: 300px;
    flex-grow: 1;
    flex-wrap: wrap;
    min-width: 200px;
    margin: 10px;
    border-radius: 10px;
    padding: 15px;
    background-size: cover;
    
    /* ADD THIS LINE */
    align-items: flex-start; 
    
    /* EXISTING PROPERTIES */
    justify-content: space-between;
    display: flex;
    flex-direction: column;
}

.right {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.category-card p {
    display: inline-flex;
    padding: 12px 18px;
    border-radius: 30px;
    color: white;
    margin: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: #00000075;
}

.card1 {
    background-image: url(/Images//Categories/1.png);
}

.card2 {
    background-image: url(/Images//Categories/2.png);
}

.card3 {
    background-image: url(/Images//Categories/3.png);
}

.category-card h2 {
    color: white;
    margin: 10px 0px 0px 10px;
}

/* Define the glow pulse animation with a fading border (DARK SAGE GREEN) */
@keyframes glowPulse {
    0% {
        /* Start: Border is transparent, subtle initial glow */
        border-color: rgba(136, 156, 136, 0); /* Dark Sage Green border, 0% opacity */
        box-shadow: 0 0 10px rgba(136, 156, 136, 0.4); /* Subtle dark sage glow */
    }
    25% {
        /* Border is fully opaque */
        border-color: rgba(136, 156, 136, 1); /* Solid Dark Sage Green */
    }
    50% {
        /* Peak: Brightest glow, border remains solid */
        border-color: rgba(136, 156, 136, 1);
        box-shadow: 0 0 25px rgba(136, 156, 136, 0.8); /* Wider, soft peak glow */
    }
    100% {
        /* End: Border fades to transparent, glow disappears */
        border-color: rgba(136, 156, 136, 0); 
        box-shadow: 0 0 0 rgba(0, 0, 0, 0); 
    }
}

/* Apply the animation class to the target input on the home page */
.glow-animate {
    /* Set the initial border width and style, but make the color transparent */
    border: 2px solid rgba(136, 156, 136, 0); 
    /* Animation runs once (1) over 1.5s, then fades out */
    animation: glowPulse 1.5s ease-in-out 1; 
}

/* Optional: Keep a permanent subtle glow while focused */
.main-search-input:focus {
    /* Use the same peak glow for a consistent look when actively focused */
    box-shadow: 0 0 25px rgba(136, 156, 136, 0.8); 
    /* Border becomes permanently visible and solid dark sage green when focused */
    border: 2px solid #889C88; /* Solid Dark Sage Green */
}

/*
 * CSS for Title Truncation
 * Apply these styles to the product-name-wrapper class added in home.js
 */
.product-name-wrapper {
    /* Ensures the div containing the title is the width of the product card */
    width: 100%; 
    /* The magic properties for single-line ellipsis */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-name-wrapper,
.username-wrapper {
    /* Required to contain the text and prevent wrapping */
    width: 100%; 
    overflow: hidden; 
    white-space: nowrap; 
}

.product-name, 
.seller-username {
    /* The core properties that apply the ellipsis */
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; /* Prevents text from wrapping to the next line */
    /* Ensure the inner element fills its wrapper */
    display: block; 
    width: 100%;
    margin: 0; /* Remove default paragraph margins */
}

/* --- HERO SECTION STYLES (SLIDING CAROUSEL) --- */

/* Hero Section Container (Full width, fixed height) */
#hero-section {
    position: relative;
    width: 100%;
    height: 600px;
    max-width: 1400px;
    border-radius: 30px 30px 0px 0px;
    overflow: hidden;
    margin: 20px auto 40px auto;
}

/* Slideshow Container */
.slideshow-container {
    height: 100%;
    position: relative;
    display: flex; /* KEY: Makes slides line up horizontally */
    /* width is set dynamically by JavaScript */
    /* Add transition for smooth sliding */
    transition: transform 1.0s ease-in-out; 
}

/* Individual Slide (mySlides) */
.mySlides {
    display: block; /* KEY: Must be visible to slide */
    flex-shrink: 0; /* Prevents slides from shrinking */
    width: 100%; /* Takes up 100% of the viewport width */
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative; 
    opacity: 1; /* Always fully opaque for sliding */
    transition: none; 
}

.slide-content-wrapper {
    width: 100%; /* FIX: Restrict the content to 75% of the viewport */
    height: 100%; 
    margin: 0 auto; /* FIX: Centers the 75% wide content block */
    position: relative; 
}

.full {
    flex-grow: 1;
}

/* Content inside the slide */
.hero-content {
    position: absolute;
    top: 60%;
    left: 3%; /* Use 5% margin for large screens */
    transform: translateY(-50%);
    color: white; 
    max-width: 500px; /* Base maximum width for content */
    z-index: 2; 
    /* Default padding to help with wrapping and create a right buffer on large screens */
    padding-right: 40px; 
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hero-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #0000006b;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    transition: background-color 0.3s;
    color: white;
    backdrop-filter: blur(5px);
}

/* 📱 Responsive Adjustments for Small Screens (600px and below) */
@media (max-width: 600px) {
    .hero-content {
        /* FIXED MARGINS FOR MOBILE */
        max-width: 90%; /* Allows content to take up most of the screen width */
        left: 30px; /* Fixed left margin */
        padding-right: 400px; /* Fixed right padding to ensure content doesn't hit the edge */
    }
    
    .hero-content h1 {
        font-size: 2.2em; /* Smaller font for better fit on mobile */
    }
    
    .hero-content p {
        font-size: 1em; /* Smaller paragraph font */
    }
}

/* --- DOT NAVIGATION STYLES --- */

.dots-container {
    text-align: center;
    position: absolute; /* Position relative to #hero-section */
    bottom: 25px;
    width: 100%;
    z-index: 3;
}

.dot {
    cursor: pointer;
    height: 5px;
    width: 5px;
    margin: 0 4px;
    background-color: #bbb;
    display: inline-block;
    transition: background-color 0.6s ease;
    border-radius: 50%;
}

.active, .dot:hover {
    background-color: #717171;
}

/* ---------------------------------------------------------------- */
/* MEDIA QUERY FOR SMALL SCREENS (600px and under) */
/* ---------------------------------------------------------------- */
@media (max-width: 600px) {   
    .category-card {
        height: 200px;
        flex-grow: 1;
        flex-wrap: wrap;
        min-width: 200px;
        margin: 10px;
        border-radius: 10px;
        padding: 15px;
        background-size: cover;
    }  
    #search input {
        margin-bottom: 25px;
    }
    .product-holder img {
        width: 140px;
        height: 140px;
    }
    .product-holder {
        width: 180px;
        height: 260px;
    }
    #products-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        grid-template-rows: 260px;
        gap: 10px;
        min-width: 370px;
    }
    #products-title {
        max-width: 1350px;
        margin: 0px auto;
        padding: 10px 0px 10px 40px;
    }
}

