/**
 * Hiro Minimal Menu - Main Stylesheet
 * v1.7.1 (Modal Color Fix + Layout)
 */

/* =========================================
 * 1-4. SHORTCODE STYLES (หน้ารวม)
 * ========================================= */
.hiro-menu-container {
    width: 100%; margin: 30px 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hiro-menu-filters {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px;
    padding-bottom: 15px; border-bottom: 2px solid #f1f1f1;
}
.filter-button {
    padding: 8px 18px; border: 1px solid #ddd; border-radius: 25px;
    background: #f9f9f9; color: #333; font-size: 14px;
    font-weight: 500; cursor: pointer; transition: all 0.2s ease-in-out;
}
.filter-button:hover { background: #eee; border-color: #ccc; }
.filter-button.is-active { background: #006241; color: #fff; border-color: #006241; }
.hiro-menu-grid { margin: 0 -12.5px; }

/* [แก้ไข] เพิ่ม !important เพื่อชนะ Isotope.js */
.hiro-menu-item {
    text-align: center; box-sizing: border-box;
    padding: 0 12.5px 25px; width: 50%;
    transition: opacity 0.5s ease-in-out, transform 0s linear !important;
}
@media (min-width: 600px) { .hiro-menu-item { width: 33.333%; } }
@media (min-width: 960px) { .hiro-menu-item { width: 25%; } }
.hiro-menu-item-link { text-decoration: none; color: #222; display: block; }

.hiro-menu-item-image {
    width: 100%; padding-top: 100%; position: relative;
    border-radius: 20px;
    margin-bottom: 15px; overflow: hidden;
}
.hiro-menu-item-image img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; transition: transform 0.3s ease-in-out;
}
.hiro-menu-item-link:hover .hiro-menu-item-image img { transform: scale(1.1); }
.hiro-menu-item-title {
    font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; height: 42px;
}

/* =========================================
 * 9. HIRO MENU - SINGLE PAGE STYLES (v1.4.3)
 * (สไตล์เหล่านี้จะถูกใช้ "ภายใน" Modal ด้วย)
 * ========================================= */
/* [แก้ไข] ลบ :root ออก เพราะจะถูกกำหนดผ่าน JS ด้วย inline-style แทน */
.hiro-single-us {
    width: 100%; background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111;
}
.hiro-us-container {
    max-width: 900px; margin: 0 auto;
    padding: 0 20px; box-sizing: border-box;
}
.hiro-us-header {
    /* [แก้ไข] ใช้ var() สำหรับสี */
    background-color: var(--hiro-theme-bg);
    color: var(--hiro-theme-text); padding: 30px 0;
}
.hiro-us-header .hiro-us-container { display: block; text-align: center; gap: 0; }
.hiro-us-header-image { width: 200px; margin: 0 auto 15px; }
.hiro-us-header-image img { width: 100%; height: auto; display: block; }
.hiro-us-header-content { text-align: center; min-width: 0; }
.hiro-us-title { font-size: 28px; font-weight: 700; margin: 0 0 5px 0; color: var(--hiro-theme-text); }
.hiro-us-subtitle { font-size: 18px; font-weight: 500; opacity: 0.9; color: var(--hiro-theme-text); }
@media (min-width: 768px) {
    .hiro-us-header .hiro-us-container { display: flex; align-items: center; text-align: left; gap: 30px; }
    .hiro-us-header-image { width: 200px; margin: 0; }
    .hiro-us-header-content { text-align: left; }
    .hiro-us-title { font-size: 40px; }
    .hiro-us-subtitle { font-size: 22px; }
}
.hiro-us-main-content { background: transparent; padding: 40px 0; }
.hiro-us-back-button-wrapper { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.hiro-us-back-button { text-decoration: none; color: var(--hiro-theme-bg); font-weight: 600; font-size: 14px; transition: opacity 0.2s ease; }
.hiro-us-back-button:hover { opacity: 0.7; }

/* [แก้ไข] Grid เป็น 1 คอลัมน์เสมอสำหรับ Modal */
.hiro-us-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
/* [ใหม่] ซ่อนคอลัมน์ที่ไม่ต้องการใน Modal */
.hiro-us-grid-col.hiro-us-hidden-col { display: none; } 

.hiro-us-section { margin-bottom: 30px; background: transparent; padding: 0; border: none; border-radius: 0; }
.hiro-us-section-title { font-size: 22px; font-weight: 700; margin: 0 0 20px 0; padding-bottom: 0; border-bottom: none; opacity: 1; }
.hiro-us-size-options { display: flex; flex-wrap: wrap; gap: 15px; }
.hiro-us-size-item { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border: 2px solid #ddd; border-radius: 30px; background: #fff; }
.hiro-us-size-icon img { height: 45px; width: auto; display: block; }
.hiro-us-size-info { display: flex; flex-direction: column; }
.hiro-us-size-info strong { font-size: 15px; font-weight: 600; }
.hiro-us-size-info span { font-size: 13px; color: #555; }
.hiro-us-included, .hiro-us-price-details { font-size: 15px; line-height: 1.6; }
.hiro-us-included p, .hiro-us-price-details p, .hiro-us-included ul, .hiro-us-price-details ul, .hiro-us-included ol, .hiro-us-price-details ol { margin-top: 0; }
.hiro-allergen-wrapper .hiro-allergen-info { font-size: 14px; background-color: #f7f7ff; padding: 15px; border: 1px solid #eef; color: #555; border-radius: 4px; }
/* [ใหม่] ซ่อนส่วนโภชนาการและ Description ทั้งหมดใน Modal */
.hiro-us-nutrition-wrapper.hiro-us-hidden-section { display: none; }

.hiro-us-menu-description { font-size: 16px; line-height: 1.7; margin: 0 auto 30px auto; }
.hiro-nutrition-box { border-top: 2px solid #eee; margin: 0 auto; }
.hiro-nutrition-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #eee; }
.hiro-nutrition-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.hiro-nutrition-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #444; }
.hiro-nutrition-table td { padding: 12px 5px; border-bottom: 1px solid #f7f7f7; width: 25%; }
.hiro-nutrition-table tr:nth-child(odd) td { background: #fafafa; }
.hiro-nutrition-table td:nth-child(1), .hiro-nutrition-table td:nth-child(3) { font-weight: 600; color: #222; }
.hiro-nutrition-table td:nth-child(2), .hiro-nutrition-table td:nth-child(4) { text-align: right; }
.hiro-us-price-details table { width: 100% !important; border-collapse: collapse !important; border-spacing: 0 !important; font-size: 15px !important; margin-top: 10px !important; border: none !important; border-radius: 0 !important; overflow: visible !important; box-shadow: none !important; background: transparent !important; }
.hiro-us-price-details th { background: transparent !important; color: #333 !important; font-weight: 600 !important; padding: 8px 8px !important; border: none !important; }
.hiro-us-price-details tbody tr { background: transparent !important; border: none !important; box-shadow: none !important; }
.hiro-us-price-details td { padding: 8px 8px !important; color: #444 !important; border: none !important; }
.hiro-us-price-details th:first-child, .hiro-us-price-details td:first-child { text-align: left !important; font-weight: 500 !important; color: #222 !important; }
.hiro-us-price-details th:not(:first-child), .hiro-us-price-details td:not(:first-child) { text-align: right !important; }


/* =========================================
 * 11. [อัปเดต] MODAL STYLES (v1.7.1 - Pre-load)
 * ========================================= */

body.hiro-modal-open {
    overflow: hidden;
}
.hiro-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
}
.hiro-modal-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.hiro-modal-close-btn {
    position: fixed;
    top: 10px; right: 15px;
    z-index: 100001;
    font-size: 35px;
    font-weight: 300;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.hiro-modal-close-btn:hover {
    opacity: 1;
}
.hiro-modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    min-height: 100%;
}
.hiro-modal-content .hiro-us-back-button-wrapper {
    display: none; /* ซ่อนปุ่มย้อนกลับ เมื่ออยู่ใน Modal */
}

/* [แก้ไข] Responsive สำหรับ Modal */
@media (min-width: 768px) {
    .hiro-modal-wrapper {
        top: 5vh; left: 50%; bottom: 5vh; right: auto;
        /* [แก้ไข] ลดความกว้างสูงสุดของ Modal */
        width: 90%; max-width: 600px; max-height: 90vh; 
        transform: translateX(-50%);
        border-radius: 8px;
        overflow: hidden;
    }
    .hiro-modal-content {
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    .hiro-modal-close-btn {
        position: absolute;
        color: #888;
        top: 5px; right: 10px;
    }
}