html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #F5DCE0;
}

header {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

hr {
    width: 60%;
}

body {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.wrapper {
    min-width: 100%;
    display: grid;
}

.desc {
    visibility: hidden;
    margin: 0;
    padding: 1px 0;
}

.search-wrapper {
    display: flex;
    width: 80%;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.search-container {
    display: flex;
    width: 100%;
    grid-template-columns: auto auto;
    background-color: #F5D6E0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.search-container:hover {
    background-color: #DFC5CA;
}

.search-icon {
    display: flex;
    padding: 10px 10px;
    align-self: center;
}

input {
    width: 100%;
    padding: 10px 20px;
    font-size: 16px;
    transition: all 0.2s ease;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.sort-container {
    flex: 0 0 auto;
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.sort-button {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-family: sans-serif;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sort-button:hover {
    background-color: #f0f0f0;
}

.sort-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-top: 4px;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 200px;
    opacity: 0;
}

.sort-dropdown.show {
    display: block;
    opacity: 1;
}

.sort-option {
    padding: 10px 16px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
}

.sort-option:hover {
    background-color: #f0f0f0;
}

.counter {
    display: flex;
    width: 80%;
    justify-content: left;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 2px 0;
}

.shell {
    width: 80%;
    min-height: 35em;
    margin: 0 auto;
    padding: 30px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

}

.no-results-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #DFC5CA;
    padding: 20px;
    border: 1px solid #ccc;
    z-index: 1000;
}

.container {
    margin: 10px;
    flex: 1 1 calc(20% - 20px);
    display: flex;
    max-width: 175px;
    min-width: 150px;
}

.marketplace-link {
    text-decoration: none;
    color: inherit;
}

.img-txt-split {
    display: grid;
    gap: 4px;
}

.image {
    width: 100%;
    display: block;
    border-radius: 4px;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
    transition: all 0.3s ease;
}

.image:hover {
    transform: scale(1.05);
}

.bef-aft-container {
    display: flex;
    gap: 5px;
}

.aft-span {
    text-decoration: line-through;
    color: gray;
}

.name-span {
    font-weight: bold;
}

footer {
    bottom: 2rem;
    width: 100%;
    margin: 0 auto;
}

.footer {
    display: flex;
    box-sizing: border-box;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    font-size: 8pt;
    gap: 20rem;
}

body.modal-open .wrapper,
body.modal-open header,
body.modal-open footer {
    filter: blur(5px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal {
    background: #F5DCE0;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
    animation: fadeIn 0.2s ease-in-out;
}

.modal p {
    white-space: pre-line;
}

.modal-image {
    width: 80%;
    border-radius: 10px;
    margin-bottom: 10px;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 32px;
    height: 32px;
    border: 2px solid #999;
    border-radius: 50%;

    cursor: pointer;
}

/* Create X using pseudo-elements */
.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;

    width: 16px;
    height: 2px;
    background: #999;

    transform-origin: center;
}

/* Rotate to form X */
.modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #F5D6E0;
    color: black;
    text-decoration: none;
    border: 2px solid #999;
    border-radius: 8px;
    transition: background-color 0.3s, border-color 0.3s;
}

.modal-button:hover {
    background-color: rgba(223, 197, 202, 0.8);
    border-color: #666;
}

.old-price {
    text-decoration: line-through;
    color: gray;
    margin-left: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    .desc {
        visibility: visible;
        font-size: 8pt;
        text-align: center;
        padding: 4px 0;
    }
    .search-wrapper{
        width: 100%;
    }
    input {
        font-size: 12px;
    }
    .sort-container {
        position: relative;
    }
    .sort-dropdown {
        right: 0;
        left: auto;
    }
    .no-results-message {
        left: 30%;
        transform: translate(-20%, -50%);
    }
    .counter {
        width: 100%;
        font-size: 10pt;
    }
    .shell {
        font-size: 10pt;
        width: auto;
        min-height: 38rem;
    }
    .container {
        max-width: 122.5px;
        min-width: 105px;
        margin: .5rem;
    }
    .footer {
        font-size: 6pt;
        gap: 2rem;
    }
}

@media (max-width: 410px) {
    .shell {
        min-height: 33rem;
    }
}