/**
 * 商品詳細ページ用スタイル
 *
 *css/product-detail.css
 * @package Ezodeer_Shop
 */

/* ==========================================================================
   基本レイアウト
   ========================================================================== */
   .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* パンくずリスト */
.breadcrumb {
    padding: 20px 0;
    font-size: 1.4rem;
    color: #666;
}

.breadcrumb a {
    color: #8B4513;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #A0522D;
    text-decoration: underline;
}

/* ==========================================================================
   商品詳細メインセクション
   ========================================================================== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

/* ==========================================================================
   画像セクション
   ========================================================================== */
.product-images {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.main-image {
    margin-bottom: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 売り切れオーバーレイ */
.soldout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.soldout-badge {
    background: #d63638;
    color: white;
    padding: 15px 60px;
    font-size: 2.4rem;
    font-weight: bold;
    transform: rotate(-25deg);
    letter-spacing: 0.1em;
    box-shadow: 0 4px 15px rgba(214, 54, 56, 0.4);
    border: 3px solid white;
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.image-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.image-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.image-thumbnails::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail.active {
    border-color: #8B4513;
    transform: scale(1.05);
}

.thumbnail:hover {
    border-color: #8B4513;
}

.no-image {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    position: relative;
}

/* ==========================================================================
   商品情報セクション
   ========================================================================== */
.product-info {
    padding-top: 10px;
}

.product-title {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

/* カテゴリタグ */
.product-categories {
    margin-bottom: 20px;
}

.category-tag {
    display: inline-block;
    padding: 5px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 1.3rem;
    margin-right: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: #e0e0e0;
}

/* 商品説明 */
.product-description {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #555;
}

.product-description p {
    margin-bottom: 15px;
}

/* 重量情報 */
.weight-info {
    background: #f8f8f8;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 1.5rem;
    border-left: 4px solid #8B4513;
}

.weight-info .icon {
    margin-right: 8px;
}

/* ==========================================================================
   購入セクション
   ========================================================================== */
.purchase-section {
    background: #fff;
    border: 2px solid #8B4513;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
}

/* 価格表示 */
.price-section {
    margin-bottom: 30px;
}

.price-display {
    margin-bottom: 15px;
}

.price-display .price {
    font-size: 3.2rem;
    color: #8B4513;
    font-weight: bold;
}

.price-display .tax-info {
    font-size: 1.6rem;
    color: #666;
    font-weight: normal;
    margin-left: 10px;
}

.price-per-100g {
    display: block;
    font-size: 1.4rem;
    color: #666;
    margin-top: 5px;
}

/* ポイント表示 */
.point-info {
    background: #fef8e8;
    border: 1px solid #f0d9a7;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 1.4rem;
    color: #8B4513;
    display: inline-block;
}

.point-info .point-icon {
    margin-right: 5px;
    color: #ff9800;
}

.point-info .point-value {
    font-weight: bold;
    font-size: 1.6rem;
    margin-left: 5px;
}



.gram-selector label {
    font-weight: bold;
    margin-right: 10px;
}

.gram-select {
    padding: 10px 15px;
    font-size: 1.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.gram-select:hover,
.gram-select:focus {
    border-color: #8B4513;
    outline: none;
}

/* 数量選択 */
.quantity-selector {
    margin-top: 20px;
}

.quantity-selector label {
    font-weight: bold;
    margin-right: 10px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    background: #f5f5f5;
    border: none;
    padding: 10px 15px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: none;
    font-size: 1.6rem;
    padding: 10px 5px;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==========================================================================
   商品オプション
   ========================================================================== */
.product-options {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.option-group {
    margin-bottom: 25px;
}

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

.option-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    width: 100%;
}

.option-item:hover {
    border-color: #8B4513;
    background: #fff8f0;
}

.option-item input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.option-item input[type="radio"]:checked {
    accent-color: #8B4513;
}

.option-item input[type="radio"]:checked + .option-content .option-label {
    font-weight: bold;
    color: #8B4513;
}

.option-item:has(input[type="radio"]:checked) {
    border-color: #8B4513;
    background: #fff8f0;
    box-shadow: 0 0 0 1px #8B4513 inset;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
}

.option-value {
    font-size: 1.4rem;
    color: #666;
}

.price-adjust {
    font-size: 1.4rem;
    color: #8B4513;
    font-weight: bold;
    margin-left: auto;
    padding-left: 10px;
    white-space: nowrap;
}

/* 価格調整表示 */
.price-adjustment-display {
    background: #fff8f0;
    border: 1px solid #8B4513;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.adjustment-info,
.total-price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.total-price-info {
    margin-bottom: 0;
    font-weight: bold;
    font-size: 1.8rem;
    color: #8B4513;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

#option-price-display {
    color: #8B4513;
    font-weight: bold;
}

#total-price-display {
    font-size: 2.4rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .option-item {
        padding: 12px 15px;
    }
    
    .option-label {
        font-size: 1.5rem;
    }
    
    .option-value {
        font-size: 1.3rem;
    }
    
    .price-adjust {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   カートアクション
   ========================================================================== */
.cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
}

.stock-info {
    font-size: 1.4rem;
}

.in-stock {
    color: #4CAF50;
    font-weight: bold;
}

.out-of-stock {
    color: #f44336;
    font-weight: bold;
}

.add-to-cart-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.6rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.add-to-cart-btn:hover:not(.disabled) {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.add-to-cart-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.add-to-cart-btn.disabled:hover {
    box-shadow: none;
    transform: none;
    background: #ccc;
}

.cart-icon {
    font-size: 2rem;
}

/* 販売開始情報 */
.sale-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    font-size: 1.4rem;
    border-left: 4px solid #ffc107;
}

/* ==========================================================================
   メタ情報
   ========================================================================== */
.product-meta {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.meta-item {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.meta-item .label {
    color: #666;
    margin-right: 10px;
    font-weight: bold;
}

/* ==========================================================================
   詳細情報タブ
   ========================================================================== */
.product-details-section {
    margin-bottom: 60px;
}

.detail-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1.6rem;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #8B4513;
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #8B4513;
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.nutritional-content,
.cooking-content,
.thawing-content {
    font-size: 1.5rem;
    line-height: 1.8;
    color: #555;
}

/* ==========================================================================
   関連商品
   ========================================================================== */
.related-products {
    margin-bottom: 60px;
}

.related-products h2 {
    font-size: 2.4rem;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

/* ==========================================================================
   デバッグ情報（開発環境用）
   ========================================================================== */
.debug-info {
    background: #f0f0f0;
    padding: 20px;
    margin: 20px 0;
    border: 2px dashed #999;
    border-radius: 8px;
}

.debug-info h3 {
    color: #333;
    margin-bottom: 15px;
}

.debug-info pre {
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 1.2rem;
}

.debug-info table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    margin-top: 10px;
}

.debug-info th,
.debug-info td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 1.3rem;
}

.debug-info th {
    background: #f5f5f5;
    font-weight: bold;
}

/* ==========================================================================
   アニメーション
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-images {
        position: static;
    }
    
    .product-title {
        font-size: 2.2rem;
    }
    
    .price-display .price {
        font-size: 2.4rem;
    }
    
    .purchase-section {
        padding: 20px;
    }
    
    .option-list {
        flex-direction: column;
    }
    
    .option-item {
        width: 100%;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 20px;
    }
    
    .add-to-cart-btn {
        width: 100%;
        justify-content: center;
    }
    
    .detail-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 10px 20px;
        font-size: 1.4rem;
    }
    
    .quantity-control {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .soldout-badge {
        font-size: 1.8rem;
        padding: 10px 40px;
    }
}