/* ========================================= */
/* นำเข้าฟอนต์ของตัวเอง */
/* ========================================= */
@font-face {
    font-family: 'MyCustomFont'; /* ตั้งชื่อฟอนต์นี้ว่าอะไรก็ได้ ในที่นี้ตั้งว่า MyCustomFont */
    src: url('fonts/PawRebel-Regular.ttf') format('truetype'); /* เปลี่ยนชื่อไฟล์ตรงนี้ให้ตรงกับของคุณเป๊ะๆ */
    font-weight: normal;
    font-style: normal;
}
* {
  box-sizing: border-box;
  max-width: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
    font-family: 'MyCustomFont', Arial, sans-serif;
    
    /* 👇 ลบ background-color สีพื้นออก แล้วใส่ 4 บรรทัดนี้แทน 👇 */
    background-image: url('images/wallpaper.jpg'); 
    background-size: cover; /* ปรับรูปให้ขยายเต็มหน้าจอ */
    background-position: center top; /* จัดให้อยู่กึ่งกลาง */
    background-attachment: fixed; /* ทำให้พื้นหลังอยู่กับที่เวลาใช้นิ้วเลื่อนจอ */
    
    color: #1e4028;
    padding: 10px;
    padding-bottom: 80px; 
}
h1, h3 {
    font-family: 'MyCustomFont', sans-serif;
}
h1 {
    text-align: center;
    color: #ffffff; /* เปลี่ยนชื่อเว็บเป็นสีขาว */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8); /* เพิ่มเงาสีดำให้ตัวหนังสือลอยเด่นขึ้นมา */
}

/* ========================================= */
/* 2. ส่วนของหน้าแรก (index.html) */
/* ========================================= */

.cart-icon {
  position: fixed;
  top: 10px;
  right: 10px;
  font-size: 14px;
  background-color: #fce268;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #1e4028;
  cursor: pointer;
  z-index: 100;
}

.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* คำสั่งนี้คือหัวใจหลัก: แบ่งพื้นที่เป็น 2 ช่องเท่าๆ กัน */
    gap: 15px; /* ระยะห่างระหว่างกล่องสินค้าซ้าย-ขวา */
    padding: 10px;
    width: 100%;
    margin: 0 auto;
}

/* เพิ่มให้แน่ใจว่ากล่องสินค้าขยายเต็มช่องของตัวเอง */
.product {
    background: #ffffff;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(30, 64, 40, 0.1);
    width: 100%; 
}

.product a {
  text-decoration: none;
  color: inherit;
}

.product img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block; 
  transition: transform 0.3s ease;
}

.product img:hover {
  transform: scale(1.05);
}

.product h3 {
  font-size: 14px;
  margin: 10px 0 5px;
}

.price {
  font-size: 14px;
  color: #1e4028;
  font-weight: bold;
}

.video-box {
  padding: 10px;
}

.video {
  width: 100%;
  height: auto;
  border-radius: 15px;
}

/* ========================================= */
/* 3. ส่วนของหน้ารายละเอียดสินค้า (product.html) */
/* ========================================= */

.product-container {
  max-width: 500px; 
  margin: 20px auto;
  padding: 20px;
  background-color: #ffffff; /* ใส่กล่องสีขาวครอบรายละเอียด */
  border-radius: 20px;
  border: 1px solid rgba(30, 64, 40, 0.1);
}

.main-image {
  width: 100%;
  border-radius: 15px;
  display: block;
}

.thumbnail-gallery {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.thumbnail-gallery img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #1e4028;
  transition: 0.2s;
}

.thumbnail-gallery img:hover {
  opacity: 0.7;
}

.product-info-section {
  text-align: left; /* จัดข้อความชิดซ้ายให้อ่านง่าย */
}

.product-title {
  font-size: 24px;
  margin-bottom: 5px;
  margin-top: 15px;
  text-align: left;
}

.product-price {
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
}

.tax-note {
  font-size: 12px;
  opacity: 0.8;
}

/* ปุ่ม Size */
.size-selector { margin-top: 20px; }
.size-selector p { display: flex; justify-content: space-between; margin-bottom: 5px; }
.size-chart-link { text-decoration: underline; cursor: pointer; font-size: 14px; }
.size-buttons { display: flex; gap: 10px; }

.btn-size {
  flex: 1;
  padding: 10px;
  background-color: transparent;
  border: 1px solid #1e4028;
  color: #1e4028;
  border-radius: 8px;
  font-family: 'Mali', sans-serif;
  cursor: pointer;
}

.btn-size.active {
  background-color: #f7e49a;
  font-weight: bold;
}

/* จำนวน และปุ่มซื้อ */
.purchase-actions { margin-top: 20px; }
.quantity-selector { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; /* แยกคำว่า Quantity กับปุ่มกดให้อยู่คนละฝั่ง */
  margin-bottom: 15px;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid #1e4028;
  border-radius: 20px;
  padding: 2px 10px;
}

.qty-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #1e4028;
}

#qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: 'Mali', sans-serif;
  font-size: 16px;
  color: #1e4028;
}

.btn-buy {
  width: 100%;
  padding: 15px;
  background-color: #fce268;
  border: 1px solid #1e4028;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 600;
  color: #1e4028;
  font-family: 'Mali', sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 0 #1e4028;
  transition: 0.1s;
}

.btn-buy:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #1e4028;
}

/* Accordion */
.product-accordion { margin-top: 30px; border-top: 1px solid rgba(30, 64, 40, 0.2); }
.accordion-item p {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  margin: 0;
  border-bottom: 1px solid rgba(30, 64, 40, 0.2);
  cursor: pointer;
}

/* ========================================= */
/* 4. Responsive สำหรับมือถือจอเล็กมากๆ */
/* ========================================= */
@media (max-width: 400px) {
  .product-title { font-size: 20px; }
  .btn-buy { font-size: 16px; }
}
/* ========================================= */
/* 5. หน้าตะกร้าสินค้า (cart.html) */
/* ========================================= */
.cart-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(30, 64, 40, 0.1);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 15px;
}

.item-details { flex: 1; text-align: left; }
.item-details h4 { margin: 0; font-size: 16px; }
.item-details p { margin: 3px 0; font-size: 14px; opacity: 0.8; }

.item-remove {
    color: #ff4d4d;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    padding: 5px;
}

.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #fcf4db;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background-color: #1e4028; /* สีเขียวเข้มให้ดูทางการขึ้น */
    color: #fce268;
    border: none;
    border-radius: 25px;
    font-family: 'Mali', sans-serif;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.back-link {
    display: block;
    margin-top: 15px;
    color: #1e4028;
    text-decoration: none;
    font-size: 14px;
}

body {
    padding-bottom: 120px; 
}

/* ========================================= */
/* 6. แถบเมนูด้านล่าง (Bottom Navigation) */
/* ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fcf4db; /* สีพื้นหลังเหลืองอ่อนเดียวกับเว็บ */
    border-top: 1px solid rgba(30, 64, 40, 0.15);
    display: flex;
    flex-direction: column; /* สั่งให้แบ่งเป็น 2 ชั้น (บน-ล่าง) */
    z-index: 1000;
    padding: 10px 0 15px 0; /* เพิ่มพื้นที่ด้านล่างเล็กน้อยให้กดยากขึ้น */
}

/* ชั้นที่ 1: เมนูหลัก */
.main-menus {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 45px;
}

/* ชั้นที่ 2: ปุ่มโซเชียล */
.social-menus {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding-top: 10px;
}

/* ตกแต่งปุ่มโซเชียลให้เล็กลงและเข้ากับเมนู */
.social-menus .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: #1e4028; /* สีเขียวเข้มเข้ากับธีม */
    color: #ffffff; /* ไอคอนสีขาว */
    border-radius: 50%;
    text-decoration: none;
    transition: 0.2s;
}

/* เอฟเฟกต์ตอนกดปุ่มโซเชียล */
.social-menus .social-link:hover.yt { background-color: #ff0000; transform: scale(1.1); }
.social-menus .social-link:hover.ig { background-color: #e1306c; transform: scale(1.1); }
.social-menus .social-link:hover.tk { background-color: #000000; transform: scale(1.1); }
.social-menus .social-link:hover.fb { background-color: #1877f2; transform: scale(1.1); }

/* ตกแต่งอื่นๆ สำหรับเมนูหลัก */
.nav-item {
    color: #1e4028;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: 0.2s;
}

.nav-item:hover {
    background-color: rgba(30, 64, 40, 0.05);
}

.nav-cart-wrapper {
    display: flex;
    align-items: center;
}

#cart-count {
    margin-left: 5px;
    font-size: 16px;
    font-weight: bold;
}