/* --- [1] 元のPCデザイン（絶対に変更しないでください） --- */
.card{
    background:#fff;
    margin:15px auto;
    padding:18px;
    width:90%;
    max-width:600px;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,0.1);
}

.msg{
    text-align:center;
    font-weight:bold;
    margin:10px;
}

.itemHeader{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}

.itemHeader input[type="checkbox"]{
    width:18px;
    height:18px;
}

.itemBody{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding-left:28px;
}

.qtyBox input{
    width:70px;
}

/* =============================
   フッター固定
============================= */
.fixedFooter{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    background:#fff;
    border-top:1px solid #ddd;
    padding:10px;
    box-shadow:0 -2px 8px rgba(0,0,0,0.15);
    z-index:9999;
}

.footerGrid{
    max-width:700px;
    margin:auto;
}

.footerRowTop{
    display:flex;
    gap:10px;
    margin-bottom:8px;
}

.footerRowBottom{
    display:flex;
    gap:10px;
}

.footerBtn{
    flex:1;
    padding:14px;
    border:none;
    border-radius:10px;
    font-size:16px;
    font-weight:bold;
    color:#fff;
    cursor:pointer;
    text-align:center;
    text-decoration:none;
}

.btnUpdate{ background:#4CAF50; }
.btnDelete{ background:#dc3545; }
.btnList{ background:#2196F3; }
.btnScan{ background:#ff9800; }
.btnMenu{ background:#607d8b; }

.footerBtn:hover{
    filter:brightness(0.9);
}

body{
    padding-bottom:160px;
}

h2{
    text-align:center;
}

/* ============================================================
   [2] スマホ専用調整（見切れを完全に封じ込める設定）
   ============================================================ */
@media screen and (max-width: 480px) {

    /* 外枠が画面幅を超えないように強制 */
    .fixedFooter {
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    .footerGrid {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* 確実に2列にするためのグリッド設定 */
    .footerRowTop, .footerRowBottom {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 均等に50%ずつ */
        gap: 8px !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .footerBtn {
        flex: none !important;
        width: 100% !important;
        display: block !important;
        padding: 12px 0 !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    /* 「続けてスキャン」を非表示にして2x2のタイルにする */
    .btnScan {
        display: none !important;
    }

    /* カード内の表示が潰れないよう縦並びに変更 */
    .itemBody {
        display: block !important;
        padding-left: 0 !important;
        margin-top: 10px !important;
        border-top: 1px dashed #eee !important;
        padding-top: 10px !important;
    }

    .itemBody input {
        width: 100% !important;
        height: 40px !important;
        margin-top: 5px !important;
        margin-bottom: 10px !important;
        box-sizing: border-box !important;
    }

    .productNameInput {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    body {
        padding-bottom: 220px !important;
    }
}/* --- [1] 元のPCデザイン（絶対に変更しないでください） --- */
.card{
    background:#fff;
    margin:15px auto;
    padding:18px;
    width:90%;
    max-width:600px;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,0.1);
}

.msg{
    text-align:center;
    font-weight:bold;
    margin:10px;
}

.itemHeader{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}

.itemHeader input[type=\"checkbox\"]{
    width:18px;
    height:18px;
}

.itemBody{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding-left:28px;
}

.qtyBox input{
    width:70px;
}

/* =============================
   フッター固定
============================= */
.fixedFooter{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    background:#fff;
    border-top:1px solid #ddd;
    padding:10px;
    box-shadow:0 -2px 8px rgba(0,0,0,0.15);
    z-index:9999;
}

.footerGrid{
    max-width:700px;
    margin:auto;
}

.footerRowTop{
    display:flex;
    gap:10px;
    margin-bottom:8px;
}

.footerRowBottom{
    display:flex;
    gap:10px;
}

.footerBtn{
    flex:1;
    padding:14px;
    border:none;
    border-radius:10px;
    font-size:16px;
    font-weight:bold;
    color:#fff;
    cursor:pointer;
    text-align:center;
    text-decoration:none;
    /* Safari用の外観リセット */
    -webkit-appearance: none;
    appearance: none;
}

.btnUpdate{ background:#4CAF50; }
.btnDelete{ background:#dc3545; }
.btnList{ background:#2196F3; }
.btnScan{ background:#ff9800; }
.btnMenu{ background:#607d8b; }

.footerBtn:hover{
    filter:brightness(0.9);
}

body{
    padding-bottom:160px;
}

h2{
    text-align:center;
}

/* ============================================================
   [2] スマホ・Safari対応調整
   ============================================================ */
@media screen and (max-width: 480px) {

    /* Safariでの横幅計算を安定させる */
    .fixedFooter {
        padding: 10px !important;
        box-sizing: border-box !important;
        /* iOS Safariの画面下部ナビゲーションバー対策 */
        padding-bottom: env(safe-area-inset-bottom, 10px) !important;
    }

    .footerGrid {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Safariでも確実にタイル状に並べるための指定 */
    .footerRowTop, .footerRowBottom {
        display: -ms-grid !important; /* IE11/古いSafari用 */
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 1fr 1fr より Safariで安定 */
        gap: 8px !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .footerBtn {
        flex: none !important;
        width: 100% !important;
        display: block !important;
        padding: 14px 0 !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        /* Safariでボタンが丸まったり、変な影が出るのを防ぐ */
        -webkit-border-radius: 10px;
        border-radius: 10px;
    }

    .btnScan {
        display: none !important;
    }

    /* カード内の表示崩れをSafariでも防止 */
    .itemBody {
        display: block !important;
        padding-left: 0 !important;
        margin-top: 10px !important;
        border-top: 1px dashed #eee !important;
        padding-top: 10px !important;
    }

    .itemBody input {
        width: 100% !important;
        height: 44px !important; /* iOSでタップしやすい最小高さ */
        margin-top: 5px !important;
        margin-bottom: 10px !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* iOSでズームされるのを防ぐサイズ */
        -webkit-appearance: none;
    }

    .productNameInput {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }

    body {
        /* Safariのセーフエリアを考慮した余白 */
        padding-bottom: calc(220px + env(safe-area-inset-bottom)) !important;
    }
}