/*=== リセット & ベーススタイル ===*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f7fa;
    color: #1f2937;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/*=== ヘッダー & ステップナビゲーション ===*/
.steps-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.step-item {
    display: flex;
    align-items: center;
    margin: 0.5rem;
    position: relative;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #4b5563;
    font-weight: 600;
    margin-right: 0.5rem;
    position: relative;
    z-index: 2;
}
.step-number.active {
    background-color: #2563eb;
    color: white;
}

.step-text {
    font-size: 0.875rem;
    color: #4b5563;
    display: none;
}
.step-text.active {
    color: #1f2937;
    font-weight: 500;
}

@media (min-width: 640px) {
    .step-text {
        display: block;
    }
}
@media (max-width: 640px) {
    .container{
        padding: 0;
    }
    #product-price,#print-price,#setup-cost-total,#total-price{
        width: 100%;
    }
    .position-info,.position-cost{
        width: 100%!important;
    }
    #selected-method {
        display: block;
    }
}

.step-divider {
    flex-grow: 1;
    height: 2px;
    background-color: #e5e7eb;
    margin: 0 0.5rem;
    min-width: 1rem;
}

/*=== メインコンテンツ ===*/
.panel {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 5rem;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.panel-body {
    padding: 1.5rem;
}

/*=== 商品検索 ===*/
.search-box {
    display: flex;
}
.search-input {
    flex-grow: 1;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 0.375rem 0 0 0.375rem;
    font-size: 0.875rem;
}
.search-button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 0.375rem 0.375rem 0;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-button:hover {
    background-color: #1d4ed8;
}

/*=== タブナビゲーション ===*/
.tab-navigation {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #6b7280;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.tab-button.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.tab-button:hover:not(.active) {
    color: #4b5563;
    border-bottom-color: #d1d5db;
}

/*=== カテゴリ選択 ===*/
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.category-card:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}
.category-card.active {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.category-image {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.category-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.category-name {
    font-weight: 500;
    font-size: 0.875rem;
}

/*=== サブカテゴリ選択 ===*/
#sub-category-selector {
    margin-bottom: 1.5rem;
}
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    box-sizing: border-box;
}

.style-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background-color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.style-card:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.style-card.active {
    border-color: #2563eb;
    background-color: #eff6ff;
}
.style-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    flex-grow: 1;
}
.style-image img {
    max-height: 100%;
    /*max-width: 100%;*/
    /*object-fit: contain;*/
}
.style-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #1f2937;
    padding: 0.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
    border-radius: 0 0 0.375rem 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/*=== オプション選択 ===*/
.options-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}
.option-section {
    margin-bottom: 1.5rem;
}
.option-section:last-child {
    margin-bottom: 0;
}
.option-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}
.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.option-button {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}
.option-button:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}
.option-button.active {
    border-color: #2563eb;
    background-color: #eff6ff;
    color: #2563eb;
}

/*=== 商品表示 ===*/
#back-options {
    display: none;
}

.product-display {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.product-view {
    padding-top: 1em;
    flex: 1 1 400px;
}

.view-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-buttons {
    display: flex;
    background-color: #f3f4f6;
    border-radius: 9999px;
    padding: 0.25rem;
    width: fit-content;
}
.view-button {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border: none;
    background: none;
    border-radius: 9999px;
    cursor: pointer;
}
.view-button.active {
    background-color: #2563eb;
    color: white;
}

.view-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}
.option-section {
    display: none;
}
.option-section.active {
    display: block;
}

.product-canvas-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.product-canvas {
    position: relative;
    width: 100%;
    /*padding-bottom: 133.33%;*/
     /* 3:4 aspect ratio */
    background-color: #f9fafb;
    border-radius: 0.5rem;
    overflow: hidden;
}
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
p.note {
    background: #e3ffe6;
    padding: 1em;
    border-radius: 12px;
    font-size: 0.9em;
    line-height: 2em;
}
/*=== プリント位置 ===*/
.position-thumbnail {
    position: absolute;
    border: 1px dashed #5fa7fd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index:5;
}
.position-thumbnail:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}
.position-thumbnail.added {
    border: 2px solid #007bff !important;
    background-color: rgba(0, 123, 255, 0.2) !important;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.position-thumbnail .position-label {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/*=== 選択プリント位置リスト ===*/
.selections-panel {
    padding-top: 1em;
    flex: 1 1 300px;
}

.selections-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.position-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}
.position-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}

.position-info {
    flex: 1;
    width: 65%;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
}
.position-name {
    font-weight: bold;
    margin-bottom: 4px;
}
.position-method {
    margin-bottom: 4px;
    color: #333;
}
.position-setup-cost {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}
.position-cost {
    font-weight: bold;
    color: #0056b3;
    font-size: 1.1em;
    text-align: right;
    min-width: 100px;
}

.position-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 120px;
    justify-content: flex-end;
}
.position-edit-button, .position-delete-button {
    padding: 6px 12px;
    margin-left: 5px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
    background-color: #fafafa;
    color: #666;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}
.position-edit-button:hover, .position-delete-button:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

/*=== 注文サマリー ===*/
.order-summary {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}
.summary-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}
.summary-row.total {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}
#product-price,#print-price,#setup-cost-total,#total-price{
    text-align: right;
}

/*=== ナビゲーションボタン ===*/
.navigation-buttons {
    display: flex;
    flex-wrap:wrap;
    justify-content: space-between;
    margin-top: 2rem;
}

.back-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #4b5563;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.back-button:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.next-button {
    padding: 0.75rem 1.5rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.next-button:hover {
    background-color: #1d4ed8;
}

/*=== モーダル関連 ===*/
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: auto;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background-color: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
    position: relative;
}

.modal.show {
    display: block;
}

/* 大きいモーダル用のバリエーション */
.modal.large-modal {
    max-width: 100%;
}

.modal-header {
    padding: .1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-close, .close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    font-size: 24px;
    font-weight: bold;
}

.modal-close:hover, .close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    position: sticky;
    bottom: 0;
}

/*=== プリント方法選択 ===*/
.print-method-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.print-method-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    flex: 1 0 calc(33% - 10px);
    min-width: 150px;
}
.print-method-card:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}
.print-method-card.active {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.print-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.method-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e7eb;
    border-radius: 0.375rem;
}
.method-name {
    line-height: 1.2;
    font-weight: 800;
    font-size: 0.875rem;
}
.method-name small{
    font-weight: 400;
    color: #6b7280;
}

.method-description {
    font-size: 0.75rem;
    color: #6b7280;
}
.method-price {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #2563eb;
}

/*=== オプションセクション ===*/
.option-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.option-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.option-item:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}
.option-item.active {
    border-color: #2563eb;
    background-color: #eff6ff;
}
.option-item.active::after {
    content: '✓';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.option-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    padding-right: 2rem;
}
.option-price {
    color: #2563eb;
    font-weight: 500;
    font-size: 0.875rem;
}
.option-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.1;
    gap: .1rem;
}

/*=== ヘルプおよび説明バッジ ===*/
.help-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e7eb;
    color: #4b5563;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    border-radius: 50%;
    margin-left: 0.5rem;
    cursor: help;
}
.tooltip {
    position: absolute;
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    max-width: 250px;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.help-badge:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/*=== インタラクティブガイドメッセージ ===*/
.guide-message {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
    color: #1e40af;
    font-size: 0.875rem;
}
.guide-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/*=== ボタン共通スタイル ===*/
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background-color: #2563eb;
    color: white;
    border: none;
}
.btn-primary:hover {
    background-color: #1d4ed8;
}
.btn-primary:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}
.btn-secondary {
    background-color: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.btn-secondary:hover {
    background-color: #f3f4f6;
}

/*=== トースト通知 ===*/
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem;
    background-color: #1f2937;
    color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 100;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/*=== 数量選択UI ===*/
.quantity-selector {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.quantity-selector h4 {
    width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}
.quantity-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.quantity-button {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}
.quantity-button:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}
.quantity-button.active {
    border-color: #2563eb;
    background-color: #eff6ff;
    color: #2563eb;
}

/* 直接入力欄のスタイル */
.quantity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 8px;
    display: block;
    width: 100%;
    text-align: right;
    border-top: solid 1px #ccc;
    margin-top: 1em;
    padding-top: 1em;
}


.quantity-input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 16px;
    color: #374151;
    transition: all 0.2s;
    text-align: right;
}

.quantity-input:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #eff6ff;
}

.quantity-input.active {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.quantity-input-label {
    font-size: 0.875rem;
    color: #374151;
}

/*=== 刺繍オプションなどの補足スタイル ===*/
.position-description {
    font-size: 0.85em;
    color: #555;
    margin-top: 6px;
    margin-bottom: 4px;
    line-height: 1.4;
    word-wrap: break-word;
    background-color: #f8f8f8;
    border-left: 3px solid #ddd;
    padding: 5px 8px;
    border-radius: 2px;
}
.method-price-note {
    font-size: 0.8em;
    color: #e74c3c;
    margin-top: 5px;
    padding: 4px 8px;
    background-color: #fef5f5;
    border-radius: 3px;
    border-left: 3px solid #e74c3c;
}
.note-label {
    font-weight: bold;
    color: #444;
}
.size-note{
    margin-top:.5rem;
    font-size:.75rem;
    line-height:1.4;
    color:#666;
}
#front-center{
    z-index:1;
}

/* 商品リストモーダル固有のスタイル */
.products-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
    max-height: 70vh;
    overflow-y: visible;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;  /* 間隔を縮小 */
    cursor: pointer;
    overflow: hidden;
    max-width: 320px;  /* 最大幅を設定 */
}

/* 商品画像の改善 */
.product-card img {
    width: 100%;
    aspect-ratio: 1;  /* 正方形に固定 */
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 12px;
    transition: transform 0.3s ease;
}

/* 商品情報のコンテナ */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

/* 商品名のスタイル */
.product-card h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 商品コードと価格のコンパクトな表示 */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.product-code {
    color: #888;
    font-size: 12px;
}

.base-price {
    font-weight: 600;
    color: #1a1a1a;
}

/* 色情報（値がある場合のみ表示） */
.product-colors:not(:empty) {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-top: 1px solid #f0f0f0;
}

.product-colors strong {
    font-size: 12px;
    color: #666;
}

.product-colors span {
    font-size: 12px;
    color: #333;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 価格内訳（アコーディオン形式） */
.price-details {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.price-details.open {
    max-height: 200px;  /* 十分な高さを設定 */
}

/* 1枚あたりの価格（常に表示） */
.total-price-per-piece {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.total-price-per-piece .label {
    font-size: 13px;
    color: #666;
    font-weight: normal;
}

.total-price-per-piece .value {
    color: #0066cc;
}

/* 価格詳細ボタン */
.price-details-toggle {
    width: 100%;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.price-details-toggle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.price-details-toggle.open::after {
    transform: rotate(-135deg);
}

/* 価格内訳の詳細 */
.price-breakdown {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.price-detail {
    display: flex;
    justify-content: space-between;
    color: #666;
    margin: 2px 0;
}

/* ホバーエフェクトの改善 */
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card:hover img {
    transform: scale(1.02);
}

/* モバイル対応 */
@media (max-width: 767px) {
    .product-card {
        padding: 10px;
        max-width: none;
    }
    .sort-info{
        font-weight: bold;
        text-align: center;
    }

    .product-card img {
        padding: 8px;
    }
    .subcategory-grid {
        grid-template-columns: repeat(2, 1fr);
        box-sizing: border-box;
        gap:0;
        padding:0;
    }
    .dialog-buttons button {
        text-align: center !important;
        display: inline-block;
    }
}
@media (min-width: 300px) and (max-width: 380px) {
    .category-grid{
        grid-template-columns: repeat(2, 1fr);
    }
    .print-method-grid{
        gap: 0.5rem;
    }
    .print-method-card {
        min-width: 100px;
    }
    .print-method-header{
        flex-wrap: wrap;
    }
    .method-icon{
        width: 100%;
    }
    .modal-body{
        padding:0.5em;
    }
    .category-card{
        min-width: 130px !important;
    }
    .btn-secondary{
        padding:0.8em 0!important;
    }
    .style-card{
        min-width: 130px !important;
    }
}
.color-filter-chip{
    width: 40%;
}
.detail-backdrop{position:fixed;inset:0;display:flex;justify-content:center;
    align-items:center;background:rgba(0,0,0,.45);z-index:1060;}
  .detail-modal{background:#fff;border-radius:8px;width:90%;max-width:820px;
    max-height:90%;overflow:auto;box-shadow:0 4px 14px rgba(0,0,0,.35);}

  .product-basic img{
      width:100px;
  }

  table.size-table {
    width: 100%;
}
.clear-storage-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #4b5563;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-storage-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.toast-message {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}