/*
====================================
 1. グローバル設定 & リセット
====================================
*/
* {
    box-sizing: border-box; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    min-height: 80vh;
}

h1 {
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

/*
====================================
 2. ヘッダー & ナビゲーション
====================================
*/header {
    background-color: #ffffff; 
    color: #333; 
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.logo {
    color: #333; 
    font-size: 2.0rem;
    font-family: 'M PLUS Rounded 1c', sans-serif; 
    font-weight: 900;
    
    /* ★★★ 修正ポイント：<a>タグ自体をFlexboxの縦並びにする ★★★ */
    display: flex;
    flex-direction: column; 
    line-height: 1; 
}

/* メインロゴテキスト（新しいクラス） */
.main-logo-text {
    /* メインのフォントサイズと太さをここに移動 */
    font-size: 2.2rem;
    font-weight: 900; 
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

/* サブロゴテキストのスタイル */
.sub-logo-text {
    /* font-size は .main-logo-text からの相対値ではないので、絶対値で設定 */
    font-size: 0.8rem; /* 1.8remの0.7倍(1.26rem)より小さく */
    font-weight: 800;
    color: #666;
    margin-top: 2px;
    font-family: sans-serif; 
}



/* ... 続くCSSコード ... */


/* ハンバーガーボタン (PC非表示) */
.hamburger {
    display: none; 
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; 
}

/* ハンバーガーアイコンの線 */
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    /* ★★★ 修正ポイント４：ハンバーガーアイコンの色を黒に変更 ★★★ */
    background-color: #333; 
    transition: all 0.3s ease;
}

/* ハンバーガーアニメーションはそのまま（線の色が変わったため自動で黒くなる） */

/* ナビゲーションメニュー本体 */
.nav-menu {
    transition: transform 0.3s ease;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.nav-menu a {
    /* ★★★ 修正ポイント５：ナビゲーション文字色を黒に変更 ★★★ */
    color: #333; 
    font-weight: 500;
    padding: 5px 0;
}

.nav-menu a:hover {
    color: #007bff; /* ホバー色を青に戻す */
}

.cart-badge {
    background-color: #dc3545;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: text-top;
}

/*
====================================
 3. ボタン & フォーム要素
====================================
*/
.btn-add-cart, .btn-checkout, .btn-continue, .btn-delete, .btn-hero-action {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    transition: background-color 0.3s, transform 0.1s;
}

/* アクセントカラー: カート追加、購入ボタン */
.btn-add-cart, .btn-checkout {
    background-color: #28a745;
    color: white;
}

.btn-add-cart:hover, .btn-checkout:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* 継続ボタン: 落ち着いた色 */
.btn-continue {
    background-color: #6c757d;
    color: white;
}

.btn-continue:hover {
    background-color: #5a6268;
}

/* 削除ボタン: 警告色 */
.btn-delete {
    background-color: #dc3545;
    color: white;
    font-size: 0.8rem;
    padding: 8px 12px;
}

.btn-delete:hover {
    background-color: #c82333;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

input[type="text"], input[type="email"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

/*
====================================
 4. index.php (商品一覧)
====================================
*/
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    transition: box-shadow 0.3s, transform 0.3s;
    height: 100%; 
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 15px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

.product-name a {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.2rem;
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: auto; 
}

/*
====================================
 5. cart.php (カートページ)
====================================
*/
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed; 
}

.cart-table th, .cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    word-break: break-word; 
}

.cart-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1.6rem;
    padding: 20px 0;
    border-top: 3px solid #007bff;
}

.cart-total-price {
    font-weight: 700;
    color: #dc3545;
    margin-left: 20px;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}


/*
====================================
 6. checkout.php (レジ)
====================================
*/
.checkout-container {
    display: flex;
    gap: 40px;
}

/* PCビュー: フォームを左側 (order: 1) */
.checkout-form {
    flex: 2;
    order: 1; 
}

/* PCビュー: 概要を右側 (order: 2) */
.checkout-summary {
    flex: 1;
    background-color: #e9f7ff;
    padding: 25px;
    border-radius: 10px;
    height: fit-content;
    border: 1px solid #b3d9ff;
    order: 2; 
}

.checkout-summary h2 {
    border-bottom: 1px solid #a8d5ff;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.4rem;
}

.required::after {
    content: " *";
    color: #dc3545;
    margin-left: 4px;
}

/*
====================================
 7. detail.php (商品詳細)
====================================
*/
.product-detail-container {
    display: flex;
    gap: 40px;
}

/* PCビュー: 画像と説明が左側 (order: 1) */
.product-image-area {
    flex: 2; 
    order: 1; 
}

/* PCビュー: 購入フォームが右側 (order: 2) */
.product-purchase-area {
    flex: 1; 
    border: 1px solid #ced4da;
    padding: 25px;
    background-color: #fcfcfc;
    border-radius: 10px;
    height: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    order: 2;
}

.product-purchase-area .btn-add-cart {
    width: 100%; 
}

.detail-product-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-price span {
    font-size: 2.2rem;
    font-weight: 700;
    color: #dc3545;
}

.product-description-box {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.quantity-select {
    width: 100px;
    display: block;
}

/* レビュー表示のスタイル */
.review-display-area {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
}

.product-rating {
    color: #ffc107;
    margin-right: 10px;
    font-size: 1.2rem;
    line-height: 1;
}

.product-rating .empty {
    color: #ccc;
}

.rating-value {
    font-weight: bold;
    margin-right: 5px;
}

.review-count {
    color: #6c757d;
    font-size: 0.9rem;
}

/*
====================================
 8. tokushoho.php (特定商取引法)
====================================
*/
.tokushoho-section {
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.tokushoho-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 10px;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.simple-table th, .simple-table td {
    border: 1px solid #e9ecef;
    padding: 12px;
    text-align: left;
    font-size: 0.95rem;
}

.simple-table th {
    background-color: #f8f9fa;
    width: 30%;
    font-weight: 600;
}

/*
====================================
 9. フッター
====================================
*/
footer .footer-links {
    margin-bottom: 10px;
}

footer .footer-links a {
    color: #adb5bd;
    text-decoration: underline;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 25px;
    margin-top: 50px;
    background-color: #343a40;
    color: white;
    font-size: 0.9rem;
}

footer a {
    color: #adb5bd;
    margin: 0 12px;
}

footer a:hover {
    color: white;
}

/*
====================================
 10. hero-image (アイキャッチ画像)
====================================
*/
.hero-image-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 12px;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
}

.hero-text h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-text p {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.btn-hero-action {
    background-color: #ffc107;
    color: #333;
    padding: 15px 35px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-hero-action:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

/*
====================================
 12. パンくずリスト (Breadcrumb)
====================================
*/
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    background-color: #e9ecef;
    font-size: 0.9rem;
    border-bottom: 1px solid #ced4da;
}

.breadcrumb {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.breadcrumb-item:not(:last-child)::after {
    content: " / ";
    margin: 0 8px;
    color: #999;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0056b3;
}

.breadcrumb-item span[aria-current="page"] {
    color: #333;
    font-weight: 600;
}


/*
====================================
 13. レスポンシブ対応 (モバイルファースト)
====================================
*/
@media (max-width: 992px) {
    /* 992px以下の画面では縦に並べる */
    .checkout-container, .product-detail-container {
        flex-direction: column;
        gap: 20px;
    }
    
    /* checkout.php のモバイル順序制御 */
    .checkout-summary {
        order: 1;
    }
    .checkout-form {
        order: 2; 
    }

    /* detail.php のモバイル順序制御 */
    .product-image-area {
        order: 1; 
    }
    .product-purchase-area {
        order: 2; 
    }
}

@media (max-width: 768px) {
    /* ヘッダー構造: ロゴとハンバーガーを左右に配置 */
    header {
        flex-direction: row; 
        align-items: center;
        height: 60px; 
    }
    
    /* ハンバーガーボタンを表示 */
    .hamburger {
        display: block; 
    }
    
    /* ナビゲーションメニューをモバイル対応 */
    .nav-menu {
        position: fixed; 
        top: 60px; 
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); 
        /* ★★★ モバイルメニューの背景色はヘッダーの色とは別で青を維持 ★★★ */
        background-color: #007bff; 
        padding-top: 10px; 
        z-index: 1000;
        transform: translateX(100%);
        visibility: hidden; 
        transition: transform 0.3s ease, visibility 0.3s ease;
        overflow-y: auto; 
    }
    
    /* JSで .active クラスが付与された時の状態 (表示) */
    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
    }
    
    /* メニューリストを縦並びにする */
    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
    }
    
    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 0;
        color: white; /* モバイルメニュー内のリンクは白を維持 */
    }

    /* レイアウト崩れ対策 */
    .main-content {
        margin: 10px;
        padding: 15px;
    }

    /* カートテーブルをモバイル対応 */
    .cart-table thead {
        display: none;
    }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }
    .cart-table tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 10px;
    }
    .cart-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
    }
    .cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    .btn-continue, .btn-checkout {
        width: 100%;
    }
    
    /* ヒーロー画像調整 */
    .hero-image-container {
        height: 200px;
        margin-bottom: 20px;
    }
    .hero-text h2 {
        font-size: 1.5rem;
    }
    .hero-text p {
        font-size: 1rem;
    }
    .btn-hero-action {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}
