* {
    padding: 0px;
    /*內邊距 */
    margin: 0px;
    /*外邊距*/
    border: 0px;
    /*邊框*/
}

.welcome {
    background-color: antiquewhite;
    color: white;
    height: 105vh;
    background-image: url("images/computer_interior.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 50px;
}

.welcome h2 {
    font-size: 45px;
    margin-top: 60px;
}

.welcome p {
    display: flex;
    font-size: 28px;
    color: #cecece;
    margin: 18px 0;
}

.welcome a {
    font-size: 20px;
    color: white;
    text-decoration: none;
    border: 1px solid #d3c2a7;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.slogan {
    font-family: 標楷體, sans-serif;
    background-color: #000000;
    color: white;
    height: 200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 30px;
    line-height: 1.8em;
    padding-left: 3%;
}

.slogan p {
    text-align: center;
    flex-grow: 1;
    padding-right: 20px;
}

.slogan img {
    max-height: 100%;
    width: 35%;
}

.product {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: left;
    background: #ffffff;
    margin-top: 0;
}

.product-showcase {
    flex-grow: 1;
    padding: 20px 30px 20px 120px;
    transition: padding-left 0.5s;
}

.sidebar.active+.toggle+.product-showcase {
    padding-left: 280px;
}

.product-showcase h2 {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
    font-size: 40px;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card{
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

a.product-card {
    text-decoration: none; /* 移除底線 */
    color: inherit; /* 繼承父元素的文字顏色 */
}

a.product-card:visited,
a.product-card:hover,
a.product-card:active {
    text-decoration: none; /* 確保其他狀態也沒有底線 */
    color: inherit; /* 確保文字顏色不變 */
}

.product-card:hover {
    cursor: pointer;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.product-image{
    height: 180px;
    overflow: hidden;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img{
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

.product-info{
    padding: 15px;
}

.product-info h3{
    white-space: normal;
    word-break: break-all;
    font-size: 16px;
    margin-bottom: 8px;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-price{
    color: #e53953;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.add-to-cart{
    background-color: #ff6600;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-to-cart:hover{
    background-color: #e65c00;
}

footer {
    background-color: #000000;
    color: rgb(153, 147, 147);
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

/* 響應式設計與法 */
@media screen and (max-width: 768px) {

    .welcome h2 {
        font-size: 30px;
    }

    .welcome p {
        font-size: 18px;
    }

    .welcome a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .shop {
        flex-direction: column-reverse;
    }

    .shop img {
        width: 100%;
    }

    .info {
        width: 100%;
        padding: 50px 0;
    }

    .info h2 {
        font-size: 30px;
        color: #cacaca;
    }

    .info p {
        font-size: 18px;
        color: #afafaf;
    }

    .product-showcase{
        padding: 20px 15px 20px 90px;
    }

    .product-grid{
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .product-info h3{
        font-size: 14px;
        height: 50px;
    }

    .product-price{
        font-size: 16px;
    }

    .add-to-cart{
        padding: 6px 10px;
        font-size: 12px;
    }

}

/* 在寬度小於1400px的螢幕上每行顯示5個 */
@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 在寬度小於1200px的螢幕上每行顯示4個 */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 在寬度小於900px的螢幕上每行顯示3個 */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 在寬度小於600px的螢幕上每行顯示2個 */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}