/* -----------------------------------------------------------
   Global Reset + Base Layout
----------------------------------------------------------- */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

/* -----------------------------------------------------------
   Header + Logo
----------------------------------------------------------- */
.header {
    width: 100%;
    height: auto;
    background-color: #bebebe;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

.site-logo img {
    max-width: 100%;       /* scales on desktop */
    height: auto;
    display: block;
}

/* -----------------------------------------------------------
   Footer + Navigation
----------------------------------------------------------- */
.footer {
    margin-top: auto; /* keep footer at bottom */
}

.footer nav {
    width: 100%;
    height: auto;       /* full width on mobile */
    background-color: grey;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;        /* wrap links on small screens */
    padding: 0 10px;
    box-sizing: border-box;
}

.footer nav a {
    margin-right: 20px;
    color: white;
    text-decoration: none;
}

/* -----------------------------------------------------------
   Gallery Grid (Main Page)
----------------------------------------------------------- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 1500px;
}

.grid-item {
    background-color: #ddd;
    border: 1px solid #999;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* -----------------------------------------------------------
   Item Detail Page Layout - FIXED
----------------------------------------------------------- */
.item-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.item-name {
    font-size: 2rem;
    text-align: center;
    margin: 20px 0;
}

/* MAIN IMAGE TOP */
.main-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.main-image img {
    width: 100% !important;
    height: 500px !important;
    object-fit: cover !important;
    border: 3px solid #999 !important;
    border-radius: 4px !important;
    display: block !important;
}

/* 50/50 LAYOUT BELOW MAIN IMAGE */
.product-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.thumb-container {
    flex: 1;
    min-width: 0;
}

.product-description {
    flex: 1;
    min-width: 0;
    padding: 1rem 0;
}

/* THUMBS LEFT - HOMEPAGE GRID STYLE */
.thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.thumbnails .thumb {
    background-color: #ddd;
    border: 1px solid #999;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
}

.thumbnails .thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.thumbnails .thumb:hover {
    border-color: #333;
}

/* -----------------------------------------------------------
   Mobile Responsiveness
----------------------------------------------------------- */
@media (max-width: 600px) {

    /* Header */
    .header {
        height: auto;
        padding: 0 10px;
        justify-content: flex-start;
        align-items: center;
        width: 100vw;        /* full viewport width */
        min-width: 100%;
    }

    .site-logo img {
        max-height: 50px;     /* scale down on mobile */
        width: auto;
        display: block;
    }

    /* Grid pages — 1 column on phones */
    .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    /* Item pages — stack vertically */
    .item-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    .detail-img {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .item-detail {
        width: 100%;
        padding: 10px 0;
    }

    /* Footer/nav */
    .footer nav {
        height: auto;
        padding: 10px;
        width: 100vw;         /* full viewport width */
        min-width: 100%;
        flex-wrap: wrap;
    }

    .footer nav a {
        margin-right: 10px;
        font-size: 0.9rem;
    }
}
