/* ====================================================================== */
/* កូដ CSS ពេញលេញ (Centering, Grid 8-Column, Image 1:1, & No Horizontal Scroll) */
/* ====================================================================== */

/* ------------------------------------------------------------------- */
/* កូដទូទៅ: ដក Scrollbar ផ្ដេកចេញពីទំព័រទាំងមូល */
/* ------------------------------------------------------------------- */
body {
    overflow-x: hidden; /* **សំខាន់**៖ លាក់ Scrollbar ផ្ដេក */
    margin: 0;
    padding: 0;
}


/* ------------------------------------------------------------------- */
/* ១. IMAGE STYLES - រូបភាពធំ (បង្ខំទំហំ 1:1) */
/* ------------------------------------------------------------------- */
.product-card .product-image-wrapper {
    width: 100%;
    padding-bottom: 100%; /* បង្ខំឱ្យ Container មាន Aspect Ratio 1:1 (ការ៉េ) */
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
    border: none;
    box-shadow: none;
    line-height: 0;
}

.product-card .product-image-wrapper img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover; /* រក្សាសមាមាត្រដើម និងបំពេញ Container ដោយមិនបង្ខូចរូបភាព */
    transform: none;
    transition: none;
    max-width: 100%;
}


/* ------------------------------------------------------------------- */
/* ២. PRODUCT CARD & GRID - 8 ជួរថេរ និង Responsive */
/* ------------------------------------------------------------------- */

/* កុងតឺន័រខាងក្រៅ៖ ដាក់ Grid ទាំងមូលចំកណ្តាល */
.tab-pane .row {
    display: flex;
    justify-content: center; /* ធានាថាធាតុខាងក្នុងស្ថិតនៅចំកណ្តាល */
    padding: 0;
    margin: 0;
}

/* Grid Container៖ កំណត់ 8 ជួរដេក និង Centering ខ្លួនវា */
.product-grid-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* កំណត់ 8 ជួរដេកសម្រាប់ Desktop ធំ */
    gap: 8px;
    padding: 5px;
    max-width: 1600px;

    /* Centering Grid ទាំងមូលនៅខាងក្នុង .row */
    margin-left: auto;
    margin-right: auto;
}

/* Media Queries សម្រាប់ Responsive Design */
@media (max-width: 1400px) {
     .product-grid-container {
       grid-template-columns: repeat(6, 1fr);
    }
}
@media (max-width: 1200px) {
    .product-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        padding: 0 5px;
    }
}

/* Product Card Base Style (Card នីមួយៗ) */
.product-card {
    background-color: #ffffff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    height: 100%;
    width: 100%;
    margin: 0;
    max-width: none;
    text-align: center; /* ដាក់អត្ថបទទាំងអស់ក្នុង Card ចំកណ្តាល */
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* ------------------------------------------------------------------- */
/* ៣. ព័ត៌មានលម្អិត (តម្រឹមចំកណ្តាល) */
/* ------------------------------------------------------------------- */

/* Category/Description */
.product_content .category a {
    font-size: 0.75em;
    line-height: 1.1;
    margin: 3px 0 2px 0;
    text-align: center;
    display: block;
}
/* Product Name */
.product-name a {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    margin: 4px 0 6px 0;
    display: block;
    text-align: center;
    min-height: 34px;
}

/* Price */
.price-original {
    font-size: 1em;
    font-weight: bold;
    margin-top: 5px;
    display: block;
    text-align: center;
}

/* តម្រឹម Action Links ឲ្យនៅចំកណ្តាល */
.action_links ul {
    display: flex;
    justify-content: center; /* ធានាការដាក់ចំកណ្តាលធាតុក្នុង ul ដោយ Flexbox */
    padding: 0;
    margin-top: 8px;
}


/* ------------------------------------------------------------------- */
/* ៤. CHAT MESSENGER POP-UP (Social Links Centering) */
/* ------------------------------------------------------------------- */

/* Button to open the chat form */
.open-chat-button {
    background-color: #0084ff;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    opacity: 0.8;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s;
}

.open-chat-button:hover {
    opacity: 1;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 3px 7px;
    border-radius: 50%;
    background-color: red;
    color: white;
    font-size: 10px;
}

/* The actual chat form pop-up */
.chat-popup {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    border: 1px solid #ccc;
    z-index: 999;
    width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
}

/* Styling for the form container */
.chat-form-container {
    padding: 0;
    max-width: 100%;
}

/* Chat Header */
.chat-header-style {
    background-color: #0084ff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chat-header-style h3 {
    margin: 0;
    font-size: 18px;
}

.btn-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Chat Body */
.chat-body-style {
    padding: 15px;
}

.chat-body-style p {
    color: #606770;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

/* Submit button */
.btn-chat-submit {
    background-color: #0084ff;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.btn-chat-submit:hover {
    opacity: 1;
}

/* Form controls */
.chat-body-style .form-control {
    width: 100%;
    padding: 10px;
    margin: 5px 0 10px 0;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.chat-body-style textarea.form-control {
    resize: none;
}

/* Social Links Centering */
.no-li-flex {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center; /* តម្រៀបធាតុនៅចំកណ្តាល (ផ្ដេក) */
    align-items: center;
}

.no-li-flex > a {
    margin: 0 15px;
    display: inline-block;
}


.facebook img, .telegram img, .whatsapp img {
    transition: transform 0.3s ease-in-out, opacity 0.3s;
    cursor: pointer;
}


.facebook:hover img, .telegram:hover img, .whatsapp:hover img {
    transform: scale(1.1);
    opacity: 0.85;
}
