* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, sans-serif;
    background: #f5f5f5;
    color: #292929;
    /* 商品一覧はフッターカートバーの高さ＋iPhoneのホームバー分をあける（viewport-fit=cover の時だけ env が効く） */
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ヘッダー */
.header {
    background: #ffbc0d;
    color: #292929;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
}

.back-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #292929;
    padding: 4px 8px;
    font-weight: 600;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-title-center {
    font-size: 18px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* カテゴリーナビゲーション */
.category-nav {
    background: white;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: calc(56px + env(safe-area-inset-top, 0px));
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: #f5f5f5;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: #292929;
    touch-action: manipulation;
}

.category-btn.active {
    background: #292929;
    color: white;
}

/* メインコンテンツ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* カテゴリーセクション */
.category-section {
    margin-bottom: 32px;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #292929;
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 4px solid #ffbc0d;
}

/* 商品グリッド */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    touch-action: manipulation;
    position: relative;
}

.product-card:active {
    transform: scale(0.98);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.sold-out-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    margin-bottom: 12px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .product-icon {
    font-size: 64px;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-placeholder svg {
    width: 100%;
    height: 100%;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #292929;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #da291c;
}

/* 「1人前（2本）」は1行目、「¥440 (税込)」は途中で改行しないように2行目にまとめる */
.price-serving {
    display: block;
    font-size: 0.75em;
    color: #e8362f;
    font-weight: bold;
}

.price-main {
    white-space: nowrap;
}

/* フッターカートバー */
.footer-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    /* 新しいiPhoneのホームバー（画面下の横線）と重ならないよう、その分だけ下にあける */
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
    z-index: 100;
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon {
    font-size: 28px;
}

.cart-summary {
    display: flex;
    flex-direction: column;
}

.cart-count {
    font-size: 12px;
    color: #666;
}

.cart-total {
    font-size: 18px;
    font-weight: 700;
    color: #292929;
}

.cart-btn {
    background: #ffbc0d;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    transition: background 0.2s;
    touch-action: manipulation;
}

.cart-btn:active {
    background: #e6aa0c;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

.product-image-large {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    margin-bottom: 16px;
    overflow: hidden;
}

.product-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-large .product-icon {
    font-size: 96px;
}

.modal-product-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #292929;
}

.modal-product-price {
    font-size: 28px;
    font-weight: 700;
    color: #da291c;
    margin-bottom: 16px;
}

.modal-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* 数量選択 */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #292929;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #292929;
    touch-action: manipulation;
}

.quantity-btn:active {
    background: #292929;
    color: white;
}

.quantity-value {
    font-size: 32px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
    white-space: nowrap;
}

/* モーダルアクション */
.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.btn-add-cart {
    flex: 2;
    padding: 14px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.btn-add-cart:active {
    background: #e6aa0c;
}

/* カートページ */
.cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
}

.cart-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.clear-cart-btn {
    background: white;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-cart-btn:hover {
    background: #dc3545;
    color: white;
}

.cart-items-list {
    margin-bottom: 24px;
}

.cart-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #292929;
}

.cart-item-price {
    font-size: 14px;
    color: #da291c;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.cart-qty-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    white-space: nowrap;
}

.cart-item-price-unit {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.cart-item-total {
    font-size: 18px;
    font-weight: 700;
    color: #292929;
}

/* カート合計セクション */
.cart-summary-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
}

.summary-row.total {
    border-top: 2px solid #f5f5f5;
    padding-top: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #292929;
}

/* 支払いボタン */
.payment-btn {
    width: 100%;
    padding: 16px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.payment-btn:active {
    background: #e6aa0c;
}

/* 支払い方法モーダル */
.payment-modal-content {
    max-width: 480px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.payment-methods {
    margin-bottom: 24px;
}

.payment-method-btn {
    width: 100%;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    touch-action: manipulation;
}

.payment-method-btn.selected {
    border-color: #ffbc0d;
    background: #fffbf0;
}

.payment-icon {
    font-size: 32px;
}

.payment-text {
    flex: 1;
    text-align: left;
}

.payment-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.payment-desc {
    font-size: 12px;
    color: #666;
}

.payment-check {
    font-size: 24px;
    color: #ffbc0d;
    font-weight: 700;
}

.btn-confirm-payment {
    width: 100%;
    padding: 16px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.btn-confirm {
    flex: 1;
    padding: 14px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.confirm-text {
    text-align: center;
    margin-bottom: 24px;
    color: #666;
}

/* 成功モーダル */
.success-icon {
    width: 80px;
    height: 80px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin: 0 auto 24px;
}

.success-text {
    text-align: center;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.success-pickup {
    display: block;
    margin-top: 8px;
    font-weight: 700;
    color: #292929;
}

/* 友だち未追加の案内（注文確定のLINEが届かない人向け） */
.line-friend-notice {
    text-align: left;
    background: #f4f9f4;
    border: 1px solid #cfe8d4;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #292929;
}

.line-friend-notice p {
    margin: 0 0 10px;
}

.line-friend-notice .notice-sub {
    color: #666;
    font-size: 13px;
}

.btn-line-friend {
    display: block;
    padding: 12px;
    background: #06C755;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
}

.btn-close-success {
    width: 100%;
    padding: 14px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.back-btn {
    touch-action: manipulation;
}

.modal-close {
    touch-action: manipulation;
}

/* 受取日時選択ボタン */
.pickup-time-btn {
    width: 100%;
    padding: 16px;
    background: #292929;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    touch-action: manipulation;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pickup-time-btn:active {
    background: #1a1a1a;
}

.pickup-time-btn.selected {
    background: #27ae60;
}

.pickup-time-btn.selected:active {
    background: #229954;
}

.pickup-btn-check {
    font-size: 20px;
}

/* 受付停止中・焼き物の本数上限超えの案内（cart.js renderPickupNotice / index.php） */
.pickup-block-notice {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #a12a1f;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

/* 選択された受取日時表示 */
.selected-pickup-time {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid #ffbc0d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-time-content {
    flex: 1;
}

.selected-time-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.selected-time-value {
    font-size: 18px;
    font-weight: 700;
    color: #292929;
}

.change-time-btn {
    background: none;
    border: none;
    color: #da291c;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    white-space: nowrap;
    touch-action: manipulation;
    text-decoration: underline;
}

.change-time-btn:active {
    opacity: 0.7;
}

/* お客様メモ入力欄 */
.customer-memo-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* 電話番号入力セクション */
.phone-number-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid #ffbc0d;
}

.phone-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #292929;
    margin-bottom: 8px;
}

.required-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.phone-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.phone-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.phone-input:focus {
    outline: none;
    border-color: #ffbc0d;
}

.phone-input.valid {
    border-color: #27ae60;
}

.phone-input.error {
    border-color: #e74c3c;
}

.phone-status {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

.phone-status.success {
    color: #27ae60;
}

.phone-status.error {
    color: #e74c3c;
}

.memo-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #292929;
    margin-bottom: 8px;
}

.memo-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.memo-textarea:focus {
    outline: none;
    border-color: #ffbc0d;
}

.memo-char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 支払いボタン無効状態 */
.payment-btn.disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.payment-btn.disabled:active {
    background: #ddd;
}

/* 受取日時モーダル */
.pickup-modal-content {
    max-width: 480px;
}

.date-selector,
.time-selector {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #292929;
}

.date-select,
.time-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.date-select:focus,
.time-select:focus {
    outline: none;
    border-color: #ffbc0d;
}

.date-select:disabled,
.time-select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.btn-confirm-pickup {
    width: 100%;
    padding: 16px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
}

.btn-confirm-pickup:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.btn-confirm-pickup:active:not(:disabled) {
    background: #e6aa0c;
}

/* カートが空の場合 */
.empty-cart-message {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-icon {
    font-size: 80px;
    margin-bottom: 16px;
}

.empty-cart-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
}

.btn-back-shop {
    display: inline-block;
    padding: 12px 32px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    text-decoration: none;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .products-grid {
        gap: 8px;
    }

    .product-card {
        padding: 12px;
    }

    .product-image {
        font-size: 48px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }
}

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

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 支払いページ */
.payment-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #292929;
}

/* 注文内容サマリー */
.order-summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.order-items {
    margin-bottom: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    font-size: 14px;
    color: #292929;
}

.order-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #292929;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 2px solid #f5f5f5;
    font-size: 18px;
    font-weight: 700;
}

.order-total-price {
    color: #da291c;
}

/* 受取日時情報 */
.pickup-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.cancel-tel-note {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

.cancel-tel-note a {
    color: #292929;
    font-weight: 600;
}

.pickup-datetime {
    font-size: 16px;
    font-weight: 600;
    color: #292929;
    padding: 12px;
    background: #fffbf0;
    border-radius: 8px;
    border: 2px solid #ffbc0d;
}

/* 支払いフォーム */
.payment-form {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #292929;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #ffbc0d;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 支払い方法選択（ラジオボタン） */
#payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.payment-method-option {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
}

.payment-method-option:hover {
    border-color: #ffbc0d;
}

.payment-method-label {
    display: block;
    cursor: pointer;
    position: relative;
}

.payment-method-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.payment-method-label input[type="radio"]:checked ~ .payment-method-content {
    background: #fffbf0;
    border-left: 4px solid #ffbc0d;
}

.payment-method-option:has(input[type="radio"]:checked) {
    border-color: #ffbc0d;
    background: #fffbf0;
}

.payment-method-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 6px;
    position: relative;
}

.card-brand-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    flex-shrink: 0;
}

.card-details {
    flex: 1;
    min-width: 0;
}

.card-brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #292929;
    margin-bottom: 4px;
}

.card-number-display {
    font-size: 14px;
    color: #666;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.card-expiry-display {
    font-size: 12px;
    color: #999;
}

.default-badge-small {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffbc0d;
    color: #292929;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* 新規カード入力 */
#new-card-form {
    margin-top: 16px;
}

.new-card-inputs {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* チェックボックスラベル */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #292929;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 支払いボタン */
.submit-payment-btn {
    width: 100%;
    padding: 16px;
    background: #da291c;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    touch-action: manipulation;
    transition: background 0.2s;
}

.submit-payment-btn:active {
    background: #b82216;
}

/* 処理中モーダル */
.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f5f5f5;
    border-top: 4px solid #ffbc0d;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-text {
    text-align: center;
    color: #666;
    margin-bottom: 0;
}

/* 認証ページ（ログイン・登録） */
.auth-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 16px;
}

.auth-container {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.auth-form {
    margin-bottom: 24px;
}

.error-message {
    background: #ffe5e5;
    color: #da291c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    white-space: pre-line;
}

.success-message {
    background: #e5f7e5;
    color: #27ae60;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    white-space: pre-line;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: block;
}

.form-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 24px 0;
}

.password-change-toggle-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #292929;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.password-change-toggle-btn:hover {
    background: #e8e8e8;
}

.password-change-toggle-btn.active {
    background: #ffe5e5;
    color: #da291c;
    border-color: #da291c;
}

.secondary-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #292929;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #292929;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f5f5f5;
}

.text-btn {
    background: none;
    border: none;
    color: #da291c;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: underline;
    touch-action: manipulation;
}

.text-btn:active {
    opacity: 0.7;
}

/* カード管理 */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-cards-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.card-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.card-item.default-card {
    border-color: #ffbc0d;
    background: #fffbf0;
}

.card-info {
    margin-bottom: 12px;
}

.card-brand-logo {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-number {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.card-expiry {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.card-holder {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.default-badge {
    display: inline-block;
    background: #ffbc0d;
    color: #292929;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-set-default,
.btn-delete-card {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-set-default {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #292929;
}

.btn-set-default:hover {
    background: #e8e8e8;
}

.btn-delete-card {
    background: white;
    border: 1px solid #da291c;
    color: #da291c;
}

.btn-delete-card:hover {
    background: #ffe5e5;
}

#card-container {
    margin: 0 0 16px;
    min-height: 50px;
}

/* 決済画面「お支払い方法」：かんたん決済（Apple Pay / Google Pay）とクレジットカードの見出し・区切り */
.pay-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: #292929;
    margin-bottom: 8px;
}

.pay-note {
    font-size: 12px;
    color: #666;
    margin: 6px 0 0;
}

.pay-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: #666;
    font-size: 13px;
}

/* 保存済みカード（Card on File） */
.saved-cards {
    margin-bottom: 12px;
}

.saved-card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    cursor: pointer;
}

.saved-card-item.selected {
    border-color: #292929;
    background: #f9f9f9;
}

.saved-card-item input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.saved-card-label {
    flex: 1;
    font-size: 15px;
    color: #292929;
}

.saved-card-exp {
    display: block;
    font-size: 12px;
    color: #666;
}

.saved-card-delete {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    text-decoration: underline;
    padding: 4px;
    cursor: pointer;
}

.save-card-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #292929;
    margin: -4px 0 16px;
    cursor: pointer;
}

.save-card-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

.pay-divider span {
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.result-box {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: #ffbc0d;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #292929;
    touch-action: manipulation;
    transition: background 0.2s;
}

.auth-submit-btn:active {
    background: #e6aa0c;
}

.auth-submit-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.auth-link {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.auth-link a {
    color: #da291c;
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ユーザーアイコンボタン */
.user-icon-btn {
    background: none;
    border: none;
    color: #292929;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    touch-action: manipulation;
}

.user-icon-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

/* サイドメニュー */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffbc0d;
}

.side-menu-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #292929;
}

.side-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #292929;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    touch-action: manipulation;
}

.side-menu-close:active {
    background: rgba(0, 0, 0, 0.1);
}

.side-menu-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.user-details {
    flex: 1;
}

.user-details .user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #292929;
}

.user-details .user-email {
    font-size: 13px;
    color: #666;
}

.side-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #292929;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 8px;
    touch-action: manipulation;
}

.side-menu-item:active {
    background: #f5f5f5;
}

.side-menu-item svg {
    flex-shrink: 0;
}

/* ヘッダーユーザーアイコン */
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.header-user-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.header-user-icon-default {
    font-size: 24px;
}

/* ユーザーメニュー */
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid #ececec;
    min-width: 220px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
}

.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 12px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.user-menu-name {
    font-weight: 700;
    font-size: 15px;
    color: #292929;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #292929;
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

.user-menu-logout {
    color: #e8362f;
}

.user-menu-logout:hover {
    background: #fff5f5;
}

/* 決済方法選択（現金/クレジット） */
.payment-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-type-option {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s;
    background: white;
}

.payment-type-option:has(input:checked) {
    border-color: #ffbc0d;
    background: #fffbf0;
}

.payment-type-label {
    display: block;
    cursor: pointer;
    padding: 16px;
    text-align: center;
}

.payment-type-label input[type="radio"] {
    display: none;
}

.payment-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.payment-type-name {
    font-size: 14px;
    font-weight: 600;
    color: #292929;
    margin-bottom: 4px;
}

.payment-type-desc {
    font-size: 12px;
    color: #666;
}

/* 現金払い選択時のボタン */
.submit-payment-btn.cash-payment {
    background: #06C755;
}

.submit-payment-btn.cash-payment:active {
    background: #05b34c;
}

/* ========================================
   トッピング選択セクション
   ======================================== */

.topping-section {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* ========================================
   ごはんの量選択（専用UI）
   ======================================== */

.rice-size-group {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.rice-size-group:last-child {
    margin-bottom: 0;
}

.rice-size-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.rice-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.rice-size-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.rice-size-selected {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.rice-size-change-btn {
    background: #ffbc0d;
    color: #292929;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    touch-action: manipulation;
}

.rice-size-change-btn:active {
    transform: scale(0.95);
    background: #e5a800;
}

.rice-size-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rice-size-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.rice-size-option:active {
    transform: scale(0.98);
}

.rice-size-option.selected {
    border-color: #ffbc0d;
    background: #fff9e6;
}

.rice-size-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.rice-size-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ffbc0d;
}

.rice-size-option-label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
}

.rice-size-option-price {
    font-size: 15px;
    font-weight: bold;
    color: #292929;
    white-space: nowrap;
}

/* ========================================
   通常のトッピング選択UI
   ======================================== */

.topping-group {
    margin-bottom: 20px;
}

.topping-group:last-child {
    margin-bottom: 0;
}

.topping-group-header {
    margin-bottom: 12px;
}

.topping-group-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.topping-group-info {
    font-size: 12px;
    color: #666;
}

.topping-group-info.required {
    color: #FF6B6B;
    font-weight: 600;
}

.topping-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topping-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.topping-option:hover {
    border-color: #FF6B6B;
}

.topping-option.selected {
    border-color: #FF6B6B;
    background: #fff5f5;
}

.topping-option input[type="radio"],
.topping-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6B6B;
}

.topping-option-label {
    flex: 1;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.topping-option-price {
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.topping-option-price.free {
    color: #999;
}

.topping-option-price.paid {
    color: #4CAF50;
}

/* トッピング込み合計価格表示 */
.modal-product-price {
    position: relative;
}

.topping-total-price {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.topping-total-price .highlight {
    color: #FF6B6B;
    font-weight: bold;
}

/* カート内のトッピング表示 */
.cart-item-toppings {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.cart-topping-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.cart-topping-name {
    flex: 1;
}

.cart-topping-price {
    font-weight: 600;
    color: #4CAF50;
}

/* ===== 組み合わせ商品（選択肢）セクション ===== */
.size-section {
    margin: 16px 0;
    text-align: left;
}

.size-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.size-group-title .topping-required-badge {
    display: inline-block;
    background: #e8362f;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.size-option:hover {
    border-color: #FF6B6B;
}

.size-option.selected {
    border-color: #FF6B6B;
    background: #fff5f5;
}

.size-option.sold-out {
    opacity: 0.5;
    cursor: not-allowed;
}

.size-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-option-label {
    font-size: 14px;
    color: #333;
}

.size-option-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.size-serving-note {
    font-size: 11px;
    color: #e8362f;
    font-weight: 600;
    margin-right: 4px;
}

/* カート・受取日時の自動破棄トースト */
.storage-notice-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    max-width: 90%;
    padding: 12px 20px;
    background: #292929;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3000;
}

.storage-notice-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===== オプション（味＝塩/タレ 等）セクション =====
   客席タブレットと同じく控えめな「カスタマイズ ▼」に畳み、既定から変えた時だけ赤く目立たせる */
.option-section {
    margin: 12px 0 16px;
    text-align: left;
}
.option-group + .option-group {
    margin-top: 12px;
}
.size-group-title .topping-optional-badge {
    display: inline-block;
    background: #eee;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}
.optfold-trigger {
    /* マクドナルドアプリの「✎ カスタマイズ」風：小さな灰色のピル */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: #efefef;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}
.optfold-trigger__icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex: 0 0 auto;
}
.optfold-trigger__arrow {
    display: none;
}
.optfold-trigger.is-changed {
    background: #fdeceb;
    color: #e8362f;
}
.option-choices {
    margin-top: 8px;
}
.option-fold-head {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
