/* --- 1. ตั้งค่าพื้นฐานและการเลื่อนหน้าจอ --- */
:root {
    --primary-blue: #007bff;
    --dark-footer: #1a1a1a;
    --gray-light: #f8f9fa;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    background: linear-gradient(135deg, #d6eaff 0%, #f1f7ff 100%);
    background-attachment: fixed; /* ทำให้พื้นหลังอยู่กับที่เวลาเลื่อนหน้าจอ */
    color: #333;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- 2. ส่วนหัวและโลโก้ --- */
.logo {
    display: flex;        /* จัดให้รูปเรียงกันในแนวนอน */
    align-items: center;  /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    gap: 10px;           /* กำหนดระยะห่างระหว่างโลโก้ */
}

.logo img {
    height: 50px;         /* ปรับความสูงตามต้องการ */
    width: auto;
    position: relative;   /* เปลี่ยนเพื่อให้รูปเรียงต่อกันได้ */
}

.logo:hover { opacity: 0.8; }

/* Hero Slider */
.banner-slide {
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 30px 30px;
}

/* สไตล์เพิ่มเติมสำหรับเมนูสมาชิกกลุ่ม */
.nav-link.border-primary:hover {
    background-color: var(--primary-blue);
    color: white !important;
    transition: var(--transition);
}

/* จัดการระยะขอบเวลาเลื่อน (Scroll Margin) */
.scroll-margin {
    scroll-margin-top: 100px;
}

/* --- 3. ส่วนค้นหา --- */
.search-container {
    max-width: 450px;
    background: white;
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: var(--transition);
}

.search-container:focus-within {
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.15) !important;
    border-color: var(--primary-blue);
}

/* --- 4. การ์ดสินค้า --- */
.product-card {
    transition: var(--transition);
    border: 2px solid var(--primary-blue) !important;
    border-radius: 25px;
    overflow: visible; 
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

.best-seller-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.4);
}

.img-wrapper {
    position: relative;
    background: #f8f9fa;
    border-radius: 20px;
    overflow: hidden;
    
    /* เพิ่มส่วนนี้เพื่อบังคับเป็นจัตุรัส */
    width: 100%; 
    min-height: 250px;
    /* จัดรูปให้อยู่ตรงกลาง */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* เพิ่มพื้นที่ว่างรอบรูปสินค้าเล็กน้อย */
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* เปลี่ยนจาก cover เป็น contain เพื่อให้เห็นรูปครบทั้งใบ ไม่โดนตัดขอบ */
    transition: transform 0.5s ease;
}

/* --- สไตล์ปุ่ม Wishlist --- */
.btn-wishlist {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-wishlist:hover {
    transform: scale(1.1);
    background-color: #fff0f0 !important;
}

.btn-wishlist i {
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

/* ทำให้การ์ดสินค้าไม่เลื่อนเวลาคลิกหัวใจ */
.product-card {
    position: relative;
    overflow: visible;
}

/* --- การ์ดทริป --- */
.tip-card {
    transition: transform 0.3s ease;
    cursor: pointer;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important; /* เพิ่มบรรทัดนี้เพื่อลบเงาออกในตอนแรก */
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.bg-info-subtle {
    background-color: transparent !important;
}

/* --- ลูกศรบนการ์ดสินค้าหน้าแรก --- */
.card-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    z-index: 5;
}

.product-card:hover .card-arrows {
    opacity: 1;
}

.arrow-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: 0.2s;
}

.arrow-btn:hover { background: #fff; transform: scale(1.1); }
.arrow-btn i { font-size: 10px; color: #333; }

/* --- 5. สไตล์หน้า Product Detail (ลูกศรเด้งออกนอกรูปตามสั่ง) --- */
.detail-img-side {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    min-height: 400px;
    position: relative;
    overflow: visible; /* เปิดเพื่อให้ลูกศรลอยออกนอกขอบได้ */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white !important;
    border: 1px solid #ddd !important;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.carousel-btn:hover { background: var(--primary-blue) !important; color: white !important; }

/* ดันลูกศรออกไปนอกขอบรูปภาพตามที่คุณวงเหลืองไว้ */
.btn-prev { left: -22px !important; }
.btn-next { right: -22px !important; }

.dot-container { display: flex; gap: 10px; margin-top: 20px; }
.dot { width: 14px; height: 14px; border: 2px solid #333; border-radius: 50%; cursor: pointer; }
.dot.active { background: #333; }

/* --- 8. ปรับ Footer ให้แบนราบที่สุด (Extra Small) --- */
.footer-professional {
    padding: 8px 0 !important; /* บีบ Padding บน-ล่างให้แบนที่สุด */
    min-height: 0 !important;
}

.footer-professional h5,
.footer-professional .logo {
    font-size: 0.95rem !important;
    margin-bottom: 4px !important; /* บีบระยะบรรทัดให้ชิดกัน */
}

/* เพิ่มเพื่อคุมขนาดรูปภาพโลโก้ใน footer */
.footer-professional .logo img {
    height: 35px !important; /* ปรับตัวเลขความสูงตามความชอบ */
    width: auto !important;
    display: inline-block;
}

.footer-professional p, 
.footer-professional .social-btn, 
.footer-professional .contact-box {
    font-size: 0.75rem !important;
    margin-bottom: 2px !important; /* ลดช่องว่างเนื้อหา */
}

.contact-box { 
    padding: 5px 12px !important; /* บีบกล่องเบอร์โทรให้แบนราบ */
    margin-top: 0 !important;
}

.footer-professional hr {
    margin: 6px 0 !important; /* เส้นคั่นให้ชิดที่สุด */
    opacity: 0.05;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-blue {
    0% { transform: scale(1) translate(-50%, -50%); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { transform: scale(1.1) translate(-50%, -50%); box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { transform: scale(1) translate(-50%, -50%); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}
