/* === พื้นฐานของ body (เหมือนเดิม) === */
.product {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* === ช่องค้นหาสินค้า === */
.search-bar-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 30px 0 10px;
    padding: 0 10px;
}

.search-bar {
    display: flex;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 5px 0 0 5px;
}

.search-bar button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    background-color: #ff6600;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background-color: #e55b00;
}

/* === Container หลัก === */
.product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
}

/* === การ์ดสินค้า === */
.product-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 300px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #f0f0f0;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.product-card:hover img {
    transform: scale(1.05);
}

/* === รายละเอียดในการ์ดสินค้า === */
.product-details {
    padding: 15px 20px;
}

.product-details h3 {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.product-details p {
    font-size: 1em;
    color: #777;
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-details .btn {
    margin-top: 20px;
    background-color: #ff6600;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.product-details .btn:hover {
    background-color: #e55b00;
    transform: translateY(-3px);
}

/* === สินค้าที่เกี่ยวข้อง แบบเลื่อน === */
.related-products-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    padding-left: 10px;
}

.related-product-card {
    flex: 0 0 auto;
    width: 220px;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 10px;
    scroll-snap-align: start;
}

.related-product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
}

.related-product-card h3 {
    font-size: 1.2em;
    margin-top: 10px;
    color: #333;
}

.related-product-card .btn {
    background-color: #ff6600;
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
}

.related-product-card .btn:hover {
    background-color: #e55b00;
}

/* === Media Queries for responsiveness === */
@media (max-width: 768px) {
    .product-card {
        width: 90%;
    }

    .search-bar-wrapper {
        padding: 0 15px;
    }

    .search-bar {
        flex-direction: column;
        max-width: 100%;
        box-shadow: none;
    }

    .search-bar input[type="text"] {
        border-radius: 5px;
        border-right: 1px solid #ccc;
        margin-bottom: 10px;
    }

    .search-bar button {
        border-radius: 5px;
        width: 100%;
    }

    .product-details h3 {
        font-size: 1.2em;
    }

    .related-products-container {
        gap: 15px;
    }

    .related-product-card {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .related-product-card {
        width: 150px;
    }

    .product-details .btn {
        padding: 10px 15px;
        font-size: 1em;
    }
}