/* 同人ポータル フロントエンドCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.site-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 15px 0;
    margin-bottom: 30px;
}

.site-header .container {
    display: block;
}

.site-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    width: 100%;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    width: 100%;
}

.site-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.site-nav a:hover,
.site-nav a.active {
    color: #fff;
}

/* モバイル対応 - ヘッダー */
@media (max-width: 768px) {
    .site-header .container {
        text-align: center;
    }
    .site-nav {
        justify-content: center;
    }
}

/* メインレイアウト */
.main-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.main-content {
    min-width: 0;
}

/* フィルター表示 */
.current-filter {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.clear-filter {
    margin-left: 10px;
    color: #e74c3c;
    font-size: 0.9rem;
}

/* 作品グリッド */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-thumbnail {
    position: relative;
    padding-top: 140%;
    background: #eee;
}

.product-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.view-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.product-title {
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    max-height: 3.5em;
    overflow: hidden;
}

.product-meta {
    padding: 0 12px 12px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.product-meta .price {
    color: #e74c3c;
    font-weight: bold;
}

.product-meta .maker {
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* サイドバー */
.sidebar {
    min-width: 0;
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.widget h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: block;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.category-list a:hover,
.category-list a.active {
    background: #667eea;
    color: #fff;
}

.sort-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    background: #f0f0f0;
    border: none;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn.active {
    background: #667eea;
    color: #fff;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* サイドバー人気タグ - デフォルトは灰色 */
.tag-cloud .tag {
    display: inline-block;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

/* ホバー時と選択中のみ青 */
.tag-cloud .tag:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.tag-cloud .tag.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* 汎用タグ（後方互換） */
.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover,
.tag.active {
    background: #667eea;
    color: #fff;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
}

.page-info {
    color: #666;
}

/* パンくず */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
}

/* データなし */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    color: #666;
}

/* 作品詳細ページ */
.product-detail {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

.product-main-image {
    position: sticky;
    top: 20px;
}

.product-main-image img {
    width: 100%;
    border-radius: 8px;
}

.product-info h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.8rem;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-maker {
    color: #666;
    margin-bottom: 20px;
}

.product-stats {
    color: #666;
    margin-bottom: 20px;
}

.buy-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.buy-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

.product-description {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.product-description h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.sample-section {
    margin-top: 30px;
}

.sample-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.sample-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.sample-gallery img {
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.sample-gallery img:hover {
    transform: scale(1.05);
}

.product-tags {
    margin-top: 20px;
}

.product-tags .tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    margin: 3px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

.product-tags .tag:hover {
    background: #e0e0e0;
}

.related-section {
    margin-top: 50px;
}

.related-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.related-card {
    text-decoration: none;
    color: inherit;
}

.related-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.related-card .title {
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.4;
}

.related-card:hover .title {
    color: #667eea;
}

/* フッター */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 25px;
    margin-bottom: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-copyright {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .site-nav a {
        margin: 0 10px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sidebar {
        order: 1;
    }

    /* 作品詳細ページ レスポンシブ */
    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-main-image {
        position: static;
    }

    .product-info h1 {
        font-size: 1.2rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .buy-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    .sample-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .related-card img {
        height: 180px;
    }
}

/* ===================================
   ショッピングサイト風テーマ
   =================================== */

/* 商品カード - ECサイト風 */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #ff6b6b;
}

.product-card .card-image {
    position: relative;
    background: #f8f8f8;
}

.product-card .card-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 10px;
}

/* 商品バッジ */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4757;
    color: #fff;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
}

.product-badge.new {
    background: #2ed573;
}

.product-badge.sale {
    background: #ff4757;
}

.product-badge.popular {
    background: #ffa502;
}

/* カートボタン風 */
.add-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.add-cart-btn:hover {
    background: linear-gradient(135deg, #ff4757 0%, #ff3344 100%);
    transform: scale(1.02);
}

.add-cart-btn svg {
    width: 18px;
    height: 18px;
}

/* 価格表示 - ECサイト風 */
.price-tag {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff4757;
}

.price-original {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}

.price-discount {
    background: #ff4757;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* 商品スペック表 */
.product-specs {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.spec-row {
    display: flex;
    border-bottom: 1px dashed #ddd;
    padding: 10px 0;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    width: 120px;
    color: #666;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.spec-value {
    flex: 1;
    font-weight: 500;
}

/* レビュー星表示 */
.star-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: #ffc107;
    letter-spacing: 2px;
}

.rating-count {
    color: #666;
    font-size: 0.85rem;
}

/* 在庫表示 */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.stock-status.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.stock-status.low-stock {
    background: #fff3e0;
    color: #e65100;
}

.stock-status.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* 配送情報バナー */
.shipping-banner {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* カテゴリタブ - ECサイト風 */
.category-tabs {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.category-tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.category-tab:hover {
    background: #f8f8f8;
    color: #ff4757;
}

.category-tab.active {
    background: #fff;
    color: #ff4757;
    border-bottom-color: #ff4757;
    font-weight: 600;
}

/* グリッド - 物販向け */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* プロモーションバナー */
.promo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.promo-banner h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.promo-banner p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.promo-btn {
    display: inline-block;
    background: #fff;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s;
}

.promo-btn:hover {
    transform: scale(1.05);
    text-decoration: none;
}

/* フィルターサイドバー - 物販向け */
.filter-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.filter-title {
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff4757;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    accent-color: #ff4757;
}

.filter-count {
    margin-left: auto;
    color: #999;
    font-size: 0.85rem;
}

/* 価格スライダー */
.price-range {
    margin: 15px 0;
}

.price-range input[type="range"] {
    width: 100%;
    accent-color: #ff4757;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}
