   
    :root {
      --primary-color: #FF6B6B;
      --primary-hover: #ff5252;
      --secondary-color: #FFD93D;
      --success-color: #28a745;
      --bg-color: #F0F2F5;
      --text-color: #333;
      --border-radius: 12px;
    }

    body {
      background-color: var(--bg-color);
      font-family: 'Sarabun', sans-serif;
      color: var(--text-color);
      padding-bottom: 100px;
    }

    .container {
      max-width: 700px;
      padding-top: 20px;
    }

    .page-header {
      text-align: center;
      margin-bottom: 20px;
      position: relative;
    }

    .status-btn-group {
      margin-top: 15px;
    }

    /* [EDITED] ปรับปรุง Card ให้แสดงเส้นขอบสีได้ถูกต้อง */
    .card {
      border: 1px solid rgba(0,0,0,.125); /* เปิดเส้นขอบพื้นฐาน */
      border-radius: var(--border-radius);
      margin-bottom: 20px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
      background-color: #ffffff;
      overflow: hidden; /* เพื่อให้ Header ไม่ล้นมุมโค้ง */
    }

    /* [EDITED] ปรับ Header ให้ยืดหยุ่นเรื่องสี (ใช้สีจาก Class HTML แทน) */
    .card-header {
      background-color: #fff;
      border-bottom: 1px solid #f1f1f1;
      font-weight: 700;
      /* color: var(--primary-color); <--- ลบออกเพื่อให้ใช้ text-danger/text-info ได้ */
      padding: 15px 20px;
    }

    .card-body {
      padding: 20px;
    }

    .form-control {
      border-radius: 8px;
      height: 48px;
      background-color: #fff;
      border: 1px solid #ced4da;
      font-size: 1rem;
    }

    .form-control:focus {
      box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
      border-color: var(--primary-color);
    }

    label {
      font-weight: 600;
      font-size: 0.9rem;
      margin-bottom: 6px;
      color: #555;
    }

    .btn {
      border-radius: 8px;
      font-weight: 600;
      padding: 12px 20px;
      letter-spacing: 0.3px;
    }

    .btn-primary {
      background-color: var(--primary-color);
      border: none;
      box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
    }

    .btn-success {
      background-color: var(--success-color);
      border: none;
      box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    }

    .order-item {
      background-color: #fff;
      border: 1px solid #e0e0e0;
      border-left: 5px solid var(--success-color);
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 15px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .tier-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      padding: 10px;
      background-color: #f8f9fa;
      border-radius: 8px;
      border: 1px dashed #ddd;
    }

    .tier-item {
      font-size: 0.85rem;
      padding: 4px 10px;
      border-radius: 20px;
      background-color: #fff;
      border: 1px solid #ddd;
      color: #666;
      display: inline-flex;
      align-items: center;
    }

    .tier-item.active {
      background-color: #e8f5e9;
      color: #155724;
      border-color: #c3e6cb;
      font-weight: 700;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    /* [UPDATED V26.7] ปรับปุ่มเลือกประเภทลูกค้า (แนวนอน + กะทัดรัด) */
    .cust-type-btn {
      padding: 10px 15px; /* ลด Padding บนล่าง */
      border: 2px solid #eee;
      border-radius: 50px; /* ทรงแคปซูลมน */
      background: white;
      width: 48%;
      text-align: left; /* จัดชิดซ้าย */
      transition: all 0.2s;
      cursor: pointer;
      display: flex; /* ใช้ Flexbox จัดแนวนอน */
      align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
      justify-content: flex-start; /* เริ่มจากซ้าย */
    }

    .cust-type-btn:hover,
    .cust-type-btn.active {
      border-color: var(--primary-color);
      background-color: #fff5f5;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
      transform: translateY(-2px);
    }

    .cust-type-btn i {
      font-size: 1.5rem; /* ลดขนาดไอคอนลงเล็กน้อย */
      margin-right: 10px; /* เว้นระยะห่างขวา */
      margin-bottom: 0; /* ตัด Margin ล่างออก */
      color: var(--primary-color);
      width: 30px; /* ฟิกซ์ความกว้างไอคอนให้เท่ากัน */
      text-align: center;
    }
    
    .cust-type-btn div {
      line-height: 1.2; /* ระยะห่างบรรทัดข้อความ */
    }

    .nav-pills .nav-link.active {
      background-color: var(--primary-color);
    }

    .nav-pills .nav-link {
      color: #555;
    }

    .dash-card {
      border-radius: 12px;
      padding: 15px;
      color: white;
      margin-bottom: 10px;
    }

    .bg-gradient-info {
      background: linear-gradient(45deg, #17a2b8, #138496);
    }

    .bg-gradient-success {
      background: linear-gradient(45deg, #28a745, #218838);
    }

    .bg-gradient-warning {
      background: linear-gradient(45deg, #ffc107, #fd7e14);
    }

    .receipt-box {
      background: #fff;
      padding: 25px;
      border-radius: 15px;
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }

    .badge-custom {
      font-size: 0.85rem;
      padding: 8px 15px;
      border-radius: 20px;
    }

    .pac-container {
      z-index: 10005 !important;
      border-radius: 0 0 10px 10px;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
      margin-top: 5px;
    }

    /* Address Card Style */
    .address-card {
      border: 1px solid #eee;
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 10px;
      background: #fff;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }

    .address-card:active {
      transform: scale(0.98);
      background-color: #f8f9fa;
    }

    .address-card.selected {
      border: 2px solid var(--primary-color);
      background-color: #fff5f5;
    }

    .address-card .icon-box {
      width: 40px;
      height: 40px;
      background: #f0f2f5;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #555;
      font-size: 1.2rem;
      margin-right: 15px;
    }

    .address-icon-selected {
      background: var(--primary-color) !important;
      color: white !important;
    }

    /* Map Modal Styles */
    .map-full-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: white;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      visibility: hidden;
      opacity: 0;
      transition: opacity 0.3s;
    }

    .map-full-modal.active {
      visibility: visible;
      opacity: 1;
    }

    .map-header-bar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        padding: 15px;
        /* พื้นหลังไล่เฉดเพื่อให้เห็นปุ่มชัดขึ้น */
        background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 60%, rgba(255,255,255,0) 100%);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .search-box-float {
        flex-grow: 1; /* ขยายเต็มพื้นที่ */
        background: white;
        border-radius: 25px; /* มนมากขึ้น */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        padding: 8px 15px;
        display: flex;
        align-items: center;
        height: 45px;
    }

    .btn-close-map {
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #555;
        font-size: 1.2rem;
        cursor: pointer;
        border: none;
        flex-shrink: 0; /* ห้ามหด */
    }

    .btn-close-map:active {
        background-color: #f1f1f1;
        transform: scale(0.95);
    }

    .map-canvas-container {
      flex-grow: 1;
      position: relative;
      background: #eee;
    }

    .center-pin {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -100%);
      z-index: 5;
      pointer-events: none;
      color: #dc3545;
      font-size: 3rem;
      filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
      transition: transform 0.1s;
    }

    .center-pin.lifting {
      transform: translate(-50%, -120%) scale(1.1);
    }

    .pin-shadow {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 10px;
      height: 5px;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 50%;
      z-index: 4;
    }

    /* [UPDATED V26.12] ปุ่ม GPS ปรับตำแหน่งใหม่ (ขวาล่างของแผนที่) */
    .btn-gps-float {
      position: absolute !important;
      top: auto !important;       /* ยกเลิกการกำหนดระยะจากด้านบน */
      bottom: 20px !important;    /* ให้ลอยอยู่เหนือขอบล่างของแผนที่ 20px */
      right: 20px !important;     /* ชิดขวา 20px */
      width: 50px;
      height: 50px;
      background: white;
      border-radius: 50%;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      color: #007bff;
      z-index: 100;               /* มั่นใจว่าอยู่ชั้นบนสุด */
      border: none;
      cursor: pointer;
    }

    .btn-gps-float:active {
      background: #f0f0f0;
      transform: scale(0.95);
    }

    .map-footer-bar {
      background: white;
      padding: 20px 20px 30px 20px;
      box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
      border-radius: 20px 20px 0 0;
      z-index: 10;
      position: relative;
    }
    
    /* Accordion Menu Styles */
    .menu-slot-card {
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 10px;
        background: #fff;
        overflow: hidden;
    }

    .menu-slot-header {
        padding: 12px 15px;
        background: #f8f9fa;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
    }

    .menu-slot-header.completed {
        background: #e8f5e9;
        color: #28a745;
        border-left: 4px solid #28a745;
    }

    .menu-slot-header.active {
        background: #e3f2fd;
        color: #007bff;
        border-left: 4px solid #007bff;
    }

    .menu-selection-area {
        display: none;
        max-height: 400px;
        overflow-y: auto;
        background: #fff;
        border-top: 1px solid #eee;
    }

    .menu-cat-header {
        background: #eee;
        color: #555;
        padding: 5px 15px;
        font-size: 0.85rem;
        font-weight: bold;
        position: sticky;
        top: 0;
    }

    .menu-choice-item {
        padding: 10px 15px;
        border-bottom: 1px solid #f1f1f1;
        cursor: pointer;
        font-size: 0.95rem;
        display: flex;
        justify-content: space-between;
    }

    .menu-choice-item:hover {
        background-color: #f0f8ff;
    }

    .menu-choice-item.disabled {
        color: #ccc;
        pointer-events: none;
        background: #f9f9f9;
    }

    .btn-back-top {
        border-radius: 20px;
        font-weight: bold;
        background-color: #6c757d;
        color: white;
        margin-top: 10px;
    }

/* [UPDATED Layout V6] Styles สำหรับการ์ดเลือกชุดอาหาร (ปรับสีราคาให้อ่านง่ายบนพื้นขาว) */

    
    /* [UPDATED] สไตล์เมื่อการ์ดถูกเลือก (ขยายเต็มแถว) */
    .set-card.active {
        grid-column: 1 / -1; /* สั่งให้กินพื้นที่ตั้งแต่คอลัมน์แรกยันสุดท้าย (เต็มแถว) */
        border-color: #28a745;
        background-color: #fff;
        box-shadow: 0 8px 20px rgba(40, 167, 69, 0.2);
        transform: translateY(-2px);
        transition: all 0.3s ease; /* เพิ่ม Effect การขยายให้ลื่นไหล */
        z-index: 5; /* ยกระดับขึ้นมาให้ลอยเด่นกว่าใบอื่น */
    }
    
    .set-card.active::after {
        content: '\f00c';
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        position: absolute;
        top: 10px;
        right: 10px;
        background: #28a745;
        color: white;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        z-index: 10;
        border: 2px solid #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    /* [FIXED V27.8] Grid แสดงเต็มความกว้าง Container */
    .set-card-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
        margin-bottom: 20px;
        margin-top: 10px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* [UPDATED V27.14] Set Grid Card Style - เพิ่ม Cursor Pointer และ Position Relative */
    .set-card {
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        transition: transform 0.2s;
        /* [สำคัญ] ทำให้การ์ดสูงเต็มพื้นที่และจัด Layout แนวตั้ง */
        height: 100%; 
        display: flex;
        flex-direction: column;
        cursor: pointer;    /* [NEW] เปลี่ยนเมาส์เป็นรูปนิ้วมือเมื่อชี้ */
        position: relative; /* [NEW] รองรับการวาง Badge */
    }

    /* Effect ตอนเอาเมาส์ชี้ */
    .set-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        border-color: var(--primary-color);
    }

    .set-card-img-wrapper {
        width: 100%;
        aspect-ratio: 1 / 1; /* ปรับเป็นแนวนอนนิดนึงให้ภาพดูไม่ใหญ่เกินไป หรือใช้ 1/1 เหมือนเดิมก็ได้ */
        background-color: #f8f9fa;
        position: relative;
        overflow: hidden;
        border-bottom: 1px solid #f1f1f1;
    }
    
    .set-card-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* ส่วนเนื้อหา ยืดหยุ่นเพื่อดันปุ่มไปล่างสุด */
    .set-card-body {
        padding: 15px;
        text-align: center;
        flex-grow: 1; /* [สำคัญ] สั่งให้ส่วนนี้ขยายเต็มพื้นที่ว่าง */
        display: flex;
        flex-direction: column;
    }
    
    .set-card-title {
        font-weight: bold;
        font-size: 1.2rem; 
        color: #333;
        margin-bottom: 5px;
    }
    
    .set-card-price {
        color: #d35400;
    }

    /* ส่วนรายละเอียด (แสดงตลอดเวลา) */
    .set-card-details {
        display: block !important; /* บังคับแสดงเสมอ */
        padding-top: 10px;
        margin-top: auto; /* ดันตัวเองลงด้านล่าง */
        border-top: 1px dashed #eee;
        background-color: #fff; /* พื้นหลังขาวกลืนไปเลย */
        width: 100%;
    }

    .set-price-row {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;            /* ระยะห่าง */
        margin-bottom: 10px;
        font-size: 1.1rem;    /* ขนาดตัวหนังสือ */
        font-weight: bold;    /* ตัวหนาเพื่อให้เห็นชัด */
    }

    .set-min-qty {
        color: #c0392b; 
    }

    .price-separator {
        color: #999;
        font-weight: normal;
    }

    .set-tier-table {
        margin: 10px 0;
        font-size: 0.9rem;
        width: 100%;
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 10px;
    }

    .set-tier-row {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #e9ecef;
    }
    .set-tier-row:last-child {
        border-bottom: none;
    }

    /* ปรับปุ่มกดให้เด่น */
    .btn-buy-now {
        background-color: #28a745;
        color: white;
        border: none;
        width: 100%;
        padding: 10px;
        border-radius: 50px; /* ปุ่มมน */
        font-weight: bold;
        font-size: 1rem;
        margin-top: 10px;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
    }
    .btn-buy-now:hover {
        background-color: #218838;
        transform: scale(1.02);
    }

    /* [FIXED V27.8] Grid 2 คอลัมน์บนจอใหญ่ */
    @media (min-width: 768px) {
        .set-card-grid {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }
    
    /* [FIXED V27.9] บังคับความกว้างทุก Level */
    #selectionArea {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #selectionArea > .col-12 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    #setGridContainer {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #setGridContainer > .category-tabs {
        width: 100% !important;
        grid-column: 1 / -1 !important;
    }
    
    #setGridContainer > .set-card-grid {
        width: 100% !important;
        max-width: 100% !important;
        grid-column: 1 / -1 !important;
    }
    
    #setGridContainer > .set-list-container {
        width: 100% !important;
        grid-column: 1 / -1 !important;
    }


    /* [แก้ไข] ปรับความสูงของส่วนประกอบใน Input Group ให้เท่ากับ Input (48px) */
    .input-group-text, 
    .input-group .btn {
        height: 48px; /* บังคับความสูงให้เท่ากัน */
        display: flex;
        align-items: center; /* จัดไอคอนให้อยู่กึ่งกลางแนวตั้ง */
        border-color: #ced4da; /* ปรับสีขอบให้เท่ากับ Input เพื่อความเนียน */
    }

    /* ปรับปุ่มถังขยะให้สีขอบกลมกลืนตอนยังไม่กด */
    .input-group .btn-outline-secondary {
        border-color: #ced4da;
    }

    /* [NEW V26.11] ปรับหน้าแผนที่ให้เป็น Popup บนจอคอมพิวเตอร์ (PC/Tablet) */
    @media (min-width: 768px) {
        .map-full-modal {
            width: 600px !important;       /* จำลองความกว้างมือถือ */
            height: 95% !important;        /* ไม่เต็มจอ */
            top: 50% !important;           /* กึ่งกลางแนวตั้ง */
            left: 50% !important;          /* กึ่งกลางแนวนอน */
            transform: translate(-50%, -50%) !important; /* จัด Center */
            border-radius: 20px !important; /* มุมโค้งมน */
            overflow: hidden;              /* ตัดขอบส่วนเกิน */
            border: 1px solid #ddd;
            /* เงาชั้นแรกคือเงากล่อง, เงาชั้นสองคือฉากหลังสีดำจางๆ ทั่วจอ */
            box-shadow: 0 20px 50px rgba(0,0,0,0.3), 0 0 0 100vmax rgba(0,0,0,0.5) !important;
        }

        /* ปรับปุ่มปิดให้ขยับเข้ามานิดนึง ไม่ชิดขอบโค้งเกินไป */
        .map-header-bar {
            border-radius: 20px 20px 0 0; /* โค้งตามกรอบบน */
            padding: 15px 20px;
        }
        
        .map-footer-bar {
            border-radius: 0 0 20px 20px; /* โค้งตามกรอบล่าง */
        }
    }

    /* [NEW V26.22] บังคับซ่อนเนื้อหา Locked Content ไว้ก่อนเสมอ */
    #lockedContent {
        display: none; /* ซ่อนโดย Default */
    }

    /* [FIX] ซ่อนตัวปรับเลข (Spinners) ในช่อง Input Number เพื่อให้เห็นตัวเลขเต็มๆ */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield; /* สำหรับ Firefox */
}

/* [FIX] แก้ไขแถบเลื่อนแนวนอน (Horizontal Scrollbar) ใน Popup */
.builder-selection-area {
    overflow-x: hidden !important; /* บังคับปิดแกนแนวนอน */
    overflow-y: auto; /* แกนตั้งให้เลื่อนได้ปกติ */
}

/* ปรับระยะห่างรายการเมนูไม่ให้เบียดขอบจนเกิด Scrollbar */
.builder-choice-item {
    margin-right: 0 !important;
    padding-right: 15px !important;
}

/* [NEW] สไตล์สำหรับตะกร้าแบบกระชับ (Compact Cart V2) */
.order-item-compact {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* ส่วนหัว: ชื่อชุดและราคา */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}
.compact-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}
.compact-price {
    font-size: 1rem;
    font-weight: bold;
    color: #28a745; /* สีเขียว */
}

/* ส่วนกลาง: รายการเมนูแบบบรรทัดเดียว */
.compact-details {
    font-size: 0.85rem;
    color: #6c757d; /* สีเทา */
    margin-bottom: 10px;
    line-height: 1.4;
    padding-left: 2px;
}

/* ส่วนล่าง: ปุ่มปรับจำนวนแบบ Custom Size */
.compact-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

/* [FIXED] สไตล์ปุ่มปรับจำนวนในตะกร้า (บังคับขนาดและตำแหน่งให้ชัดเจน) */
.qty-group-compact {
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    width: 120px; /* กำหนดความกว้างตายตัว */
    height: 32px;
    overflow: hidden; /* ป้องกันปุ่มล้น */
}

.btn-compact {
    width: 32px !important;
    height: 32px !important;
    background-color: #f8f9fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
}
.btn-compact:hover {
    background-color: #e2e6ea;
}
.btn-compact:focus {
    outline: none;
}

.input-compact {
    flex-grow: 1;
    width: 100%; /* ให้ยืดเต็มพื้นที่ที่เหลือตรงกลาง */
    height: 32px;
    border: none;
    border-left: 1px solid #ced4da;
    border-right: 1px solid #ced4da;
    background-color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #333;
    padding: 0;
    -moz-appearance: textfield;
}
/* ซ่อน Spinner ของ Input Number */
.input-compact::-webkit-inner-spin-button, 
.input-compact::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

/* [NEW] สไตล์สำหรับเมนูที่ถูกล็อค (เพราะจำนวนไม่ถึงขั้นต่ำ) */
.builder-choice-item.disabled {
    opacity: 0.5 !important;       /* ทำให้จางลง 50% */
    pointer-events: none !important; /* [สำคัญ] ปิดการคลิกโดยสมบูรณ์ */
    background-color: #f8f9fa !important; /* เปลี่ยนพื้นหลังเป็นสีเทาอ่อน */
    cursor: not-allowed !important;
}

.builder-choice-item.disabled .text-danger {
    color: #dc3545 !important; /* ให้ข้อความแจ้งเตือนยังคงเป็นสีแดงชัดเจน */
    opacity: 1 !important;
}

/* [NEW] จำกัดความกว้างของหน้าต่างเลือกชุดอาหาร (Set Builder) ในจอคอมฯ ให้ดูกะทัดรัด */
@media (min-width: 992px) {
    #setBuilderModal .modal-dialog {
        max-width: 500px !important; /* จำกัดความกว้างไว้ที่ 500px */
        margin: 1.75rem auto;
    }
}


    /* ==========================================
   [UPDATED V27.1 - 2024-12-19 17:32]
   CSS สำหรับแถบแสดงส่วนลดค่าส่ง (แบบเรียบง่าย)
   ========================================== */

/* Container หลัก */
#deliverySavingsInfo {
    margin-top: 5px;
    margin-left: 10px;
    padding: 0;
}

/* แถบแสดงข้อมูลส่วนลด (แบบข้อความธรรมดา) */
.savings-badge {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    padding: 2px 0;
    background: transparent;
    border: none;
}

/* ไอคอนและตัวหนา */
.savings-badge i {
    margin-right: 3px;
}

.savings-badge strong {
    color: #333;
}

/* สีเขียวสำหรับส่วนลด/ส่งฟรี */
.savings-badge .text-success {
    color: #28a745 !important;
}

/* ==========================================
   [NEW V27.2 - 2024-12-19 18:38]
   CSS สำหรับ Category Tabs, Grid, List, Badge
   ========================================== */

/* --- Category Tabs (FIXED - กินพื้นที่เต็มแถวใน Grid) --- */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    
    /* [FIX] บังคับให้กินพื้นที่เต็มแถวใน Grid */
    grid-column: 1 / -1;
    width: 100%;
}

/* --- Set List Container (FIXED - กินพื้นที่เต็มแถวใน Grid) --- */
.set-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    
    /* [FIX] บังคับให้กินพื้นที่เต็มแถวใน Grid */
    grid-column: 1 / -1;
    width: 100%;
}

.category-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


@media (min-width: 768px) {
    .set-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Set Grid Card --- */

.set-grid-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.set-grid-card .card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f5f5f5;
}

.set-grid-card .card-body {
    padding: 12px;
}

.set-grid-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.set-grid-card .card-desc {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.set-grid-card .card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Empty State --- */
.set-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.set-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==========================================
   [FIXED V27.3 - 2024-12-19 19:50]
   CSS สำหรับ Category Tabs, List Card, Badge
   (ไม่แก้ไข Grid เดิม)
   ========================================== */

.category-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* [UPDATED V27.13] Set List Card Style - Badge หน้าชื่อเมนู (Clean Look) */
    .set-list-card {
        background: #fff;
        border-radius: 12px;
        border: 1px solid #e0e0e0;
        padding: 12px;
        display: flex;
        align-items: stretch;
        gap: 15px;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-bottom: 15px;
        position: relative;
        overflow: hidden;
    }

    .set-list-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        border-color: var(--primary-color);
    }

    /* --- ส่วนรูปภาพ (ซ้าย) - ล้างค่า Badge เดิมออก --- */
    .set-list-img-wrapper {
        position: relative; 
        width: 120px;      
        height: 120px;
        flex-shrink: 0;    
        border-radius: 8px;
        overflow: hidden;
        background: #f5f5f5;
        /* ไม่ต้องมี CSS ของ .tag-badge ในนี้แล้ว */
    }

    .set-list-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* --- ส่วนเนื้อหา (ขวา) --- */
    .set-list-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-width: 0;
    }

    /* [UPDATED] Header Row: จัด Badge + ชื่อ + ราคา ให้อยู่แนวเดียวกัน */
    .set-list-header-row {
        display: flex;
        flex-wrap: wrap;       
        align-items: center;    /* จัดกึ่งกลางแนวตั้ง เพื่อให้ Badge กับตัวหนังสือสวยงาม */
        justify-content: flex-start; 
        margin-bottom: 4px;
        gap: 6px;               /* ระยะห่างระหว่างองค์ประกอบ */
    }

    /* [NEW] สไตล์ของ Badge เมื่ออยู่ใน Header (วางหน้าชื่อ) */
    .set-list-header-row .tag-badge {
        position: static;       /* ยกเลิกการลอย */
        display: inline-flex;
        align-items: center;
        margin: 0;              /* ระยะห่างคุมด้วย gap ของ parent */
        padding: 3px 8px;       /* ลดขนาดลงนิดนึงให้กะทัดรัด */
        border-radius: 4px;     /* ทรงแคปซูลมนน้อยๆ */
        font-size: 0.75rem;
        line-height: 1.2;
        box-shadow: none;       /* เอาเงาออกเพื่อให้ดูเรียบเนียนไปกับบรรทัด */
    }

    .set-list-title {
        font-size: 1.1rem;
        font-weight: bold;
        color: #333;
        line-height: 1.2;
        margin-right: 2px;
    }

    /* Price Group */
    .set-list-price-group {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        text-align: left;
        white-space: nowrap;
    }

    .set-list-price {
        color: #d35400;
        font-weight: bold;
        font-size: 1rem;
    }

    .set-list-minqty {
        font-size: 0.8rem;
        color: #888;
        font-weight: normal;
    }

    /* แถวกลาง: คำอธิบาย */
    .set-list-desc {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 8px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* แถวล่างสุด: ตารางราคา + ปุ่ม */
    .set-list-footer-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        border-top: 1px dashed #eee;
        padding-top: 8px;
        gap: 10px;
    }

    .set-list-tiers-flex {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tier-badge-compact {
        background: #f8f9fa;
        border: 1px solid #eee;
        border-radius: 4px;
        padding: 2px 6px;
        font-size: 0.75rem;
        color: #555;
        white-space: nowrap;
    }

    .tier-badge-compact strong {
        color: #333;
    }

    .btn-list-buy {
        background-color: #28a745;
        color: white;
        border: none;
        padding: 6px 15px;
        border-radius: 50px;
        font-weight: bold;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
        white-space: nowrap;
        flex-shrink: 0;
    }

    .btn-list-buy:hover {
        background-color: #218838;
        transform: scale(1.05);
    }

    /* Mobile Responsive */
    @media (max-width: 576px) {
        .set-list-card {
            padding: 10px;
            gap: 10px;
        }
        .set-list-img-wrapper {
            width: 100px;
            height: 100px;
        }
        
        .set-list-header-row {
            flex-direction: row; 
            align-items: center; /* ให้ Badge กับตัวหนังสือกลางบรรทัด */
            gap: 5px;
        }
        
        /* ปรับขนาด Badge ในมือถือให้เล็กหน่อย */
        .set-list-header-row .tag-badge {
            padding: 2px 6px;
            font-size: 0.7rem;
        }

        .set-list-title {
            font-size: 1rem;
        }

        .set-list-price-group {
            font-size: 0.9rem;
        }

        .set-list-footer-row {
            flex-wrap: wrap; 
        }
        .btn-list-buy {
            margin-left: auto;
        }
    }

/* --- Tag Badges (ใช้ได้ทั้ง Grid และ List) --- */
.tag-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tag-badge.tag-popular {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
}

.tag-badge.tag-new {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
}

.tag-badge.tag-promo {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: #fff;
}

.tag-badge.tag-recommend {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
}

.tag-badge.tag-soldout {
    background: #6c757d;
    color: #fff;
}

/* Badge สำหรับ List Card (ปรับตำแหน่ง) */
.set-list-card .tag-badge {
    top: -6px;
    left: 65px;
}

/* --- Empty State --- */
.set-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.set-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* --- ปรับ Badge ให้ทำงานกับ Card เดิม --- */
.set-card {
    position: relative;
}

.set-card .tag-badge {
    top: 10px;
    left: 10px;
    z-index: 15;
}

/* [UPDATED V27.24] Builder Modal Styling - Header เด่น & ตัวเลือกแบบการ์ดมีมิติ */
    
    /* 1. กรอบใหญ่ของแต่ละ Slot */
    .builder-slot-card {
        border: 1px solid #ced4da; /* เส้นขอบเข้มขึ้นเล็กน้อย */
        border-radius: 8px;
        overflow: hidden; /* เพื่อให้มุมมนของ Header/Footer ไม่ล้น */
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* เงาภาพรวมบางๆ */
    }

    /* 2. ส่วนหัว (Header) - ใส่สีให้เด่นชัด */
    .builder-slot-header {
        background-color: #e9ecef !important; /* สีเทาอมฟ้าเข้ม (เป็นหัวข้อ) */
        color: #495057;
        border-bottom: 1px solid #ced4da;
        padding: 12px 15px !important; /* เพิ่มพื้นที่ภายในให้ดูไม่อึดอัด */
        transition: background-color 0.2s;
    }

    .builder-slot-header:hover {
        background-color: #dee2e6 !important; /* เมื่อชี้ให้สีเข้มขึ้นอีกนิด */
    }
    
    /* ปรับขนาดฟอนต์หัวข้อ */
    .slot-title {
        font-size: 1.05rem;
    }

    /* 3. พื้นที่ Dropdown (Container) */
    .builder-selection-area {
        background-color: #f8f9fa !important; /* สีพื้นหลังเทาอ่อน เพื่อรองรับการ์ด */
        padding: 12px; /* เว้นระยะขอบรอบๆ */
        border-top: 1px solid #ced4da; /* เส้นแบ่งกับ Header */
    }

    /* 4. ตัวเลือกเมนู (Card Item Style) - ทำเป็นใบๆ ลอยขึ้นมา */
    .builder-choice-item {
        background-color: #fff !important; /* การ์ดสีขาว */
        border: 1px solid #e0e0e0 !important; /* ขอบบางๆ */
        border-radius: 8px !important; /* มุมมน */
        margin-bottom: 8px !important; /* เว้นระยะห่างระหว่างใบ */
        padding: 12px 15px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important; /* เงาให้ดูลอย */
        transition: all 0.15s ease-in-out;
        position: relative;
    }

    /* Effect ตอนชี้ที่การ์ดเมนู */
    .builder-choice-item:hover {
        transform: translateY(-2px); /* ลอยขึ้นเล็กน้อย */
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important; /* เงาชัดขึ้น */
        border-color: var(--primary-color) !important; /* ขอบเปลี่ยนสีตามธีม */
        z-index: 2;
    }

    /* 5. สถานะเลือกแล้ว (Selected) */
    .builder-choice-item.border-success {
        background-color: #e8f5e9 !important; /* พื้นเขียวอ่อน */
        border: 2px solid #28a745 !important; /* ขอบเขียวหนาขึ้น */
        box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2) !important;
    }

    /* 6. สถานะถูกล็อก (Disabled) */
    .builder-choice-item.disabled {
        background-color: #f1f3f5 !important; /* เทาด้าน */
        opacity: 0.7;
        box-shadow: none !important;
        border-color: transparent !important;
        cursor: not-allowed !important;
    }

    /* [UPDATED V27.25] Modal Header Style - สีส้มแดงไล่เฉด (Gradient) */
    #setBuilderModal .modal-header {
        background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%) !important; /* ส้มไปแดง */
        color: white !important;
        border-bottom: 0 none;
        box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2); /* เงาสีส้มจางๆ ด้านล่าง */
        padding: 15px 20px; /* ขยายพื้นที่นิดหน่อย */
    }

    /* ปุ่มปิด (X) เปลี่ยนเป็นสีขาว */
    #setBuilderModal .close {
        color: white !important;
        opacity: 0.85;
        text-shadow: none;
    }
    
    #setBuilderModal .close:hover {
        opacity: 1;
    }

    /* ==========================================
   [NEW V28.0 - 2024-12-20] 
   CSS สำหรับ Badge ราคาพิเศษ (เมนูเปิดเตา)
   ========================================== */

/* Badge ราคาพิเศษ */
.special-price-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    animation: pulse-badge 1.5s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

/* Animation กระพริบเบาๆ */
@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.6);
    }
}

/* ราคาปกติขีดฆ่า */
.normal-price-strike {
    display: inline-block;
    color: #999;
    font-size: 0.9rem;
    text-decoration: line-through;
}

/* ปรับ Layout ราคาใน Builder Footer */
#builderFooterUnitPrice {
    color: #28a745;
    font-weight: bold;
}

/* Responsive - มือถือ */
@media (max-width: 576px) {
    .special-price-badge {
        display: block;
        text-align: center;
        margin-top: 5px;
        font-size: 0.75rem;
    }
    
    .normal-price-strike {
        font-size: 0.8rem;
    }
}

/* ==========================================
   [NEW V30.0] Sticky Message สำหรับเมนูเปิดเตา
   ========================================== */

/* กล่อง Sticky */
#builderStickyMessage {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* สถานะ: ยังไม่เลือก / เลือกบางส่วน */
#builderStickyMessage.status-need-more {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    color: #856404;
    border-color: #ffc107;
}

/* สถานะ: เลือกครบแล้ว */
#builderStickyMessage.status-complete {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #28a745;
}

/* สถานะ: เมนูเปิดเตาไม่พอ */
#builderStickyMessage.status-not-available {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border-color: #dee2e6;
}

/* สถานะ: ซ่อน (ได้ราคา Tier สูงสุดแล้ว) */
#builderStickyMessage.status-hidden {
    display: none !important;
}

/* Animation เมื่อได้ราคาพิเศษ */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

#builderStickyMessage.status-complete {
    animation: celebrate 0.5s ease;
}

/* ==========================================
   [NEW V30.0] Sticky Message สำหรับเมนูเปิดเตา
   ========================================== */

#builderStickyMessage {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#builderStickyMessage.status-need-more {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    color: #856404;
    border-color: #ffc107;
}

#builderStickyMessage.status-complete {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #28a745;
    animation: celebrate 0.5s ease;
}

#builderStickyMessage.status-not-available {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border-color: #dee2e6;
}

#builderStickyMessage.status-hidden {
    display: none !important;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* [NEW V30.5] Welcome Popup Styles */
.welcome-popup-custom {
    border-radius: 20px !important;
}
.welcome-popup-custom .swal2-title {
    font-size: 1.4em !important;
    color: #ff6b35 !important;
}
.welcome-popup-custom .swal2-html-container {
    padding: 0 10px !important;
}

