/* ========================================
   tools.syokunin-network.com
   職人の道具ショップ CSS
   ======================================== */

/* --- リセット・基本 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:   #2c5282;   /* 深い青（信頼・職人気質） */
    --color-accent:    #c05621;   /* 鉄錆オレンジ（工具・金属感） */
    --color-dark:      #1a202c;
    --color-gray:      #4a5568;
    --color-light:     #f7fafc;
    --color-border:    #e2e8f0;
    --color-white:     #ffffff;
    --font-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    --radius: 6px;
    --shadow: 0 2px 8px rgba(0,0,0,0.10);
    --shadow-hover: 0 6px 20px rgba(0,0,0,0.15);
}

body {
    font-family: var(--font-base);
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-dark);
    background: var(--color-light);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- ヘッダー --- */
.site-header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 12px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.site-header .inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-white);
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.03em;
}
.site-header .logo img { height: 31px; width: auto; }
.site-header nav a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-left: 16px;
}
.site-header nav a:hover { color: #fff; text-decoration: none; }

/* --- パンくず --- */
.breadcrumb {
    max-width: 1100px;
    margin: 10px auto 0;
    padding: 0 16px;
    font-size: 13px;
    color: var(--color-gray);
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.breadcrumb li + li::before { content: '›'; margin-right: 4px; }
.breadcrumb a { color: var(--color-gray); }

/* --- メインコンテナ --- */
.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
}

/* --- セクションタイトル --- */
.section-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary);
    border-left: 4px solid var(--color-accent);
    padding-left: 12px;
    margin-bottom: 20px;
}

/* --- 商品カード一覧 --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.product-card a { color: inherit; text-decoration: none; }

.product-card .card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: #eee;
}
.product-card .card-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 13px;
}

.product-card .card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.product-card .card-category {
    font-size: 11px;
    color: var(--color-accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-card .card-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--color-dark);
    line-height: 1.4;
}
.product-card .card-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-accent);
    margin-top: auto;
}
.product-card .card-price span {
    font-size: 12px;
    color: var(--color-gray);
    font-weight: normal;
}

/* --- カテゴリバッジ --- */
.badge-category {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* --- 商品詳細ページ --- */
.item-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}
@media (max-width: 768px) {
    .item-layout { grid-template-columns: 1fr; gap: 24px; }
}

/* 画像スライダー */
.slider-wrap { position: relative; }
.slider-main {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    background: #eee;
    cursor: zoom-in;
}
.slider-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.slider-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, border-color 0.2s;
}
.slider-thumb.active, .slider-thumb:hover {
    border-color: var(--color-primary);
    opacity: 1;
}

/* 商品情報 */
.item-info { display: flex; flex-direction: column; gap: 16px; }
.item-category { font-size: 12px; color: var(--color-accent); font-weight: bold; }
.item-title { font-size: 22px; font-weight: bold; line-height: 1.4; }
.item-price-box {
    background: var(--color-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
}
.item-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--color-accent);
}
.item-price-note { font-size: 13px; color: var(--color-gray); margin-top: 4px; }

.btn-buy {
    display: block;
    width: 100%;
    background: var(--color-accent);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}
.btn-buy:hover { background: #9c4318; color: #fff; text-decoration: none; }
.btn-buy:disabled { background: #a0aec0; cursor: not-allowed; }

/* 商品説明・ストーリー */
.item-desc {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    line-height: 1.9;
}
.item-desc h2 {
    font-size: 17px;
    font-weight: bold;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* --- コメント --- */
.comments-section {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.comment-item {
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--color-gray); margin-bottom: 6px; }
.comment-stars { color: #f6ad55; font-size: 16px; }

.comment-form { margin-top: 20px; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-base);
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.comment-form textarea:focus, .comment-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.comment-form textarea { rows: 5; resize: vertical; min-height: 100px; }

/* --- ボタン共通 --- */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    text-align: center;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #2a4a7f; color: #fff; text-decoration: none; }
.btn-secondary { background: var(--color-gray); color: #fff; }
.btn-secondary:hover { background: #2d3748; color: #fff; text-decoration: none; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; color: #fff; text-decoration: none; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* --- 管理ページ --- */
.admin-wrap {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 16px;
}
.admin-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.admin-card h2 {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: var(--color-gray);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-base);
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(44,82,130,0.1);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { background: #fff; }

/* 画像アップロードエリア */
.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: var(--color-gray);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--color-primary);
    background: rgba(44,82,130,0.04);
}
.upload-area input[type="file"] { display: none; }
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.upload-preview-item {
    position: relative;
    width: 100px;
    height: 80px;
}
.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.upload-preview-item .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 商品一覧テーブル（管理） */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    background: var(--color-light);
    padding: 10px 12px;
    text-align: left;
    font-weight: bold;
    color: var(--color-gray);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.admin-table tr:hover td { background: #f7fafc; }
.admin-table img { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; }

/* アラート */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #c6f6d5; color: #276749; border-left: 4px solid #38a169; }
.alert-danger  { background: #fed7d7; color: #9b2c2c; border-left: 4px solid #e53e3e; }
.alert-info    { background: #bee3f8; color: #2c5282; border-left: 4px solid #3182ce; }

/* --- フッター --- */
.site-footer {
    background: var(--color-dark);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 24px 16px;
    margin-top: 60px;
    font-size: 13px;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }

/* --- レスポンシブ --- */
@media (max-width: 600px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .item-title { font-size: 18px; }
    .item-price { font-size: 22px; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 8px; }
}
@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr; }
}