/* Basic styles for the website */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1em 0;
    text-align: center;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* 允許換行 */
}

header nav ul li {
    margin: 0 10px; /* 調整間距 */
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap; /* 防止文字換行 */
}

main {
    padding: 20px;
}

.hero {
    background-color: #007bff;
    color: #fff;
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.about-us, .contact-info, .service-advantages {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center; /* 置中內容 */
}

.about-us h2, .contact-info h2, .service-advantages h2, .container h1 {
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
    margin-top: 20px;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

/* Product List Styles */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    justify-items: center; /* 置中網格項目 */
}

.product-item {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.product-item img {
    max-width: 100%;
    height: auto; /* 保持圖片比例 */
    object-fit: cover; /* 圖片裁切以填充 */
    border-radius: 4px;
    margin-bottom: 15px;
}

.product-item h2 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.product-item p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

.product-item button {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.product-item button:hover {
    background-color: #218838;
}

/* Form Styles */
form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 20px auto; /* 置中表單 */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

form button[type="submit"] {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

form button[type="submit"]:hover {
    background-color: #0056b3;
}

.message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Cart Table Styles */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th,
.cart-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.cart-table th {
    background-color: #f2f2f2;
}

.cart-table img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

.cart-total {
    text-align: right;
    font-size: 1.2em;
    margin-top: 20px;
}

.cart-total h3 {
    margin: 0;
    color: #007bff;
}

.button {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #0056b3;
}

/* Feature Section Styles */
.feature-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    justify-items: center; /* 置中網格項目 */
}

.feature-item {
    text-align: center;
}

.feature-item img {
    width: 150px; /* 固定寬度 */
    height: 150px; /* 固定高度 */
    object-fit: contain; /* 確保圖片完整顯示 */
    margin-bottom: 15px;
}

.feature-item h3 {
    color: #007bff;
    margin-top: 0;
}

/* Image Modal Styles */
.image-modal {
    display: none; /* 預設隱藏 */
    position: fixed; /* 固定定位 */
    z-index: 1000; /* 確保在最上層 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 允許滾動 */
    background-color: rgba(0,0,0,0.8); /* 半透明黑色背景 */
    justify-content: center;
    align-items: center;
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}