@charset "utf-8";
/* CSS Document */

/* 基本的なスタイルリセット */
body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f9f9f9;
    color: #333;
}

/* ヘッダー */
header {
    background-color: #fff;
    padding: 1em;
    text-align: center;
    border-bottom: 1px solid #eee;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

/* メインコンテンツ */
main {
    padding: 1em;
}

main h2 {
    text-align: center;
    margin-bottom: 1.5em;
}

/* --- モバイルファーストのスタイル --- */

/* 商品グリッド（スマホでは縦1列） */
.product-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1列表示 */
    gap: 1.5em; /* カード間の余白 */
}

/* 商品カード */
.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden; /* 角丸を画像にも適用 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px); /* マウスを乗せると少し浮き上がる */
}

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

.product-card img {
    width: 100%;
    height: auto;
    display: block;
}

.product-info {
    padding: 1em;
}

.product-name {
    font-weight: bold;
    margin: 0 0 0.5em 0;
}

.product-price {
    color: #e60012;
    margin: 0;
}

/* フッターとカートボタン */
footer {
    text-align: center;
    padding: 2em 1em;
}

.cart-button {
    display: inline-block;
    background-color: #ff9900;
    color: #fff;
    padding: 0.8em 2em;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}


/* --- レスポンシブ対応（メディアクエリ） --- */

/* 画面幅が600px以上（タブレットなど）の場合 */
@media (min-width: 600px) {
    .product-grid {
        /* 2列表示に変更 */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 画面幅が960px以上（PCなど）の場合 */
@media (min-width: 960px) {
    .product-grid {
        /* 3列表示に変更 */
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 画面幅が1200px以上の場合 */
@media (min-width: 1200px) {
    .product-grid {
        /* 4列表示に変更 */
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- 商品詳細ページ --- */
.product-detail-container {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.product-detail-image {
    text-align: center;
    margin-bottom: 1.5em;
}

.product-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-detail-info .product-code {
    font-size: 0.9em;
    color: #666;
}

.product-detail-info .product-name {
    font-size: 1.8em;
    margin: 0.2em 0;
    font-weight: bold;
}

.product-detail-info .product-price {
    font-size: 1.5em;
    color: #e60012;
    font-weight: bold;
    margin-bottom: 1.5em;
}

.product-detail-info form {
    margin-top: 1.5em;
}

.product-detail-info form label {
    font-weight: bold;
    margin-right: 0.5em;
}

.product-detail-info form select {
    padding: 0.5em;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-right: 1em;
}

.cart-in-button {
    background-color: #e60012; /* 目立つ赤色 */
    color: #fff;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
    transition: opacity 0.2s;
}
.cart-in-button:hover {
    opacity: 0.8;
}

.back-button-container {
    text-align: center;
    margin-top: 2em;
}

.back-button {
    display: inline-block;
    background-color: #666;
    color: #fff;
    padding: 0.8em 2em;
    border-radius: 5px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.back-button:hover {
    opacity: 0.8;
}


/* --- レスポンシブ対応 (商品詳細ページ) --- */
/* 画面幅が768px以上（タブレットなど）の場合 */
@media (min-width: 768px) {
    .product-detail-container {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2列表示 */
        gap: 2em; /* 画像と情報の間の余白 */
        align-items: flex-start;
    }

    .product-detail-image {
        margin-bottom: 0;
    }
}

/* --- カート追加完了ページなど --- */
.message-container {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message-container p {
    font-size: 1.2em;
    margin: 0;
}

.link-container {
    text-align: center;
    margin-top: 2em;
    display: flex;
    flex-direction: column; /* スマホでは縦に並べる */
    gap: 1em;
    align-items: center;
}

/* 画面が広いとき(600px以上)は横並びにする */
@media (min-width: 600px) {
    .link-container {
        flex-direction: row; /* 横並びにする */
        justify-content: center;
    }
}

/* --- カートの中身ページ --- */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1.5em; /* 各商品の間の余白 */
}

.cart-item {
    background-color: #fff;
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap; /* スマホで折り返す */
    align-items: center;
    gap: 1em;
}

.cart-item-image img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover; /* 画像が引き伸ばされないようにする */
}

.cart-item-details {
    flex-grow: 1; /* 残りのスペースを埋める */
}

.cart-item-name {
    font-weight: bold;
    margin: 0 0 0.2em 0;
}
.cart-item-price {
    margin: 0;
    color: #333;
}

.cart-item-actions {
    display: flex;
    flex-direction: column; /* 縦に並べる */
    align-items: flex-end; /* 右揃えにする */
    gap: 0.5em;
}

.cart-item-actions input[type="number"] {
    width: 60px;
    padding: 0.5em;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cart-item-subtotal {
    margin: 0;
    font-weight: bold;
}

.cart-item-delete {
    font-size: 0.9em;
    color: #666;
    cursor: pointer;
}

/* カートの合計とボタン */
.cart-summary {
    margin-top: 2em;
    padding: 1.5em;
    background-color: #fff;
    border-radius: 8px;
    border-top: 3px solid #ff9900;
}

.cart-total {
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 1em 0;
}
.cart-total span {
    font-size: 1.5em;
    color: #e60012;
}

.cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.update-button, .checkout-button {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 1em;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.update-button {
    background-color: #ccc;
    color: #333;
}

.checkout-button {
    background-color: #e60012;
    color: #fff;
}

/* PC表示用の調整 */
@media (min-width: 768px) {
    .cart-item {
        flex-wrap: nowrap; /* PCでは折り返さない */
    }
    .cart-item-actions {
        flex-direction: row; /* 横に並べる */
        align-items: center;
    }
    .cart-buttons {
        flex-direction: row-reverse; /* ボタンを右から並べる */
        justify-content: flex-start;
    }
}
/* --- 確認ページ --- */
.error-container, .confirmation-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.error-container {
    border-left: 5px solid #e60012; /* エラーであることが分かりやすいように左に赤線 */
}

.error-container p {
    font-weight: bold;
    margin-bottom: 1em;
}

.error-container ul {
    list-style-type: '✕ '; /* 絵文字などでエラーを示す */
    padding-left: 1.2em;
    color: #c00;
}
.error-container li {
    margin-bottom: 0.8em;
}
.error-container .form-buttons {
    justify-content: center; /* ボタンを中央に配置 */
}

.confirmation-list {
    margin: 2em 0;
}
.confirmation-list dt {
    font-weight: bold;
    color: #666;
    margin-bottom: 0.3em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}
.confirmation-list dt:first-of-type {
    border-top: none;
    padding-top: 0;
}
.confirmation-list dd {
    margin-left: 0;
    margin-bottom: 1em;
    font-size: 1.1em;
    word-break: break-all; /* 長い文字列がはみ出さないように改行 */
}

/* --- 注文完了ページ --- */
.thank-you-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
}

.thank-you-container h2 {
    color: #ff9900;
    margin-top: 0;
}

.customer-name {
    font-size: 1.2em;
    font-weight: bold;
    margin: 1.5em 0;
}

.shipping-info {
    margin: 2em 0;
    padding: 1.5em;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    text-align: left;
}

.shipping-info p {
    margin: 0;
    line-height: 1.6;
}

.shipping-info .address {
    margin-top: 0.5em;
    font-weight: bold;
}

/* --- カート合計表示の調整 --- */ .cart-total-details { margin-bottom: 1.5em; } .cart-total-details p { display: flex; justify-content: space-between; margin: 0.8em 0; font-size: 1.1em; } .cart-grand-total-row { font-weight: bold; font-size: 1.3em !important; padding-top: 1em; border-top: 2px solid #eee; margin-top: 1em !important; } .cart-grand-total-row span:last-child { font-size: 1.3em; color: #e60012; }

/* --- 支払い方法選択 --- */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}
.payment-option {
    display: block;
    background-color: #f9f9f9;
    padding: 1em;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
}
.payment-option input {
    margin-right: 0.5em;
}

/* --- 確認画面の合計表示 --- */
.confirmation-summary {
    margin-top: 2em;
    padding: 1.5em;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.cart-cod-row {
    color: #333;
}
/* --- 商品詳細ページの説明文 --- */
.product-description {
    margin: 1.5em 0;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
    line-height: 1.7;
    color: #333;
}

/* --- ログイン関連のスタイル --- */
.login-container {
    max-width: 800px;
    margin: 2em auto;
    display: grid;
    gap: 2em;
}

.login-info-box, .login-form-box {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.login-message {
    text-align: right;
    margin: -0.5em 1em 0 0;
    color: #666;
}

.view-only-button {
    display: block;
    text-align: center;
    background-color: #666;
    color: #fff;
    padding: 1em;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1.5em;
}

.notice-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 1em;
    border-radius: 5px;
    margin: 0 auto 1.5em auto;
    text-align: center;
    max-width: 600px;
}
.login-prompt-button {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 0.5em 1.5em;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 0.5em;
}

/* PC表示用の調整 */
@media (min-width: 768px) {
    .login-container {
        grid-template-columns: 1fr 1fr;
    }
}
/* --- ヘッダーのリンク --- */
.header-link {
    font-size: 0.8em;
    font-weight: normal;
    margin-left: 1em;
    text-decoration: none;
    color: #007bff;
}
.header-link:hover {
    text-decoration: underline;
}

/* --- 質問欄のテキストエリア --- */
.customer-form textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit; /* 他のフォーム要素とフォントを合わせる */
    font-size: 1em;
    line-height: 1.6;
}