/* ================================
   Normalize / Base
================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    /*! line-height: 1.15; */
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: Helvetica, Verdana, Arial, 'Liberation Sans', FreeSans, sans-serif;
    font-size: 86%;
    display: flex;
    flex-wrap: wrap;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ================================
   Layout
================================ */
header,
footer {
    flex-basis: 100%;
    flex-shrink: 0;
}

article {
    /* flex-basis: 60%; */
    min-height: 82vh;
    padding: 2ex 2ex 5vh 2ex;
    max-width: 50em;
    width: 100%;
}

body>nav {
    min-width: 16em;
    padding: 2ex 0;
    border-right: 1px solid #ddd;
}

/* ================================
   Header
================================ */
header nav {
    display: flex;
    justify-content: space-between;
    color: white;
    padding: 0.3em;
    border-bottom: 2px solid black;
    font-size: 91%;
}

header h1 span {
    margin-left: 1em;
    font-size: 50%;
    font-style: italic;
}

header h2 {
    margin: 0;
    padding: 1ex 10px;
    border-bottom: 1px solid #ddd;
    font-weight: normal;
}

header a:hover {
    text-decoration: none;
}

/* ================================
   Sidebar / Navigation
================================ */
nav ul {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    /*! padding-bottom: 2ex; */
}

nav li ul {
    padding-left: 0.6em;
}

body>nav>div {
    border-bottom: 1px solid #ddd;
    padding-bottom: 2ex;
}

body>nav>div a,
body>nav>div span {
    display: block;
    padding: 0.25em 1ex 0.25em 2mm;
    font-weight: bold;
    font-size: 102%;
    color: rgb(0, 102, 204);
    text-transform: capitalize;
}

body>nav>div a:hover {
    color: white;
    background-color: #1177aa;
    border-left: 0.2em solid #eee;
    text-decoration: none;
}

body>nav>div p {
    margin: 0 0 0.5em 2mm;
    padding-top: 1em;
    font-weight: bold;
}

body>nav>div span {
    color: #1177aa;

    display: block;
    text-transform: capitalize;
    font-weight: bold;
    padding: 0.25em 1ex 0.25em 2mm;
    font-size: 102%
}

body>nav>div a {
    color: #1177aa;

    display: block;
    text-transform: capitalize;
    font-weight: bold;
    padding: 0.25em 1ex 0.25em 2mm;
    font-size: 102%
}



nav li a,
nav li span {
    border-left: 1px dashed #ddd;
}

/* ================================
   Article / Content
================================ */
article h1,
article h2 {
    color: #1177aa;
    font-weight: bold;
    border-bottom: 2px solid #1177aa;
}

article h3,
article h4,
article h5,
article h6 {
    color: rgb(0, 102, 204);
    font-weight: bold;
    margin-top: 2em;
}

article a {
    color: rgb(0, 102, 204);
}

article a:hover {
    color: rgb(100, 135, 220);
}

/* ================================
   Footer
================================ */
footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #ddd;
}

footer div {
    padding: 1em;
}

/* ================================
   Tables
================================ */
table {
    /*! border-collapse: collapse; */
}

table.basic_table {
    width: 100%;
    border: 1px solid rgba(128, 128, 128, 0.5);
}

table.basic_table th {
    background-color: rgb(100, 135, 220);
    color: white;
}

table.basic_table tr:nth-child(odd) {
    background-color: rgba(128, 128, 128, 0.1);
}

table.catalog_table {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
}

table.catalog_table th,
table.catalog_table td {
    padding: 5px 8px;
    border-bottom: 1px solid #1177aa;
}

table.catalog_table th {
    border-top: 1px solid #1177aa;
}

table.catalog_table tr:hover {
    background-color: #ccc;
}

table.catalog_table a {
    color: black;
}

/* ================================
   UI Elements
================================ */
.category-label,
.sidebar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toggle-btn {
    width: 9px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: #c0c0c0;
    color: #000;
    border: 1px solid;
    border-color: #fff #404040 #404040 #fff;
    cursor: pointer;
    user-select: none;
}

.toggle-btn:active {
    border-color: #404040 #fff #fff #404040;
}

.current {
    font-style: italic;
    color: #000;
}

.sort_link {
    color: #888;
    padding: 0 10px;
    text-decoration: underline;
}

.sort_current {
    font-weight: bold;
    cursor: default;
}

.breadcrumb {
    font-size: 0.9em;
    color: #888;
    font-weight: bold;
    padding-top: 0.25em;
}

.breadcrumb a {
    color: #888;
    text-decoration: underline;
}

.price {
    font-size: 1.5em;
}

/* ================================
   Product Gallery / Lightbox
================================ */
.product-gallery {
    max-width: 500px;
}

.gallery-main img {
    /*! width: 100%; */
    cursor: zoom-in;
    border: 1px solid #ccc;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumbs img.active {
    border-color: #007bff;
}

#mainImage {
    max-height: 300px;
    height: 300px;

}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
}

.menu-toggle {
    display: none;
    /* hidden on desktop */
}

@media (max-width: 700px) {
    article {
        flex-basis: auto;
        width: 100%;
        min-height: none;
        padding: 2ex;
    }
}

@media (max-width: 900px) {

    /* Show toggle button */
    .menu-toggle {
        display: block;
    }

    /* Hide sidebar by default */
    #side-bar {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: 0;
        background: #fff;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1000;
    }

    /* Sidebar visible when toggled */
    #side-bar.open {
        transform: translateX(0);
        height: 100vh;
    }

    /* Optional: prevent content shift */
    article {
        margin-left: 0;
    }

    article.hidden {
        display: none;
    }
}