/*
Theme Name:		Welcart Basic Child
Description:	Welcart Basic Child is child theme for Welcart Basic.
Author:			Welcart Inc.
Author URI:		https://www.welcart.com/
Template:		welcart_basic
Version:		1.0.0
License:		GNU General Public License v2 or later
License URI:	http://www.gnu.org/licenses/gpl-2.0.html
Tags:			responsive-layout, basic-child, two-columns, right-sidebar. left-sidebar
*/

/* --- トップページの不要なカラムを非表示 --- */
/*
  Welcart Basicテーマの3カラム用レイアウト要素(.columnleft, .columncenter)が
  トップページで干渉しないように非表示にします。
*/
.home .columnleft,
.home .columncenter {
	display: none;
}
/* --- トップページを2カラムにするためのCSS --- */

/* 
  トップページ(.home)のメインエリア(#main)をFlexboxでレイアウトします。
  Welcart Basicテーマでは、メインコンテンツとサイドバーは #main の中にあります。
*/
.home #main {
  display: flex;
  flex-direction: row-reverse; /* HTMLの記述順と逆に要素を並べ、サイドバーを左に配置します */
}

/* 
  左カラムとなるサイドバー(.columnright)のスタイルです。
  元のテーマのスタイルを上書きし、Flexboxアイテムとして振る舞うように設定します。
*/
.home .columnright {
  width: 239px !important;
  flex-shrink: 0; /* コンテナが狭くなってもこの要素は縮まないようにします */
  margin-right: 30px; /* 右側のメインコンテンツとの間の余白 */
  margin-left: 0;
  float: none; /* 元のfloatによる回り込み指定を解除します */
}

/* 
  右カラムとなるメインコンテンツエリア(#primary)のスタイルです。 
  flex: 1; を指定して、利用可能な残りのスペースをすべて埋めるようにします。
*/
.home #primary {
  flex: 1; /* 残りのスペースをすべて使う指定 */
  min-width: 0; /* flexアイテム内のコンテンツがはみ出すのを防ぐおまじない */
  float: none; /* 元のfloatによる回り込み指定を解除します */
}

.snav.cf {
    display: none;
}


/* --- スマートフォン表示用の調整 (レスポンシブ対応) --- */
@media screen and (max-width: 767px) {
  /* 画面幅が767px以下の場合は、2カラムを解除して縦積みに戻します */
  .home #main {
    display: block; /* Flexboxを解除し、通常のブロック要素の表示に戻します */
  }

  /* 幅と余白をリセットして、1カラム表示に最適化します */
  .home .columnright,
  .home #primary {
    width: 100%;
    max-width: none;
    margin-right: 0;
  }
}

/* サイトの説明文を非表示 */
.site-description {
	display: none;
}

/* --- ヘッダーのカスタマイズ --- */

/* ヘッダーのコンテナ(.inner)の設定 */
.site-header .inner {
	position: relative; /* ロゴを絶対配置するための基準点 */
	width: 100%; /* 幅を100%にしてロゴの中央揃えの基準にする */
	min-height: 140px; /* ロゴの高さ(100px) + 上下の余白 */
	display: flex;
	align-items: center;
	justify-content: flex-end; /* 右側の要素(.snav)を右端に寄せる */
}

/* ロゴ(h1)を絶対配置で中央に固定 */
.site-title {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
}

/* ロゴ画像のリンク(a)の設定 */
.site-title a {
	display: block;
	width: 100%;
	height: 100px;
	background-image: url('https://zakkat-select.com/wp-content/uploads/logo100.png');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	text-indent: -9999px;
}

/* --- トップページの新着商品カスタマイズ --- */

/* 「T-SELECT」タイトルを非表示 */
.home #primary .entry-title {
	display: none;
}

/* 商品リストを4カラムで表示 */
.home .item-list {
	display: flex;
	flex-wrap: wrap;
	/* アイテム間の余白（gutter）を相殺するためのネガティブマージン */
	margin-left: -10px;
	margin-right: -10px;
}

.home .item-post {
	/* 4カラムにするための幅計算 (100% / 4) - (左右の余白合計) */
	width: calc(25% - 20px);
	/* 左右の余白 */
	margin-left: 10px;
	margin-right: 10px;
	/* 下の余白 */
	margin-bottom: 20px;
}

/* --- スマートフォン表示用の調整 (新着商品) --- */
@media screen and (max-width: 767px) {
	/* 画面幅が767px以下の場合は、2カラム表示に調整 */
	.home .item-post {
		/* 2カラムにするための幅計算 (100% / 2) - (左右の余白合計) */
		width: calc(50% - 20px);
	}
}

/* --- 新着商品の画像高さを揃える --- */

/* 画像を囲むコンテナ(.itemimg)に高さを設定 */
.home .item-post .itemimg {
	height: 180px; /* 高さを180pxに固定 */
	display: flex; /* 中の画像を中央揃えにするため */
	align-items: center;
	justify-content: center;
	background-color: #f9f9f9; /* 画像がない場合や余白の背景色 */
}

/* 画像自体のスタイル */
.home .item-post .itemimg img {
	width: 100%;
	height: 100%;
	object-fit: contain; /* アスペクト比を維持したまま、コンテナ内に収まるように表示 */
}
