* {
    box-sizing: border-box;
}

body {
    font-family: "SF Pro SC", "HanHei SC", "SF Pro Text", "Myriad Set Pro", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    font-size: 15px
}

h1 {
    font-size: 36px
}

h2 {
    font-size: 30px
}

h3 {
    font-size: 24px
}

h4 {
    font-size: 20px
}

h5 {
    font-size: 18px
}

h6 {
    font-size: 16px
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 10px 0;
    font-weight: normal
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%
}

a {
    text-decoration: none;
    border: none;
    color: inherit;
    outline: none
}

div {
    overflow: auto
}

hr {
    border: 0;
    width: 100%;
    height: 1px;
    background-color: lightgray;
    margin: 20px 0
}

img {
    -webkit-user-drag: none;
}

p {
    overflow: hidden
}

.top-bar {
    color-scheme: light dark;
    text-align: center;
    position: fixed;
    background-color: honeydew;
    width: 100%;
    height: 50px;
    min-width: 300px;
    top: 0;
    z-index: 2
}

.title {
    font-size: 16px;
    height: 100%;
    padding-top: 4px;
    overflow: hidden
}

.topleft-button {
    float: left;
    width: 60px;
    height: 50px;
    background-image:url('resources/chevron.left.svg');
    background-size: 9px 16px
}

.topright-button {
    float: right;
    width: 60px;
    height: 50px;
    padding: 5px;
    background-image: url('resources/cart.svg');
    background-size: 23px 20px;
    background-position: 17px 20px!important
}

.line-3-horizontal {
    background-image:url('resources/line.3.horizontal.svg');
    background-size: 20px 10px
}

.link-button {
    display: inline-block;
    color: white;
    background-color: salmon;
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none
}

.link-button.disabled {
    background-color: lightgray;
    pointer-events: none
}

.sidebar, .cart {
    color-scheme: light dark;
    height: 100%;
    position: fixed;
    overflow: auto;
    z-index: 4;
    transition: left 0.2s, right 0.2s
}

.sidebar {
    width: 220px;
    left: -220px;
    background-color: snow
}

.sidebar.open {
    left: 0
}

.bar-item {
    margin: 0;
    padding: 16px;
    width: 100%;
    font-size:16px;
    display: block;
    text-align: left;
    cursor: pointer;
    overflow: hidden
}

.bar-item:hover {
    color-scheme: light dark;
    background-color: lightgray
}

.cart {
    width: 240px;
    right: -240px;
    background-color: whitesmoke
}

.cart.open {
    right: 0
}

.cart-content {
    width: 100%;
    top: 50px;
    bottom: 50px;
    position: absolute
}

.cart-container {
    padding: 10px;
    text-align: left
}

.cart-image {
    width: 100px;
    height: 100px;
    float: left;
    display: flex
}

.cart-text {
    width: calc(100% - 100px);
    height: 70px;
    padding: 5px 2%;
    display: flex;
    align-items: center;
    overflow: hidden
}

.cart-price {
    height: 30px;
    width: calc(100% - 170px);
    padding: 5px 2%;
    display: inline-block;
    overflow: hidden
}

.cart-select {
    width: 44px;
    height: 30px;
    margin: 0;
    padding: 2px;
    display: inline-block;
    overflow: hidden
}

.quantity-select, .cart-quantity-select {
    width: 40px;
    height: 26px
}

.cart-remove {
    width: 26px;
    height: 30px;
    margin: 0;
    display: inline-block;
    background-color: snow;
    background-image:url('resources/trash.svg');
    background-size: 19px 23.5px
}

.checkout-container {
    width: 100%;
    height: 50px;
    bottom: 0;
    font-size: large;
    position: absolute;
    text-align: center;
    padding: 4px
}

.buy-view {
    color-scheme: light dark;
    background-color: snow;
    margin: 10px max(0px, calc(50% - 150px));
    padding: 20px;
    border: solid thin;
    border-radius: 10px
}

input:disabled + label {
    color: gray;
}

.anchor {
    scroll-margin-top: 60px
}

.content-view {
    margin: auto;
    min-width: 300px;
    max-width: 1600px;
    padding: 50px 2.5% 0 2.5%;
    text-align: center;
    transition: left 0.2s, right 0.2s
}

.content-view:after,
.content-view:before {
    content: "";
    display: table;
    clear: both
}

.center {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%)
}

.collapse {
    max-height: 580px;
    overflow: hidden
}

.display-bottommiddle {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0%);
    -ms-transform: translate(-50%, 0%)
}

.display-left {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(0%, -50%);
    -ms-transform: translate(-0%, -50%)
}

.display-middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    max-height:100%
}

.display-right {
    position: absolute;
    top: 50%;
    right: 0%;
    transform: translate(0%, -50%);
    -ms-transform: translate(0%, -50%)
}

.overlay, .modal {
    position:fixed;
    left:0;
    right:0;
    top:0;
    bottom:0;
}

.overlay {
    z-index: 3;
    background-color:rgba(1,1,1,0);
    transition: background-color 0.2s;
    pointer-events: none
}

.overlay.active  {
    background-color:rgba(1,1,1,0.5);
    pointer-events: auto
}

.modal {
    z-index: 5;
    background-color:rgba(1,1,1,0.5);
    display: none
}

.modal.active {
    display: block
}

.slide-button {
    background-color: silver;
    width: 40px;
    height: 40px;
    opacity: 0.5;
    border-radius: 8px;
    background-size: 9px 16px;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer
}

.half {
    float: left;
    width: 100%;
    margin: 5px 0;
    position:relative
}

.item-view {
    float: left;
    width: 90%;
    margin: 5px 5%
}

.image-view {
    width: 100%;
    height: 160px;
    margin: auto;
    display: flex
}

.image-container {
    width: 100%;
    height: clamp(300px, 50vw, 400px);
    margin: auto;
    display: flex;
    scroll-snap-type: x mandatory
}

.image-slide {
    scroll-snap-align: center;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    padding: 0 5%;
    display: flex
}

.image-view img, .image-slide img, .cart-image img {
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    border-radius: 10px
}

.item-title {
    margin-top: 10px
}

.item-title, .item-price {
    line-height: 25px;
    font-size:large;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis
}

.item-description {
    height: 40px;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.item-button {
    display: block;
    height: 40px;
    align-items: center;
}

.item-message {
    line-height: 20px;
    color: salmon;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis
}

.description-container {
    margin: 10px 10%;
    text-align: left
}

.width-guide {
    width: min(100%, calc(50% + 400px));
    margin: 10px auto;
}

.youtube {
    min-height: 300px;
    aspect-ratio: 16/9;
    border: none
}

.contact {
    width: 100%;
    height: 180px;
    margin: auto;
    border: none;
    position: relative
}

.twitter {
    width: 100%;
    height: clamp(400px, 50vw, 500px);
    margin: auto;
    border: medium solid;
    border-radius: 12px;
    border-color: rgb(29,161,242);
}

.contact-view {
    width: 120px;
    margin: 0 5px;
    float: left
}

.social {
    width: 120px;
    margin: 5px;
    display: inline-block;
    text-align:left
}

.my-social {
    width: 150px;
    margin: 30px auto;
    display: block;
    text-align:left;
    font-size: 16px
}

.social-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px
}

.youtube-channel {
    width: 280px;
    margin: auto
}

.video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px
}

.video-title {
    height: 60px;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
    
}

@media (min-width:350px) {
    .item-view {
        width: 48%;
        margin: 5px 1%
    }
}

@media (min-width:500px) {
    .item-view {
        width: 45%;
        margin: 5px 2.5%
    }
    .image-view {
        height: 200px
    }
    .collapse {
        max-height: 660px
    }
    .youtube-channel {
        width: 450px;
    }
}

@media (min-width:700px) {
    .half {
        width: 50%
    }
    .half.left {
        width: 60%
    }
    .half.right {
        width: 40%
    }
    .item-view {
        width: 30%;
        margin: 5px 1.66%
    }
    .description-container {
        margin: 30px 10%;
    }
    .contact {
        height: clamp(300px, 50vw, 400px)
    }
    .social {
        margin: 8px
    }
}

@media (min-width:1000px) {
    .item-view {
        width: 22.5%;
        margin: 5px 1.25%
    }
}

@media (min-width:1300px) {
    .content-view.left {
        margin-left: max(220px, calc(50% - 790px));
    }
    .content-view.right {
        margin-right: max(240px, calc(50% - 770px));
    }
    .overlay {
        display: none
    }
    body:has(.overlay.active) {
        overflow: auto
    }
}

@media (min-width:1500px) {
    .item-view {
        width: 18%;
        margin: 5px 1%
    }
}

@media (min-width:1800px) {
    .item-view {
        width: 15%;
        margin: 5px 0.83%
    }
}

.segment-controller {
    border: 1px solid lightgray;
    background-color: lightgray;
    display: flex;
    overflow: hidden;
    border-radius: 11px;
    position: relative
}

.label {
    width: 50%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
    cursor: pointer
}

.bg {
    color-scheme: light dark;
    background-color: honeydew;
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    transition: left 0.5s;
    border-radius: 10px
}

[type="radio"] {
    display: none;
    position: relative
}

[type="radio"]:nth-of-type(1):checked ~ .bg {
    left: 0
}

[type="radio"]:nth-of-type(2):checked ~ .bg {
    left: 50%
}

[type="radio"]:checked + .label {
    cursor: default
}

:root {
    color-scheme: light dark;
    color: black
}

.icon {
    color-scheme: light dark;
    color: black;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer
}

@media (prefers-color-scheme: dark) {
    :root {
        filter: brightness(0.9);
        color: white
    }

    .top-bar, .bg {
        background-color: darkolivegreen
    }
    
    .sidebar, .buy-view {
        background-color: rosybrown
    }

    .segment-controller, .bar-item:hover, .cart {
        background-color: dimgray
    }

    .icon {
        filter: invert(1)
    }

}