@charset "utf-8";
/*=====================================================================/
/リセット/クリア/単独設定
/=====================================================================*/
        /* 基本スタイル */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* ヘッダー */
        .header {
            display: flex;
            align-items: center;
            padding: 10px;
            background-color: #fff;
            border-bottom: 1px solid #ddd;
            flex-shrink: 0;
            flex-wrap: wrap; /* スマホで要素が折り返すように */
        }
        .menu-icon {
            font-size: 24px;
            cursor: pointer;
            margin-right: 15px;
            flex-shrink: 0;
        }
        .header-select-wrapper {
            flex-grow: 1; /* 残りのスペースを埋めるように */
            margin-right: 10px; /* 日付との間隔 */
            display: contents;
        }
        .header-select {
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            font-size: 1.5em; /* フォントサイズ1.5em */
            width: 100%; /* 親要素に対して幅50%に */
            box-sizing: border-box; /* paddingとborderをwidthに含める */
            max-width: 350px; /* 最大幅を設定してPC表示で大きくなりすぎないように */
        }
        .header-controls {
            display: flex;
            align-items: center;
            margin-left: auto;
            flex-shrink: 0;
            flex-wrap: wrap; /* スマホでボタンが折り返すように */
            gap: 10px; /* ボタン間のスペース */
        }
        .header-controls .date-picker-trigger {
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            background-color: #fff;
            cursor: pointer;
            min-width: 150px;
            text-align: center;
            flex-shrink: 0; /* 日付は縮まない */
        }
        .header-controls button {
            padding: 8px 15px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
        }
        .header-controls .confirm-btn {
            background-color: #7cb342;
            color: white;
        }
        .header-controls .clear-btn {
            background-color: #e0e0e0;
            color: #333;
        }
        .cal-title {
			display: contents;
		}
		.topbutton {
		}
		.item1, .item2, .item3, .item4, .item5 {
		}
		#goukei {
			background-color: bisque;
		}
		.deliverynm {
		}
		.tit1 {	min-width:235px;}
		.tit2 {	min-width:88px;}
		.tit3 {	min-width:90px;}
		.tit4 {	min-width:90px;}

		.reg a{
		  color : #02a4c9;
		  font-size: 1.4em;
		  outline-width : medium;
		  outline-style : none;
		  outline-color : black;
		}

		.reg a:focus{
		  color : #00edcc;
		}

		.reg a:hover{
		  color : #00edcc;
		}

        /* メインコンテンツ */
        .main-content {
            display: flex;
            padding: 15px;
            gap: 15px;
            max-width: 1200px;
            margin: 0 auto;
            flex-grow: 1;
            align-items: flex-start;
            width: 100%;
            box-sizing: border-box;
            overflow: hidden; /* 子要素のスクロールのために必要 */
        }

        /* 商品リスト */
        .product-list-container {
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 15px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            flex: 1;
            min-width: 200px;
            display: flex;
            flex-direction: column;
            /* main-contentの高さからヘッダーとパディングを引いた分 */
            max-height: calc(100vh - 80px); /* ヘッダーの高さとmain-contentのpaddingを考慮 */
        }
        .product-list-container h3 {
            margin-top: 0;
            margin-bottom: 10px;
            flex-shrink: 0;
            height: 27px; /* 品名ヘッダーと同じ高さに固定 */
            line-height: 27px;
        }
        .product-list {
            flex-grow: 1;
            overflow-y: auto;
            border: 1px solid #eee;
            padding: 5px;
        }
        .product-item {
            padding: 8px 5px;
            cursor: pointer;
            border-bottom: 1px solid #eee;
        }
        .product-item:hover {
            background-color: #f0f0f0;
        }
        .product-item:last-child {
            border-bottom: none;
        }
        .confirmBtn {
			background-color: #999;
		}
		body.waiting {
		  cursor: wait !important;
		}

        /* 注文入力エリア */
        .order-total-container {
            padding-top: 10px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            display: inline-block;
            width: 100%;
			text-align: right;
		}
        .order-total-input {
			text-align: right;
            font-size: 1.2em; /* スマホ向けに調整 */
            background: none;
            width: 95px;
		}
        .order-total-tax {
			text-align: right;
            font-size: 0.6em; /* スマホ向けに調整 */
            background: none;
            border: 0;
            width: 45px;
		}
		.input_goukei{
            font-size: 1em; /* スマホ向けに調整 */
		}
		.input_tax{
            font-size: 0.6em; /* スマホ向けに調整 */
		}
        .order-input-wrapper {
            flex: 2;
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 15px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
            /* main-contentの高さからヘッダーとパディングを引いた分 */
            max-height: calc(100vh - 80px); /* ヘッダーの高さとmain-contentのpaddingを考慮 */
        }
        .order-input-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-right: 15px; /* スクロールバーとの重なりを避けるため */
            flex-shrink: 0;
        }
        .order-input-header h3 {
            margin: 0;
            flex: 1;
            height: 27px; /* 品名ヘッダーと同じ高さに固定 */
            line-height: 27px;
        }
        .order-input-header h3:nth-child(2) { /* 数量のヘッダー */
            text-align: left; /* 数量入力ボックスの左端に揃える */
            width: calc(70px + 12px + 10px); /* 数量入力欄の幅 + 削除ボタンの幅 + gap */
            flex-shrink: 0;
        }
        .order-input-container {
            flex-grow: 1;
            overflow-y: auto;
            border-top: 1px solid #eee;
            padding-top: 10px;
            padding-right: 5px; /* スクロールバー分の余白 */
        }
        .order-item {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            gap: 10px;
            transition: transform 0.5s ease-out, opacity 0.5s ease-out, margin-top 0.5s ease-out;
            min-height: 38px;
        }
        .order-item.removing {
            transform: translateY(-100%);
            opacity: 0;
            margin-bottom: -48px; /* 行の高さに合わせて調整 */
            pointer-events: none;
        }
        .order-item input[type="text"] {
            flex: 1;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            background-color: #fff;
            font-size: 1em; /* スマホ向けに調整 */
        }
        .order-item input.fixed-product {
            border: none;
            background-color: transparent;
        }
        .order-item input[type="text"][readonly] {
            cursor: default;
        }
        .order-item input.quantity-input {
            width: 50px;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            text-align: right;
            font-size: 1em; /* スマホ向けに調整 */
            flex-shrink: 0; /* 縮まないように */
        }
        .order-item .quantity-input.empty-quantity {
            background-color: #e3f2fd;
        }
        .order-item input.unitpr-input {
            width: 70px;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            text-align: right;
            font-size: 1em; /* スマホ向けに調整 */
            flex-shrink: 0; /* 縮まないように */
        }
        .order-item .unitpr-input.empty-unitpr {
            background-color: #e3f2fd;
        }
        .order-item input.total-input {
            width: 70px;
            padding: 8px;
            border: 0;
            border-radius: 3px;
            text-align: right;
            font-size: 1em; /* スマホ向けに調整 */
            flex-shrink: 0; /* 縮まないように */
        }
        .order-item .delete-btn {
            padding: 8px 12px;
            background-color: #f44336;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            flex-shrink: 0;
            font-size: 1em; /* スマホ向けに調整 */
        }
        .order-item .product-name-input.duplicate {
            color: red;
        }

        /* エラーメッセージ */
        .error-message {
            color: red;
            background-color: #ffebee;
            padding: 10px;
            border-radius: 5px;
            margin-top: 15px;
            text-align: center;
            display: none; /* 初期非表示 */
            font-weight: bold;
        }

        /* Quantity Input Dialog */
        .quantity-dialog-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .quantity-dialog {
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            width: 300px;
            text-align: center;
            max-width: 90%; /* スマホで画面からはみ出さないように */
        }
        .quantity-dialog .dialog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        .quantity-dialog .dialog-header h3 {
            margin: 0;
            font-size: 18px;
        }
        .quantity-dialog .close-btn {
            font-size: 24px;
            cursor: pointer;
            border: none;
            background: none;
            padding: 0;
            color: #555;
        }
        .quantity-dialog .num-pad {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }
        .quantity-dialog .num-pad button {
            padding: 15px 10px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 5px;
            background-color: #f9f9f9;
            cursor: pointer;
        }
        .quantity-dialog .num-pad button:active {
            background-color: #e0e0e0;
        }
        .quantity-dialog .confirm-btn {
            padding: 10px 20px;
            background-color: #7cb342;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }

        /* Calendar Dialog */
        .calendar-dialog-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .calendar-dialog {
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            width: 320px;
            max-width: 90%; /* スマホで画面からはみ出さないように */
        }
        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            font-weight: bold;
        }
        .calendar-header button {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            padding: 5px;
        }
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 5px;
            text-align: center;
        }
        .calendar-grid div {
            padding: 10px 5px;
            border-radius: 3px;
        }
        .calendar-grid .day-name {
            font-weight: bold;
            color: #555;
        }
        .calendar-grid .day {
            cursor: pointer;
            background-color: #f0f0f0;
        }
        .calendar-grid .day:hover {
            background-color: #e0e0e0;
        }
        .calendar-grid .day.selected {
            background-color: #ffeb3b;
            font-weight: bold;
        }
        .calendar-grid .day.inactive {
            color: #ccc;
            background-color: #fff;
            cursor: default;
        }

        /* Menu Popup */
        .menu-popup-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }
        .menu-popup {
            position: absolute;
            top: 50px;
            left: 0;
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            width: 200px;
            padding: 10px 0;
            font-size: 1.1em; /* スマホ向けに調整 */
        }
        .menu-popup a {
            display: block;
            padding: 10px 15px;
            color: #333;
            text-decoration: none;
        }
        .menu-popup a:hover {
            background-color: #f0f0f0;
        }

        /* スマートフォン向けスタイル */
        @media screen and (max-width: 768px) {
            .header {
                flex-direction: column; /* ヘッダーを縦並びに */
                align-items: flex-start;
                padding: 10px;
            }
            .header-select-wrapper {
                margin-bottom: 10px; /* プルダウンと日付の間にスペース */
                width: 100%; /* 幅を100%に */
                margin-right: 0;
                display: -webkit-box;
            }
            .header-select {
                width: 90%; /* スマホでは全幅 */
                max-width: none; /* 最大幅の制限を解除 */
                font-size: 1em; /* フォントサイズ1.5em */
            }

            .header-controls {
                flex-direction: column; /* ボタンも縦並びに */
                align-items: flex-start;
                width: 100%;
                margin-left: 0;
                gap: 5px; /* ボタン間のスペースを小さく */
            }
            .header-controls .date-picker-trigger,
            .header-controls button {
                width: 100%;
                box-sizing: border-box;
            }
            .date-picker-trigger {
                width: 30% !important;
				font-size: 0.8em !important;
			}
        	.cal-title {
				display: -webkit-inline-box;
			}
			.topbutton {
				display: ruby;
			}
            .menu-icon {
                margin-bottom: 10px;
            }
	        .order-total-input {
				text-align: right;
	            font-size: 1em; /* スマホ向けに調整 */
	            background: none;
	            width: 100px;
			}
			.item1 {
				width: 80px !important;
			}
			.item2 {
				width: 30px !important;
			}
			.item3 {
				width: 60px !important;
			}
			.item4 {
				width: 60px !important;
			}
			.item5 {
				font-size: 0.6em !important;
			}
			.deliverynm {
				width: 70%;
				font-size: 0.9em !important;
			}
			.itemnm {
				width: 60%;
				font-size: 0.9em !important;
			}
			.itemunit {
				width: 15%;
				font-size: 0.9em !important;
			}
			.tit1 {	min-width:112px;}
			.tit2 {	min-width:32px;max-width: 62px !important;}
			.tit3 {	min-width:30px;}
			.tit4 {	min-width:30px;}
			
            .main-content {
                flex-direction: column; /* メインコンテンツを縦並びに */
                padding: 10px;
                gap: 10px;
            }
            .product-list-container,
            .order-input-wrapper {
                width: 100%;
                max-width: none; /* 最大幅の制限を解除 */
                max-height: 45vh; /* スマホで画面の半分程度に */
                padding: 10px;
                box-sizing: border-box;
            }
            .fullheight {
                max-height: 66vh !important; /* スマホで画面の半分程度に */
			}
            .fullheight2 {
                max-height: 90% !important; /* スマホで画面の半分程度に */
			}
			.item-list {
				max-height: 20vh;
			}

            .product-list-container h3,
            .order-input-wrapper .order-input-header h3 {
                font-size: 1.2em; /* スマホで少し小さく */
            }
            .order-item input[type="text"],
            .order-item input.quantity-input,
            .order-item input.unitpr-input,
            .order-item input.total-input,
            .order-item .delete-btn {
                font-size: 0.9em; /* スマホで入力欄のフォントを小さく */
                padding: 6px; /* パディングも小さく */
            }
            .order-item .delete-btn {
                padding: 6px 10px;
            }
            .order-item {
                gap: 5px;
                margin-bottom: 8px;
                min-height: 32px; /* スマホでの行の最小高さを調整 */
            }
            .order-item.removing {
                 margin-bottom: -40px; /* スマホでの行の高さに合わせて調整 */
            }
            .order-input-header h3:nth-child(2) {
                width: calc(60px + 10px + 5px); /* スマホでの数量入力欄+削除ボタンの幅+gap */
            }
            .order-item input.quantity-input {
                width: 60px; /* スマホでの数量入力欄の幅を調整 */
            }
        }
