:root {
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --primary-color: #ff1616;
    --white-color: #ffffff;
}

* {
    margin: 0%;
    padding: 0%;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
    list-style: none;
    color: #000;
    object-fit: cover;
    text-decoration: none;
    outline: none;
}

body {
    min-height: 100vh;
    background-color: #fefefe;
    width: 100%;
    position: relative;
}
label{
    color: #474747;
    display: block;
    margin-bottom: 5px;
}
input,select{
    border: 1px solid #cacaca;
    border-radius: 4px;
    display: block;
    padding: 10px;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
}
.full {
    width: 100%;
}

.form-control{
    margin: 2rem 0;
    text-align: left;
}
.form-control.success input{
    border-color: var(--success-color);
}
.form-control.error input{
    border-color: var(--error-color);
}
.form-control small {
    color: var(--error-color);
    position: absolute;
    visibility: hidden;
}

.login-main {
    width: 100%;
    height: 100vh;
    display: grid;
    place-items: center;
}

.login-main img {
    width: 15rem;
}

.login-box {
    width: 25rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: #fff;
    border-radius: .5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}





.btn-primary {
    background-color: var(--primary-color);

    border: none;
    border: 2px solid var(--primary-color);
    padding: .75rem;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.25rem;
}

.btn-secondary {
    border: 2px solid var(--primary-color);
    padding: .75rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.25rem;
    background-color: transparent;
}

header {
    display: flex;
    top: 0;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    border: none;
}

nav {
    width: fit-content;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
}

.nav-links li {
    display: flex;
    align-items: center;
    margin: 0 .5rem;
    position: relative;
    /* สำหรับ dropdown */
}

.nav-links a {
    color: #fff;
    font-weight: 500;
    font-size: 20px;
    text-decoration: none;
}

.nav-links i {
    color: #fff;
    background-color: #fff;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1000;
}

.hamburger .line {
    width: 30px;
    height: 4px;
    background-color: var(--white-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn-out {
    padding: .2rem .5rem;
    background-color: var(--white-color);
    color: var(--primary-color);
    font-weight: 500;
    border: none;
    border-radius: 0.25rem;
    font-size: 20px;
    cursor: pointer;
}

/* ===== DROPDOWN LANGUAGE SWITCHER ===== */
.lang-switch {
    position: relative;
}

.btn-lang {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* ซ่อนเมนูเริ่มต้น */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
    z-index: 1000;
}

/* โชว์เมนูเมื่อมี .open */
.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: #f2f2f2;
}




.welcome-main {
    max-width: 100%;
    margin: 1rem auto;
    text-align: center;
    /* margin-top: 1rem; */
}

.img-index {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.img-index img {
    width: auto;
    height: auto;
    max-width: 60%; /* ไม่ให้กว้างเกิน 90% ของหน้าจอ */
    max-height: 30vh; /* ไม่ให้สูงเกิน 60% ของหน้าจอ */
    object-fit: contain;
}

.index-main {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2%;
    padding: 3rem 5rem 1rem 5rem;
}

.index-item {
    padding: 2rem;
    border-radius: 0.5rem;
}

.index-item:nth-child(1) {
    background-color: #ACECAF;
}

.index-item:nth-child(2) {
    background-color: #FFF7B0;
}

.index-item:nth-child(3) {
    background-color: #FFCA99;
}

.index-item:nth-child(4) {
    background-color: #F99;
}

.index-item:nth-child(5) {
    background-color: #F99;
}

.index-item:nth-child(6) {
    background-color: #ACECAF;
}

.itempop:nth-child(1) {
    background-color: #ACECAF;
}

.itempop:nth-child(2) {
    background-color: #FFF7B0;
}

.itempop:nth-child(3) {
    background-color: #FFCA99;
}

.itempop:nth-child(4) {
    background-color: #F99;
}

.item-img {
    width: 100%;
}

.form-container {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 5rem 1rem 1rem 1rem;
    border-radius: 0.5rem;
}

.grid-2{
    max-width: 90rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    gap: 1rem;
    border-radius: 0.5rem;
}

.img-example {
    width: 100%;
    margin-top: 1rem;
    border-radius: 0.25rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.top {
    margin-top: 10rem;
}

.box {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    margin: 3rem auto;

}

.admin {
    width: fit-content;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
}

.span-4 {
    grid-column: span 4;
}

.btn-cam {
    background-color: var(--primary-color);
    border: none;
    padding: .7rem;
    color: #ffffff;
    border-radius: 0.5rem;
    align-items: center;
    text-align: center;

}

.btn-cam i {
    color: #ffffff;
}

.barsearch {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    /* position: relative; */
    width: 600px;
    font-family: sans-serif;
    margin: 3rem auto ;
    
}


.barsearch input {
    width: 100%;
    padding: 1rem 6rem;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    align-items: center;
    margin: 0 auto;
    text-align: center;
}

.barsearch label {
    position: absolute;
    left: 16px;
    top: 15px;
    color: #888;
    font-size: 20px;
    pointer-events: none;
    transition: 0.2s ease all;
    background: #fff;
    /* กันไม่ให้ตัวอักษรทับเส้น */
    padding: 0 0;
}

/* เมื่อ focus หรือมีค่าพิมพ์อยู่ */
.barsearch input:focus+label,
.barsearch input:not(:placeholder-shown)+label {
    top: -8px;
    left: 8px;
    font-size: 12px;
    color: #ff6a13;
    /* สี CI ของคุณ */
}


/* ================== table warehoue =================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
}

.pretty-table {
    width: 100%;
    border-spacing: 0;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.pretty-table th,
.pretty-table td {
    padding: 6px 4px;
    font-size: 1rem;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #504d4d;
     border-bottom: 1px solid#504d4d;
}

.pretty-table th {
    background: #ff1616;
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.pretty-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.pretty-table tbody tr:hover {
    background: #ffeaea;
    transition: background 0.2s;
}

.col-product {
    width: 250px;
    min-width: 160px;
    max-width: 300px;
}

.col-brand {
    width: 150px;
    min-width: 120px;
    max-width: 250px;
}

.col-packing {
    width: 250px;
    min-width: 90px;
    max-width: 160px;
}

.total-cbm,
.cbm,
.weight,
.total-select-weight,
.total-select-cbm,.est-weight,
.est-cbm{
    width: 50px;
    min-width: 40px;
    max-width: 90px;
}

.available,
.qty-select {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.total-weight {
    width: 120px;
    min-width: 60px;
    max-width: 90px;
}

.select-qty {
    margin: 0 auto;
}

.table-container {
    padding: 5rem 2rem;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 1rem 1rem;
    border-radius: 0.5rem;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;

    .tot {
        font-size: 35px;
    }
}

.totals {
    display: grid;
    grid-template-columns: 1;
    gap: .3rem;
    align-items: center;
    font-weight: 500;
    font-size: 1rem;
}

.consize {

    font-size: 25px;

    /* margin: 0 1rem; */
    .halfcon {
        background-color: #ACECAF;
        margin: 1rem 0;
        border-radius: 0.4rem;
        padding: .2rem .7rem;
        border: none;
        font-weight: 500;
    }

    .fullcon {
        background-color: #FFCA99;
        margin: 1rem 1rem;
        border-radius: 0.4rem;
        padding: .2rem .7rem;
        border: none;
        font-weight: 500;
    }
}

.consize .select-plan {
    width: fit-content;
    display: grid;
    margin-top: 12rem;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    margin: 5rem auto;
}

.box-plan {
    width: fit-content;
    background-color: white;
    padding: 2rem 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.product-detail-link {
    font-size: 14px;
    color: #ff1616;
    text-decoration: underline dotted;
    cursor: pointer;
    opacity: 0.75;
    margin-left: 12px;
    transition: color 0.15s, opacity 0.15s;
    flex-shrink: 0;
}

.product-detail-link:hover {
    color: #d80000;
    opacity: 1;
    text-decoration: underline;
}


/* ----prod--- */
/* -------prod------- */
.prodContainer {
    margin: 3rem auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
    justify-items: center;
    align-items: center;
    max-width: 1500px;
}

.prod {
    margin: 0 auto;
    text-align: center;
    padding: 1rem .5rem;
    border-radius: 5%;
    border: solid 2px var(--primary-color);

    img {
        width: 50%;
    }
}

/* ----plan table----*/







.popupwh {
    display: none;

    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.popup-content-wh-header {
    background-color: #ffffff; /* พื้นหลังขาว */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.warehouse-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 ปุ่มต่อแถว */
    gap: 20px;
}
/* hover */
.itempop {
    width: 100%;
}

/* คุมขนาดปุ่มจริง ๆ ที่ <a> */
.itempop a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;              /* 🔥 ความสูงเท่ากัน */
    width: 100%;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #000;
    transition: 0.2s ease;
}

/* hover */
.itempop a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}




/* CSS สำหรับกล้อง Popup */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    text-align: center;
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Webkit */
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Firefox */
    -o-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Opera */
}

.con {
    width: 100%;
    height: 560px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #000;
    -webkit-border-radius: 8px;
    /* Webkit */
    -moz-border-radius: 8px;
    /* Firefox */
    -o-border-radius: 8px;
    /* Opera */
}


/* ปุ่มปิด */
.close-btn {
    background-color: #ff4b5c;
    /* สีปุ่มปิด */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    float: right;
    /* เรียงชิดขวา */
}

.close-btn:hover {
    background-color: #e04350;
    /* สีเมื่อเลื่อนเมาส์ */
}


/* -----info----- */
.popup-overlay-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    padding: 20px 0;
    backdrop-filter: blur(4px);
}

.popup-content-info-wh {
    background: #fff;
    width: 95vw;
    max-width: 1400px; /* เพิ่ม max-width ให้ใหญ่ขึ้น */
    border-radius: 16px;
    position: relative;
    margin: 30px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-close-info {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #ff1616;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s;
    font-size: 2.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 22, 22, 0.1);
}

.popup-close-info:hover {
    background: #ff1616;
    color: white;
    transform: rotate(90deg);
}

.form-container-info {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
}

/* ปรับ grid ให้รูปใหญ่ขึ้น */
.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr; /* เพิ่มสัดส่วนคอลัมน์รูปให้ใหญ่ขึ้น */
    gap: 40px; /* เพิ่มระยะห่าง */
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-container-info {
        padding: 20px;
    }
}

/* ปรับปรุงส่วนรูปภาพให้ใหญ่ขึ้น */
.add-img {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 16px;
    border: 2px dashed #ff1616;
    position: relative;
    min-height: 400px; /* เพิ่มความสูงขั้นต่ำ */
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.add-img label {
    background: #ff1616;
    color: white;
    padding: 10px 20px; /* เพิ่มขนาด padding */
    border-radius: 25px;
    font-size: 16px; /* เพิ่มขนาดตัวอักษร */
    font-weight: 600;
    display: inline-block;
    width: auto;
    margin-bottom: 20px;
    align-self: flex-start;
    box-shadow: 0 4px 10px rgba(255, 22, 22, 0.3);
}

/* ทำให้รูปภาพใหญ่ขึ้น */
.img-example {
    width: 100%;
    height: 350px; /* กำหนดความสูงคงที่ */
    object-fit: contain; /* ปรับให้รูปแสดงเต็มโดยไม่บิดเบือน */
    border-radius: 12px;
    border: 2px solid #fff;
    display: block;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 10px; /* เพิ่มพื้นที่ว่างรอบรูป */
}

.img-example:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(255, 22, 22, 0.25);
    border-color: #ff1616;
}

/* ถ้าต้องการให้รูปใหญ่ขึ้นอีกเมื่อ hover */
.img-example.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10000;
    max-width: 90vw;
    max-height: 90vh;
    cursor: zoom-out;
}

.all-input {
    padding: 5px;
}

.all-input > label {
    font-size: 20px; /* เพิ่มขนาดตัวอักษร */
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid #ff1616;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* เพิ่มระยะห่าง */
    margin-bottom: 25px;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.span-4 {
    grid-column: span 4;
}



.full {
    width: 100%;
    box-sizing: border-box;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px; /* เพิ่มขนาดตัวอักษร */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select {
    width: 100%;
    padding: 14px 18px; /* เพิ่มขนาด padding */
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px; /* เพิ่มขนาดตัวอักษร */
    box-sizing: border-box;
    transition: all 0.3s;
    background: #fff;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
select:hover {
    border-color: #ff1616;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #ff1616;
    box-shadow: 0 0 0 4px rgba(255, 22, 22, 0.15);
}

input[readonly] {
    background: #f8f9fa;
    border-color: #ddd;
    color: #666;
    cursor: not-allowed;
}

input[readonly]:hover {
    border-color: #ddd;
}

/* ปุ่มแก้ไขและบันทึก */
.edit-info {
    display: flex;
    gap: 20px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}
/* สำหรับโหมดแก้ไข */
.all-input input:not([readonly]) {
    background: #fff;
    border-color: #ff1616;
    box-shadow: 0 0 0 4px rgba(255, 22, 22, 0.1);
}

/* ---plan--- */
.del-plan {
    display: flex;
    position: absolute;
    margin-top: .5rem;
    right: 1rem;
}

.plan-con {
    max-width: 1200px;
    margin: 5rem auto;
    

}

.plan-detail-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem auto;

    max-width: 100%;
}

.select-plan-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    background: #fff;
    min-width: 15rem;
    margin: 2rem auto;
    position: relative;

    .text-select-plan {
        text-align: center;

    }
}

.delete-icon {
    display: none;
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    font-weight: lighter;
    font-size: 70px;
    cursor: pointer;
    z-index: 10;
}

.addplan {
    display: grid;
    justify-content: center;
    margin: 3.3rem auto;
    background-color: var(--primary-color);
    min-width: 15rem;
    max-width: 20rem;
    padding: 2rem 0;
    border-radius: 1rem;

    i {
        font-size: 40px;
        font-weight: 600;
        color: var(--white-color);
        width: fit-content;
        display: grid;
        margin: auto auto;
        justify-content: center;
    }

    h3 {
        color: var(--white-color);
        font-size: 25px;
    }
}

.plan-name {
    display: none;
    /* grid-template-columns: 1fr 1fr; */
    gap: 1.5rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: var(--white-color);
    min-width: 15rem;
    max-width: 23rem;
    padding: 2rem 0.5rem;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: fit-content;
    margin: 3rem auto;

}

#planForm {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    /* ปรับตามต้องการ */
}

.plan-btn {
    display: grid;
    width: fit-content;
    grid-template-columns: repeat(2, 1fr);

}

.plan-btn button {
    padding: .7rem 3rem;
}

.planname-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* ----estim----- */


/* ----plan-select--- */
.warehouse-selector {
    display: flex;
    gap: 2rem;
}

.sum-btn {
    display: flex;
    max-width: 10rem;
    margin: 2rem auto;

    padding: .5rem 2rem;

    .btn-primary {
        max-width: 10rem;

    }
}

/* popup.css */
.popup-overlay-ex-plan {
    display: none;

    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;


}

.popup-content-ex-plan {
    background: #fff;

    padding: 2rem 1rem;
    border-radius: 8px;
    width: fit-content;
    overflow: auto;
    position: relative;
    text-align: center;

    .btn-ex {
        margin: 2rem;
        text-decoration: none;
    }
}

.popup-close-plan {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ---ex-btn--- */
.btn-secondary-pdf {
    border: 2px solid var(--primary-color);
    padding: .75rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.25rem;
    background-color: transparent;

    .bi-filetype-pdf {
        color: var(--primary-color);
        text-decoration: none;
    }
}

.btn-secondary-excel {
    border: 2px solid #217346;
    padding: .75rem;
    color: #217346;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.25rem;
    background-color: transparent;

    .bi-file-earmark-excel {
        color: #217346;
        text-decoration: none;
    }
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
/* Mobile First Approach */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 300px){
   .grid-2 {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
}
@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .span-4 {
        grid-column: span 1;
    }
    
    /* ปรับขนาดฟอนต์สำหรับมือถือ */
    input, select {
        font-size: 16px; /* ป้องกัน zoom บน iOS */
        padding: 12px 8px;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 16px;
    }
    
    /* ปรับขนาดปุ่มสำหรับมือถือ */
    .btn-cam, button {
        min-height: 44px; /* สำหรับการกดด้วยนิ้ว */
    }
    .img-index img {
        max-width: 80%;
        max-height: 40vh;
    }
}
@media (max-width: 575.98px) {
    /* General adjustments */
    body {
        font-size: 14px;
    }
    
    /* Login page */
    .login-box {
        width: 90%;
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    .login-main img {
        width: 10rem;
    }
    
 
    /* Index grid */
    .index-main {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .index-item {
        padding: 1rem;
    }
    
    /* Form layouts */
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-4{
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Search bar */
    .barsearch {
        width: 90%;
        margin: 2rem auto;
    }
    
    .barsearch input {
        padding: 1rem 1rem;
        font-size: 14px;
    }
    
    /* Tables */
    .table-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .top-bar .tot {
        font-size: 24px;
    }
    
    /* Container sizes */
    .consize {
        font-size: 18px;
    }
    
    .consize .halfcon,
    .consize .fullcon {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    /* Product containers */
    .prodContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 2rem 1rem;
    }
    
    .prod {
        padding: 0.5rem;
    }
    
    /* Plan detail boxes */
    .plan-detail-box {
        grid-template-columns: repeat(2, 1fr);
        margin: 1rem;
    }
    
    .select-plan-name {
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .addplan {
        padding: 1.5rem 0;
        margin: 2rem auto;
    }
    
    /* Warehouse selector */
    .warehouse-selector {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Popups */
    .popup-content-info-wh,
    .popup-content-wh-index,
    .popup-content-ex-plan {
        width: 90%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .warehouse-container {
        grid-template-columns: 2fr;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .con {
        height: 300px;
    }
    
    /* Form controls */
    .form-control {
        margin: 1rem 0;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-cam {
        padding: 0.6rem;
        font-size: 14px;
    }
}

/* Small devices (tablets, 576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Login */
    .login-box {
        width: 80%;
        padding: 2.5rem 1.5rem;
    }
    
    /* Navigation */

    
    
    /* Index grid */
    .index-main {
        grid-template-columns: repeat(3, 1fr);
        padding: 2rem;
        gap: 1.5rem;
    }
    
    /* Form layouts */
    .grid-2 {
        grid-template-columns: 1fr;
        max-width: 90%;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Tables */
    .table-container {
        padding: 2rem 1rem;
    }
    
    /* Product containers */
    .prodContainer {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        margin: 2rem;
    }
    
    /* Plan detail boxes */
    .plan-detail-box {
        grid-template-columns: repeat(2, 1fr);
        margin: 1rem;
    }
    
    /* Search bar */
    .barsearch {
        width: 80%;
    }
}

/* Medium devices (tablets, 768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    

    /* Index grid */
    .index-main {
        grid-template-columns: repeat(3, 1fr);
        padding: 2rem 3rem;
    }
    
    /* Form layouts */
    .grid-2 {
        grid-template-columns: 1fr;
        max-width: 95%;
    }
    
    /* Tables */
    .table-container {
        padding: 3rem 2rem;
    }
    
    /* Product containers */
    .prodContainer {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        margin: 2rem auto;
        padding: 0 2rem;
    }
    
    /* Plan detail boxes */
    .plan-detail-box {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Search bar */
    .barsearch {
        width: 70%;
    }
}

/* Large devices (desktops, 992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Index grid */
    .index-main {
        grid-template-columns: repeat(4, 1fr);
        padding: 3rem 4rem;
    }
    
    /* Form layouts */
    .grid-2 {
        grid-template-columns: 1.5fr 1fr;
    }
    
    /* Product containers */
    .prodContainer {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
    
    /* Plan detail boxes */
    .plan-detail-box {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Your existing desktop styles already handle this */
}

/* ==================== ADDITIONAL RESPONSIVE UTILITIES ==================== */

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
.pretty-table {
    font-size: 0.9rem;
}

@media (max-width: 767.98px) {
    .pretty-table th,
    .pretty-table td {
        padding: 4px 2px;
        font-size: 0.85rem;
    }
    
    .col-product,
    .col-brand,
    .col-packing,
    .total-cbm,
    .cbm,
    .weight,
    .total-select-weight,
    .total-select-cbm,
    .est-weight,
    .est-cbm,
    .available,
    .qty-select,
    .total-weight {
        min-width: auto;
        width: auto;
    }
}

/* Responsive form controls */
.form-control input,
.form-control select {
    width: 100%;
}

/* Responsive modal */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive container */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    .img-index img {
        max-width: 85%;
        max-height: 50vh;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Responsive text */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
}

/* Responsive buttons */
.btn-primary,
.btn-secondary,
.btn-cam {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .btn-primary,
    .btn-secondary,
    .btn-cam {
        white-space: normal;
        text-align: center;
    }
    /* Navigation */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 0px;
        left: 0;
        background-color: var(--primary-color);
        /* margin: 0 auto; */

        text-align: center;
        padding: 2rem 0;
        z-index: 999;
        align-items: center;

    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 1rem auto;
    }
    .hamburger {
        display: flex;
        z-index: 999;
    }
    /* --plan-- */
     .plan-detail-box {
        margin-top: 5rem;
        grid-template-columns: 1fr; /* เปลี่ยนเป็น 1 คอลัมน์บนมือถือ */
        gap: 1rem;
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .select-plan-name {
        min-width: auto; /* ลบ min-width ที่ตายตัว */
        width: 100%;
        padding: 1.5rem;
        margin: 0.5rem auto;
    }
    /* Hamburger Animation */
    .hamburger.active .line1 {
        transform: rotate(-45deg) translate(-6.8px, 6.8px);
        background-color: var(--white-color);
    }

    .hamburger.active .line2 {
        opacity: 0;
    }

    .hamburger.active .line3 {
        transform: rotate(45deg) translate(-6.8px, -6.8px);
        background-color: var(--white-color);
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .span-4 {
        grid-column: span 2;
    }
    
    .form-container {
        padding: 5rem 0.5rem 1rem 0.5rem;
    }
    
    .grid-2 {
        padding: 0.75rem;
        gap: 0.75rem;
    }
}

/* Responsive grid utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    padding: 0 15px;
}

/* Hide/Show elements based on screen size */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767.98px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Touch-friendly elements on mobile */
@media (max-width: 767.98px) {
    .nav-links a,
    .btn-primary,
    .btn-secondary,
    .btn-cam,
    .btn-out,
    .btn-lang {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    input,
    select {
        min-height: 44px;
    }
}

/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Smooth transitions for responsive changes */
* {
    transition: all 0.3s ease;
}

/* Responsive font sizes */
@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    .tot { font-size: 1.8rem; }
}

/* Responsive spacing */
@media (max-width: 767.98px) {
    .mt-mobile-2 { margin-top: 2rem; }
    .mb-mobile-2 { margin-bottom: 2rem; }
    .p-mobile-2 { padding: 2rem; }
}
/* เพิ่มสไตล์สำหรับ handheld devices */
@media (hover: none) and (pointer: coarse) {
    /* สำหรับอุปกรณ์ที่ใช้สัมผัส */
    input, select, button {
        min-height: 44px; /* ขนาดที่เหมาะสมสำหรับการสัมผัส */
    }
    
    /* ปรับระยะห่างสำหรับนิ้ว */
    .grid-4 {
        gap: 1rem;
    }
    
    /* ปุ่มที่ใหญ่ขึ้นสำหรับมือถือ */
    .btn-cam, .btn-primary {
        font-size: 16px;
        padding: 12px;
    }
}

/* ปรับปรุงการแสดงผลในแนวตั้งของมือถือ */
@media (orientation: portrait) {
    .img-example {
        max-height: 300px;
        object-fit: contain;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ปรับปรุงการแสดงผลในแนวนอนของมือถือ/แท็บเล็ต */
@media (orientation: landscape) and (max-height: 600px) {
    .form-container {
        padding-top: 3rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

/* ตัวเลือกที่เห็นชัดเจนบนมือถือ */
select {
    background-color: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ปรับปรุงการแสดงผลไฟล์อัปโหลด */
input[type="file"] {
    padding: 8px;
    background-color: #f8f9fa;
    border: 2px dashed #ced4da;
}

input[type="file"]:focus {
    border-color: #007bff;
    outline: none;
}

/* การ์ดสำหรับข้อมูลบนมือถือ */
.mobile-card {
    display: none;
}

@media (max-width: 768px) {
    .mobile-card {
        display: block;
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
        border-left: 4px solid #007bff;
    }
    
    .mobile-card h3 {
        margin-top: 0;
        color: #007bff;
        font-size: 1.1rem;
    }
}