nav {
    display: flex;
    justify-content: flex-end;
    background-color: black;
    color: white;
    text-align: center;
}
.logo {
    font-family: VT323-Regular, monospace;
    font-size: 24px;;
    color: goldenrod;
    margin-right: auto;
    padding-left: 15px;
}
nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
}
nav a:hover {
    text-decoration: underline;
    color: #00ffff;
}
nav ul {
    list-style: none;
    display: flex;
}
.search-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-right: 8px;
}
.open-search {
    border: none;
    cursor: pointer;
    font-family: VT323-Regular;
    font-size: 16px;
}
.open-search:hover {
    color: #00ffff;
    background-color: black;
    text-decoration: underline;
}
.search-bar-popup {
    display: none;
    position: fixed;
    right: 20px;
    top: 45px;
    border: 1px solid white;
    background-color: black;
}
.search-container {
    display: flex;
    align-items: flex-end;
    width: 400px;
    height: 100px;
    background-color: black;
}
.search-container label {
    font-size: 20px;
    margin: 0 0 -4px 2px;
}
.search-container input[type=button] {
    display: flex;
    align-items: flex-start;
    background: black;
}
.search-container input[type=text] {
    margin: 0 0 3px 5px;
    width: 100%;
    border: none;
    background-color: black;
    color: lightgrey;
    font-family: VT323-Regular;
    font-size: 20px;
}
.search-container input[type=text]:focus {
    outline: none;
}
.button-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background-color: red;
    border: none;
    cursor: pointer;
    color: white;
    font-weight: bold;
}
.button-close:hover {
    background-color: darkred;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
.main-store {
    flex: 1;
    padding: 20px;
    margin-bottom: 80px;
}
.main-store h1 {
    text-align: center;
    margin-bottom: 30px;
}
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid white;
    padding: 20px;
    background-color: black;
    transition: transform 0.2s;
    min-height: 400px;
}
.product-item:hover {
    transform: translateY(-5px);
    border-color: #00ffff;
}
.product-item pre {
    margin-bottom: 15px;
    font-size: 6px;
    height: 150px;
}
.product-item h3 {
    margin: 10px 0;
    font-size: 20px;
}
.store-grid .product-item:nth-child(1) pre,
.store-grid .product-item:nth-child(2) pre {
    font-size: 14px;
}
.product-price {
    font-size: 18px;
    color: pink;
    margin: 5px 0 15px 0;
}
.product-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.product-controls label {
    font-size: 14px;
}
.product-controls select {
    background-color: black;
    color: white;
    border: 1px solid #00ffff;
    padding: 5px 10px;
    font-family: VT323-Regular;
    font-size: 14px;
    cursor: pointer;
}
.add-to-cart-btn {
    background-color: #00ffff;
    color: black;
    border: 2px solid #00ffff;
    padding: 10px 20px;
    cursor: pointer;
    font-family: VT323-Regular;
    font-size: 16px;
    width: 100%;
    transition: all 0.2s;
}
.add-to-cart-btn:hover {
    background-color: white;
    border-color: white;
}
.cart-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: auto;
}
.shopping-cart pre {
    color: white;
    font-size: 2px;
    margin: 0;
    padding: 0;
}
.cart-trigger {
    position: fixed;
    bottom: 60px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.open-cart {
    border: none;
    background-color: white;
    color: black;
    padding: 0;
    cursor: pointer;
    font-family: VT323-Regular;
    font-size: 18px;
}
.open-cart:hover {
    background-color: black;
    color: #00ffff;
    text-decoration: underline;
}
.cart-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.cart-popup-content {
    position: relative;
    background-color: black;
    border: 2px solid #00ffff;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid white;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.cart-items {
    min-height: 200px;
    margin-bottom: 15px;
}
.cart-footer {
    border-top: 1px solid white;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.checkout-btn {
    background-color: #00ffff;
    color: black;
    padding: 8px 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.checkout-btn:hover {
    background-color: white;
}
footer {
    position: fixed;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    bottom: 0;
    left: 0;
    padding: 0 30px;
    background-color: black;
}
.v-left {
    text-align: left;
}
.c-right {
    text-align: right;
}
.v-left a, .c-right a {
    color: pink;
    text-decoration: none;
}
.v-left a:hover, .c-right a:hover {
    text-decoration: underline;
    color: #00ffff;
}

/* tablets and below */
@media (max-width: 900px) {
    .store-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    .main-store {
        padding: 15px 15px 80px;
    }
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    nav a {
        padding: 8px 10px;
        font-size: 14px;
    }
}
/* tablets */
@media (max-width: 768px) {
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .product-item {
        min-height: 360px;
    }
    .product-item pre {
        height: 140px;
    }
}
/* mobile */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .logo {
        font-size: 20px;
    }
    .search-container {
        width: 300px;
    }
    .store-grid {
        grid-template-columns: 1fr;
    }
    .product-item {
        min-height: 340px;
    }
    .product-item pre {
        height: 130px;
    }
    nav ul {
        padding: 0;
        margin: 0;
    }
    nav a {
        width: 100%;
        text-align: center;
    }
}
/* small phones */
@media (max-width: 400px) {
    .search-container {
        width: 300px;
    }
    .product-item h3 {
        font-size: 18px;
    }
    .product-price {
        font-size: 16px;
    }
    .add-to-cart-btn {
        font-size: 15px;
    }
}