﻿/**
 * Product Styles - 商品ページ用CSS
 * Path: wp-content/themes/swell_child/css/product-styles.css
 */

/* ========================================
   商品ページ用スタイル
   ======================================== */

.product-specs,
.general-info,
.product-remarks {
    margin-left: 20px !important;
    margin-right: 20px !important;
    margin-bottom: 2rem !important;
}

.product-specs .specs-list {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    align-items: baseline;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-specs .specs-list dt {
    font-weight: bold;
    color: #333;
    margin: 0;
    grid-column: 1;
}

.product-specs .specs-list dt:after {
    content: ":";
}

.product-specs .specs-list dd {
    margin: 0;
    grid-column: 2;
    color: #555;
}

.product-specs h3,
.general-info h3,
.product-remarks h4 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.product-specs h3:before {
    content: "■ ";
    color: #007cba;
    margin-right: 0.5rem;
}

.general-info h3:before {
    content: "● ";
    color: #28a745;
    margin-right: 0.5rem;
}

.product-remarks h4:before {
    content: "▲ ";
    color: #dc3545;
    margin-right: 0.5rem;
}

.product-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #333 !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5rem !important;
}

.product-description {
    margin-bottom: 2.5rem !important;
}

.shopify-buy__btn,
.cart-button,
[id*="cart"] button,
[class*="cart"] button {
    background: #007cba !important;
    transition: background-color 0.2s ease !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

.shopify-buy__btn:hover,
.cart-button:hover,
[id*="cart"] button:hover,
[class*="cart"] button:hover {
    background: #005a8c !important;
}

.variations-section table td:nth-child(3) strong,
.variations-section table .price-value,
.variations-table td:nth-child(3) strong,
table td strong.price-value {
    color: #333 !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
}

/* ========================================
   共通商品カード用スタイル
   ======================================== */

.product-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.common-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    height: 100%;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card-image-placeholder {
    background: #f0f0f0;
    color: #999;
}

.card-content {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.card-title {
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
}

.card-description {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #666;
    flex: 1;
}

.card-price {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #007cba;
}

.card-categories {
    margin: 0 0 1rem 0;
}

.category-badge {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.cta-text {
    display: inline-block;
    padding: 0.6rem 1rem;
    background: #007cba;
    color: white;
    border: 2px solid #007cba;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.card-link:hover .cta-text {
    background: white;
    color: #007cba;
    border: 2px solid #007cba;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

@media (max-width: 768px) {
    .product-title {
        font-size: 28px !important;
    }
    
    .variations-section table td:nth-child(3) strong,
    .variations-section table .price-value {
        font-size: 1rem !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 24px !important;
    }
    
    .variations-section table td:nth-child(3) strong,
    .variations-section table .price-value {
        font-size: 0.95rem !important;
    }
    
    .product-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   商品一覧ページ用スタイル（追加）
   ======================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    justify-content: flex-start;
}

.products-grid .product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    height: 100%;
}

.products-grid .product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.products-grid .product-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.products-grid .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.products-grid .product-content {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.products-grid .product-title {
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
}

.products-grid .product-price {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #007cba;
    flex: 1;
}

.products-grid .cta-button {
    display: inline-block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: #007cba;
    color: white;
    border: 2px solid #007cba;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.products-grid .product-card:hover .cta-button {
    background: white;
    color: #007cba;
    border: 2px solid #007cba;
}

/* レスポンシブ対応（商品一覧） */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
/* ========================================
   ② 商品詳細ページ内のカテゴリリンクフォントサイズ修正（強力版）
   ======================================== */

/* 超強力なセレクターでインラインスタイルを上書き */
* a[style*="font-size: 0.95rem"] {
    font-size: 1.1rem !important;
}

/* 商品詳細ページ内の全てのリンクで境界線があるものを対象 */
.single-product a[style*="border-bottom"],
body.single-product a[style*="border-bottom"],
html body.single-product a[style*="border-bottom"] {
    font-size: 1.1rem !important;
}

/* カテゴリリンクを含むdivを対象 */
.single-product div[style*="background: #f8f9fa"] a,
body.single-product div[style*="background: #f8f9fa"] a {
    font-size: 1.1rem !important;
}

/* pタグ内のaタグでスタイル属性があるもの */
.single-product p a[style],
body.single-product p a[style],
html body.single-product p a[style] {
    font-size: 1.1rem !important;
}

/* 最終手段：全ての商品詳細ページのリンク */
body.single-product .l-main a[style*="font-weight: bold"] {
    font-size: 1.1rem !important;
}

/* デバッグ用：確認できるよう背景色を一時的に変更 */
body.single-product a[style*="border-bottom"] {
    background-color: yellow !important;
    font-size: 1.1rem !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    * a[style*="font-size: 0.95rem"],
    body.single-product a[style*="border-bottom"] {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    * a[style*="font-size: 0.95rem"],
    body.single-product a[style*="border-bottom"] {
        font-size: 0.95rem !important;
    }
}
}

/* ========================================
   ① バリエーション表フォントサイズ統一（完全上書き版）
   ======================================== */

/* より具体的なセレクターで完全上書き */
body .variations-section table td:nth-child(1),
body .variations-section table td:nth-child(2), 
body .variations-section table td:nth-child(3),
body .variations-section table td:nth-child(4),
body .variations-section table td:nth-child(5),
body .variations-table td:nth-child(1),
body .variations-table td:nth-child(2),
body .variations-table td:nth-child(3),
body .variations-table td:nth-child(4),
body .variations-table td:nth-child(5) {
    font-size: 16px !important;
    font-weight: normal !important;
    color: inherit !important;
}

/* 価格関連の全てのセレクターを上書き */
body .variations-section table td:nth-child(3) strong,
body .variations-section table .price-value,
body .variations-table td:nth-child(3) strong,
body table td strong.price-value,
body .variations-table .price-value,
body .variations-table td .price-value {
    color: inherit !important;
    font-size: 16px !important;
    font-weight: normal !important;
}

/* 商品名関連の全てのセレクターを上書き */
body .variations-table td:nth-child(1) strong,
body .variations-table td:nth-child(1),
body .variations-section table td:nth-child(1) strong {
    font-weight: normal !important;
    font-size: 16px !important;
}

/* ヘッダーのスタイル */
body .variations-table th {
    font-size: 16px !important;
    font-weight: 600 !important;
}