:root {
    --deep-indigo: #4b0082;
    --royal-purple: #6a0dad;
    --soft-violet: #9370db;
    --lavender: #e6e6fa;
    --light-lavender: #f8f5ff;
    --orchid: #da70d6;
    --dark-orchid: #9932cc;
    --blue-violet: #8a2be2;
    --medium-purple: #9370db;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-lavender);
}

/* HEADER */
header {
    background-color: var(--deep-indigo);
    color: white;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* MAIN CONTENT */
main {
    padding-top: 100px;
}

/* BACKGROUND / HERO */
.background {
    position: relative;
    margin-top: 20px;
    height: 350px;
    background-color: var(--light-lavender);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

.background::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.background h1 {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 32px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
    text-align: center;
    margin: 0;
}

/* SEARCH BAR */
.search-bar {
    margin: 1rem auto;
    max-width: 800px;
    position: relative;
    z-index: 2;
}
.search-bar form {
    display: flex;
    gap: 1rem;
    width: 100%;
}
.search-bar input[type="text"] {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 40px;
    font-size: 1rem;
    background: white;
    color: var(--deep-indigo);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.search-bar input[type="text"]::placeholder {
    color: var(--medium-purple);
    font-style: italic;
}
.search-bar input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 8px 3px var(--blue-violet);
    color: var(--royal-purple);
}
.search-bar button {
    padding: 0.9rem 2rem;
    background: linear-gradient(45deg, var(--blue-violet), var(--dark-orchid));
    border: none;
    color: white;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(138,43,226,0.4);
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.search-bar button:hover {
    background: linear-gradient(45deg, var(--dark-orchid), var(--blue-violet));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(138,43,226,0.6);
}

/* PRODUCT GRID */
.product-container {
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    width: 100%;
}

/* PRODUCT CARD */
.product-card-link {
    text-decoration: none;  /* remove underline */
    color: inherit;
    display: block;
}
.product-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(75,0,130,0.25);
}

/* MEDIA */
.media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.media-slide {
    position: absolute;
    top:0; left:0;
    width:100%; height:100%;
    object-fit: cover;
    transition: opacity 1s ease;
}
.media-slide.hidden { opacity:0; z-index:0; }
.media-slide.visible { opacity:1; z-index:1; }

/* PRODUCT INFO */
.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.product-info h3 {
    font-size: 18px;
    color: var(--blue-violet);
    margin-bottom: 5px;
    font-weight: 600;
}
.product-info p {
    font-size: 14px;
    color: #444;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-info p.description {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* max 3 lines */
    -webkit-box-orient: vertical;
}
.product-info .price {
    font-weight: bold;
    color: var(--dark-orchid);
}
.product-info .stock-high { color: green; font-weight: bold; }
.product-info .stock-medium { color: orange; font-weight: bold; }
.product-info .stock-low { color: red; font-weight: bold; }

/* RESPONSIVE */
@media(max-width:1440px){.product-container{grid-template-columns:repeat(4,1fr);}}
@media(max-width:1024px){.product-container{grid-template-columns:repeat(3,1fr);}}
@media(max-width:768px){.product-container{grid-template-columns:repeat(2,1fr);gap:20px;}}
@media(max-width:480px){.product-container{grid-template-columns:1fr;}}
