/* Global Styles & Reset */
body {
    font-family: 'Poppins', sans-serif; /* A modern, clean font */
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* Light grey background */
    color: #333; /* Dark grey text */
    line-height: 1.7;
    scroll-behavior: smooth;
}

/* Import Google Font - Poppins (Add this to the very top of your style.css or in your <head> tag) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');


h1, h2, h3, h4, h5, h6 {
    color: #2c3e50; /* Darker blue-grey for headings */
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600;
}

a {
    color: #1abc9c; /* Bright teal for links */
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
}

a:hover {
    color: #16a085; /* Darker teal on hover */
    transform: translateY(-1px);
}
/* ... อื่นๆ ... */
.button {
    display: inline-block; /* ทำให้สามารถกำหนด padding/margin ได้ */
    background-color: #3498db; /* สีเริ่มต้นของปุ่ม (ฟ้า) */
    color: #fff; /* สีข้อความ */
    padding: 12px 25px; /* ขนาดปุ่มมาตรฐาน */
    border: none;
    border-radius: 25px; /* ความโค้งมน */
    font-size: 1rem; /* ขนาดฟอนต์มาตรฐาน */
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* Header - Modern & Bold */
header {
    background-color: #34495e; /* Dark blue-grey header */
    color: #fff;
    padding: 1.2rem 0;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

header h1 {
    margin: 0;
    font-size: 2.8rem;
    color: #ecf0f1; /* Light grey for logo */
    letter-spacing: 1px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

header nav ul li {
    margin: 0.6rem 1.2rem;
}

header nav ul li a {
    color: #ecf0f1;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px; /* Pill-shaped buttons */
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

header nav ul li a:hover {
    background-color: #1abc9c; /* Teal on hover */
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.5);
}

/* Main Content Area */
main {
    padding: 2.5rem 1.5rem; /* More padding */
    max-width: 1440px; /* Wider content area */
    margin: 2.5rem auto;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden; /* Clear floats */
}

section {
    margin-bottom: 3rem;
}

h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 2rem;
    color: #34495e;
    position: relative;
    padding-bottom: 0.5em;
    font-weight: 700;
}

h2::after { /* Underline effect */
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #1abc9c; /* Teal underline */
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 2px;
}

.logout-dashboard-button {
    background-color: #dc3545; /* สีแดง */
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px; /* ทำให้โค้งมนขึ้น */
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3); /* เพิ่มเงา */
}
.logout-dashboard-button:hover {
    background-color: #c82333;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(220, 53, 69, 0.5);
}


/* Hero Section - Vibrant */
.hero-section {
    background: url('../icon/bg.png') no-repeat center center/cover; 
    color: #fff; /* ตรวจสอบให้แน่ใจว่าข้อความเป็นสีขาวเพื่อตัดกับพื้นหลัง */
    text-align: center;
    padding: 100px 30px;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* คุณอาจต้องการเก็บ::before ถ้าต้องการ pattern overlay */
.hero-section::before { /* Subtle background pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="squares" width="10" height="10" patternUnits="userSpaceOnUse"><rect x="0" y="0" width="2" height="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect x="0" y="0" width="100%" height="100%" fill="url(#squares)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h2 {
    font-size: 4.5rem;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 700;
    /* ปรับค่า text-shadow ให้เข้มและฟุ้งขึ้น */
    text-shadow: 0px 0px 15px rgba(0,0,0,0.9); /* <--- แก้ไขบรรทัดนี้ */
    /* เดิม: text-shadow: 2px 2px 8px rgba(0,0,0,0.8); */
    border-bottom: none;
    padding-bottom: 0;
}

.hero-section p {
    font-size: 1.5rem;
    max-width: 900px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
    font-weight: 300;
    /* ปรับค่า text-shadow ให้เข้มและฟุ้งขึ้น */
    text-shadow: 0px 0px 8px rgba(0,0,0,0.8); /* <--- แก้ไขบรรทัดนี้ */
    /* เดิม: text-shadow: 1px 1px 4px rgba(0,0,0,0.7); */
}

.hero-buttons .button {
    font-size: 1.4rem;
    padding: 18px 35px;
    margin: 0 15px;
    border-radius: 30px; /* More rounded */
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent; /* No border by default */
}

.hero-buttons .button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hero-buttons .button:first-child { /* Primary button */
    background-color: #f39c12; /* Bright orange */
    color: #fff;
}

.hero-buttons .button:first-child:hover {
    background-color: #e67e22; /* Darker orange */
}

.hero-buttons .secondary-button {
    background-color: #ecf0f1; /* Light grey */
    color: #34495e;
}

.hero-buttons .secondary-button:hover {
    background-color: #bdc3c7;
    color: #2c3e50;
}


/* Product Grid (Cards) - Refined */
.product-grid {
    display: grid;
    /* เปลี่ยน auto-fit เป็น auto-fill เพื่อให้มีช่องว่างเมื่อจำนวนรูปไม่เต็มแถว */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 20px; /* ลด gap ลงเล็กน้อยเพื่อให้มีพื้นที่มากขึ้น */
}

.product-item {
    border: none; /* No visible border */
    padding: 15px; /* ลด padding เพื่อให้มีพื้นที่เหลือ */
    text-align: center;
    background-color: #fff;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease;
    overflow: hidden;
    position: relative;
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.product-item img {
    width: 100%; /* ให้รูปภาพกว้างเต็มพื้นที่ของ product-item */
    height: 200px; /* เพิ่มความสูงเล็กน้อย หรือปรับตามความเหมาะสม */
    object-fit: cover; /* สำคัญ: ทำให้รูปภาพเต็มพื้นที่โดยอาจมีการครอปส่วนเกินออก */
    display: block; /* ลบช่องว่างด้านล่างรูปภาพที่อาจเกิดขึ้น */
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-item h3 {
    font-size: 1.5rem; /* ปรับขนาดหัวข้อเล็กน้อย */
    margin-bottom: 10px;
    color: #34495e;
}

.product-item .file-type-display {
    font-size: 0.9em;
    color: #666;
    margin-top: -8px; /* เลื่อนขึ้นใกล้ h3 เล็กน้อย */
    margin-bottom: 10px;
    text-transform: uppercase; /* ทำให้ตัวพิมพ์ใหญ่ทั้งหมด */
    font-weight: 500;
}

/* คุณอาจจะวางมันไว้ใกล้ๆ กับ .product-item h3 หรือ .product-item p */

.product-item .category-name {
    font-style: normal; /* Remove italic */
    font-weight: 500;
    color: #1abc9c; /* Bright teal */
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-item p {
    color: #7f8c8d; /* Muted grey */
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.product-item .button {
    background-color: #3498db; /* Bright blue */
    color: #fff;
    padding: 10px 20px; /* ปรับขนาดปุ่มเล็กน้อย */
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.product-item .button:hover {
    background-color: #2980b9; /* Darker blue */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.6);
}

/* Product Detail - Adjusted colors */
.product-detail {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
}

.product-detail img {
    width: 100%;
    max-width: 600px; /* Larger max width */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.product-info h2 {
    text-align: left;
    font-size: 3rem;
    color: #34495e;
}

.product-info .price {
    font-size: 2.2rem;
    color: #27ae60; /* Emerald green for price */
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.product-info .description {
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.15rem;
}

.product-info .button {
    background-color: #27ae60; /* Emerald green */
    padding: 15px 30px;
    font-size: 1.3rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.product-info .button:hover {
    background-color: #229954;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.6);
}

/* Membership Plans Styles - Revamped */
.membership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Wider cards */
    gap: 30px;
    margin-top: 2rem;
}

.membership-item {
    border: none;
    padding: 30px;
    text-align: center;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px; /* Consistent height for cards */
    position: relative;
    overflow: hidden;
}

.membership-item::before { /* Corner accent */
    content: '';
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    background-color: #f39c12; /* Orange accent */
    transform: rotate(45deg);
    z-index: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.membership-item:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.membership-item h3 {
    font-size: 2.5rem;
    color: #34495e;
    margin-bottom: 15px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.membership-item .duration {
    font-size: 1.3rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-style: normal;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.membership-item .price {
    font-size: 4rem; /* Even larger price */
    font-weight: 700;
    color: #e74c3c; /* Red for price */
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.membership-item .price::before {
    content: "฿";
    font-size: 0.6em;
    vertical-align: super;
}

.membership-item .description {
    font-size: 1.05rem;
    color: #555;
    min-height: 90px;
    line-height: 1.7;
    margin-bottom: 30px;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.membership-item .button {
    margin-top: auto;
    background-color: #1abc9c; /* Bright teal */
    color: #fff; /* เพิ่มบรรทัดนี้! */
    padding: 16px 35px;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.membership-item .button:hover {
    background-color: #16a085;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 188, 156, 0.6);
}

/* Forms (Register/Login/Forgot/Reset) - Wider & Modern */
/* Forms (Register/Login/Forgot/Reset) - Wider & Modern */
.register-section {
    /* max-width: 650px; */ /* <--- คอมเมนต์หรือลบบรรทัดนี้ออกไป เพื่อให้มันกว้างขึ้น */
    margin: 30px auto;
    padding: 40px 15px; /* <--- ปรับ padding ด้านข้างให้เล็กลง หรือเป็น 0 ตามต้องการ */
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* เพิ่มกฎสำหรับ dashboard-specific register-section ถ้าต้องการให้หน้า dashboard กว้างเป็นพิเศษ */
.register-section.dashboard-page { /* <--- เพิ่ม class นี้ใน HTML ด้วย */
    max-width: unset; /* ทำให้ไม่จำกัดความกว้าง */
    padding: 40px; /* หรือ 40px 0; ถ้าต้องการให้เต็มขอบเลย */
}

.register-section h2 {
    text-align: center;
    color: #34495e;
    margin-bottom: 35px;
    font-size: 2.8rem;
    position: relative;
    padding-bottom: 10px;
}

.register-section h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: #3498db; /* Blue underline */
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 1.5px;
}

.register-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #34495e;
    font-size: 1.1rem;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form input[type="number"],
.register-form textarea,
.register-form select {
    width: calc(100% - 28px); /* Adjust padding */
    padding: 14px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.register-form input[type="text"]:focus,
.register-form input[type="email"]:focus,
.register-form input[type="password"]:focus,
.register-form input[type="number"]:focus,
.register-form textarea:focus,
.register-form select:focus {
    border-color: #3498db; /* Blue focus */
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.register-form .selected-plan-info {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-top: -15px;
    margin-bottom: 30px;
    font-size: 1.05rem;
    font-weight: 500;
}

.register-form .button {
    width: 100%;
    padding: 16px;
    background-color: #3498db; /* Bright blue */
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.register-form .button:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.6);
}

.note {
    text-align: center;
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 25px;
}

.note a {
    color: #3498db; /* Blue link */
}

.required {
    color: #e74c3c; /* Red for required */
    margin-left: 5px;
}

.error {
    color: #e74c3c;
    background-color: #fce4e4; /* Lighter red background */
    border: 1px solid #fcc;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.1);
}

.success {
    color: #27ae60;
    background-color: #e8f9e8; /* Lighter green background */
    border: 1px solid #d4edda;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.1);
}

/* Footer - Darker & Clean */
footer {
    text-align: center;
    padding: 2rem 0;
    background-color: #34495e; /* Dark blue-grey footer */
    color: #ecf0f1;
    margin-top: 40px;
    font-size: 1rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
}

/* Admin Panel Styles (reusing existing with new color palette) */
.admin-sidebar {
    background-color: #34495e; /* Dark blue-grey */
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}
.admin-sidebar h2 {
    color: #ecf0f1;
    border-bottom-color: #7f8c8d;
}
.admin-sidebar ul li a {
    color: #bdc3c7;
}
.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background-color: #1abc9c; /* Teal */
    color: #fff;
}
.admin-table th {
    background-color: #ecf0f1;
    color: #34495e;
}
.admin-table tr:hover {
    background-color: #e0e4e7;
}
.action-buttons .edit-button {
    background-color: #3498db; /* Blue */
}
.action-buttons .edit-button:hover {
    background-color: #2980b9;
}
.action-buttons .delete-button {
    background-color: #e74c3c; /* Red */
}
.action-buttons .delete-button:hover {
    background-color: #c0392b;
}
.admin-form-section .button {
    background-color: #1abc9c; /* Teal for admin forms */
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
}
.admin-form-section .button:hover {
    background-color: #16a085;
    box-shadow: 0 8px 25px rgba(26, 188, 156, 0.6);
}
.admin-table .date-display {
    color: #3498db; /* Blue for dates */
}

/* Media Queries for Product Grid (5 columns on large screens) */
@media (min-width: 1200px) { /* สำหรับหน้าจอขนาด 1200px ขึ้นไป */
    .product-grid {
        grid-template-columns: repeat(5, 1fr); /* กำหนด 5 คอลัมน์เท่าๆ กัน */
        gap: 20px;
    }
}

@media (max-width: 1199px) and (min-width: 992px) { /* หน้าจอขนาดกลาง */
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 คอลัมน์ */
    }
}

@media (max-width: 991px) and (min-width: 768px) { /* หน้าจอแท็บเล็ต */
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 คอลัมน์ */
    }
}

@media (max-width: 767px) { /* หน้าจอมือถือ */
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ */
    }
}
/* ในไฟล์ css/style.css ของคุณ */

/* ... โค้ด Global Styles, Header, Main, Section, H2, Hero Section, Hero Buttons เดิม ... */


/* Filter Controls (ปรับแต่งให้ทันสมัยขึ้น) */
.filter-controls {
    margin-bottom: 30px; /* เพิ่ม margin */
    display: flex;
    gap: 20px; /* เพิ่มระยะห่างระหว่าง input/select */
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center; /* จัดกลาง */
    background-color: #f9f9f9; /* พื้นหลังเล็กน้อย */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.filter-controls > div {
    flex-grow: 1;
    min-width: 250px; /* ให้ความกว้างขั้นต่ำที่เหมาะสม */
    max-width: 400px; /* จำกัดความกว้างสูงสุด */
}
.filter-controls label {
    display: block;
    margin-bottom: 8px; /* เพิ่มระยะห่างกับ input */
    font-weight: 600;
    color: #34495e;
    font-size: 1.05rem;
}
.filter-controls input[type="text"],
.filter-controls select {
    width: 100%;
    padding: 12px; /* เพิ่ม padding */
    border: 1px solid #c2c9d6; /* สีขอบเข้มขึ้นเล็กน้อย */
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff; /* พื้นหลังสีขาว */
}
.filter-controls input[type="text"]:focus,
.filter-controls select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}


/* Product Grid (Cards) - Refined */
.product-grid {
    display: grid;
    /* เปลี่ยน auto-fit เป็น auto-fill เพื่อให้มีช่องว่างเมื่อจำนวนรูปไม่เต็มแถว */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 20px; /* ลด gap ลงเล็กน้อยเพื่อให้มีพื้นที่มากขึ้น */
}

.product-item {
    border: none; /* No visible border */
    padding: 15px; /* ลด padding เพื่อให้มีพื้นที่เหลือ */
    text-align: center;
    background-color: #fff;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease;
    overflow: hidden;
    position: relative;
    display: flex; /* เพื่อจัดเนื้อหาภายใน card */
    flex-direction: column;
    justify-content: space-between; /* กระจายเนื้อหา */
    min-height: 380px; /* กำหนดความสูงขั้นต่ำเพื่อความสม่ำเสมอ */
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.product-item img {
    max-width: 100%;
    height: 180px; /* ลดความสูงของรูปภาพลงเล็กน้อย */
    object-fit: contain; /* <--- ตรงนี้แหละครับ ที่ทำให้รูปถูกครอป */
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-item h3 {
    font-size: 1.5rem;
    margin-bottom: 8px; /* ลด margin-bottom */
    color: #34495e;
    flex-grow: 0; /* ไม่ให้ h3 ยืด */
}

.product-item .category-name {
    font-style: normal;
    font-weight: 500;
    color: #1abc9c;
    font-size: 0.9rem; /* ปรับขนาดเล็กกว่าเดิม */
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-item p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 0.95rem; /* ปรับขนาดเล็กกว่าเดิม */
    flex-grow: 1; /* ให้ p ยืดตัวเพื่อผลักปุ่มลงไป */
}

.product-item .button {
    background-color: #3498db;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
    margin-top: auto; /* ทำให้ปุ่มอยู่ล่างสุด */
}

.product-item .button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.6);
}

/* ปุ่มสมัครสมาชิกเพื่อดาวน์โหลด */
.product-item .button-orange {
    background-color: #f39c12; /* สีส้ม */
    color: #fff;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}
.product-item .button-orange:hover {
    background-color: #e67e22;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.6);
}


/* Lightbox Styles (Popup รูปภาพ) */
.lightbox {
    display: none; /* ซ่อนไว้ก่อน, JavaScript จะเปลี่ยนเป็น 'flex' เมื่อเปิด */
    position: fixed; /* อยู่เหนือทุกอย่าง */
    z-index: 2000; /* สูงกว่า z-index อื่นๆ */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9); /* พื้นหลังทึบแสง */
    align-items: center; /* จัดกลางในแนวตั้ง */
    justify-content: center; /* จัดกลางในแนวนอน */
    overflow: auto; /* เปิด scroll ถ้าภาพใหญ่เกิน */
    -webkit-backdrop-filter: blur(5px); /* เพิ่มเบลอพื้นหลัง (สำหรับ Chrome/Safari) */
    backdrop-filter: blur(5px); /* เพิ่มเบลอพื้นหลัง (สำหรับ Firefox) */
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s ease-out; /* เพิ่ม animation */
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-button {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5); /* เพิ่มเงาให้ปุ่มปิด */
}

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

/* สไตล์สำหรับปุ่ม "กลับสู่ Dashboard" */
.button.button-secondary-dark {
    background-color: #6c757d; /* สีเทา */
    color: #fff;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.button.button-secondary-dark:hover {
    background-color: #5a6268;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}


/* ... โค้ด Forms, Footer, Admin Panel, Media Queries อื่นๆ เดิม ... */


/* Media Queries for Product Grid (5 columns on large screens) */
@media (min-width: 1200px) { /* สำหรับหน้าจอขนาด 1200px ขึ้นไป */
    .product-grid {
        grid-template-columns: repeat(5, 1fr); /* กำหนด 5 คอลัมน์เท่าๆ กัน */
        gap: 20px;
    }
}

@media (max-width: 1199px) and (min-width: 992px) { /* หน้าจอขนาดกลาง */
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 คอลัมน์ */
    }
}

@media (max-width: 991px) and (min-width: 768px) { /* หน้าจอแท็บเล็ต */
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 คอลัมน์ */
    }
}

@media (max-width: 767px) { /* หน้าจอมือถือ */
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ */
    }
}

/* เพิ่ม responsive สำหรับ filter-controls */
@media (max-width: 600px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-controls > div {
        max-width: 100%;
        min-width: unset;
    }
}