body {
  font-family: sans-serif;
  margin: 0;
}

header, footer {
  background-color: #ffffff;
  /* padding: 10px 20px; */
}

.header-top {
  display: flex;
  align-items: center;
  padding: 10px 40px;
  border-bottom: 1px solid #ccc;
  background-color: #fff;
  gap: 20px;
}

.search-bar input {
  width: 300px;
  padding: 5px;
}

.main {
  display: flex;
  padding: 20px;
}

.sidebar {
  width: 200px;
}

.content {
  flex: 1;
}

.banner {
  width: 100%;
  height: 150px;
  background-color: #f3f3f3;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.product {
  display: inline-block;
  width: 150px;
  margin: 10px;
  vertical-align: top;
}

.product a {
  display: block;
  width: 100%;
}

.product-image-wrapper {
  width: 150px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
  position: relative;
}

.product img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
}

.review {
  clear: both;
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
  margin-top: 10px;
}


/* 3カラムレイアウト用 */
.main-3col {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.sidebar {
  width: 20%;
}

.content {
  width: 50%;
}

.recommend-column {
  width: 30%;
}

.recommend-column .recommend {
  width: 100%;
}

.main-3col > .recommend {
  width: 30%;
}

/* TOP 右列：.recommend-column の全体 30% 指定を上書き（スタック内は列全幅） */
.main-3col--top .gm-right-stack .recommend-column {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* gm_ad_unit: 推薦の言葉の上の動画枠 */
.gm-sidebar-ads {
  margin-bottom: 18px;
}
/* 動画下: 公開タイトル・登録リンク */
.gm-ad-meta {
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.gm-ad-public-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  color: #222;
}
.gm-ad-link-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.gm-ad-link-url {
  color: #1a4a7a;
  font-weight: 600;
  text-decoration: none;
}
.gm-ad-link-url:hover {
  text-decoration: underline;
}
.gm-ad-caption a,
.gm-ad-link-cta {
  color: #1a4a7a;
  font-weight: 600;
  text-decoration: none;
}
.gm-ad-caption a:hover,
.gm-ad-link-cta:hover {
  text-decoration: underline;
}
.gm-ad-card {
  margin-bottom: 16px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}
/* 管理画面（gm_ad_unit）の display_scale に対応 */
.gm-sidebar-ads .gm-ad-card.gm-ad-scale-full {
  width: 100%;
  max-width: 100%;
}
.gm-sidebar-ads .gm-ad-card.gm-ad-scale-large {
  width: 92%;
  max-width: 92%;
  margin-left: auto;
  margin-right: auto;
}
.gm-sidebar-ads .gm-ad-card.gm-ad-scale-medium {
  width: 84%;
  max-width: 84%;
  margin-left: auto;
  margin-right: auto;
}
.gm-sidebar-ads .gm-ad-card.gm-ad-scale-small {
  width: 70%;
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
}
.gm-ad-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}
.gm-ad-embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.gm-ad-video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}
.gm-ad-caption {
  margin: 0;
  padding: 8px 10px 10px;
  font-size: 13px;
  color: #444;
  line-height: 1.45;
}

/*
 * TOPのみ（main-3col--top）
 * PC: 3列1行 Grid（右列は .gm-right-stack で広告＋推薦を縦並び）。隣接する2行 Grid に分けると商品の高さで行が伸びて変な空白になるため。
 * SP: .gm-right-stack を display:contents でフラット化し order で「広告→商品→推薦」。
 */
@media screen and (min-width: 769px) {
  .main-3col.main-3col--top {
    display: grid !important;
    /* ジャンル : 登録商品 : 右列（動画＋推薦）≈ 20% : 50% : 30% */
    grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) minmax(0, 3fr);
    grid-template-rows: auto;
    gap: 20px;
    align-items: start;
    align-content: start;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .main-3col--top > .sidebar {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    width: auto !important;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .main-3col--top > .content {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: auto !important;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .main-3col--top > .gm-right-stack {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .main-3col--top .gm-right-stack .gm-sidebar-ads {
    margin-bottom: 0;
  }
}

@media screen and (max-width: 768px) {
  .main-3col.main-3col--top {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .main-3col--top > .sidebar {
    display: none !important;
  }

  /* フラット化して広告・推薦を中央カラムと並べ、order で並び替え */
  .main-3col--top > .gm-right-stack {
    display: contents;
  }

  .main-3col--top > .gm-sidebar-ads {
    order: 1;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 12px 12px 0;
    min-height: 0;
    min-width: 0 !important;
  }

  .main-3col--top > .content {
    order: 2;
    flex: 0 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .main-3col--top > .recommend-column {
    order: 3;
    flex: 0 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .main-3col--top .recommend {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 12px 16px;
  }
}

@media screen and (max-width: 480px) {
  .main-3col.main-3col--top {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .main-3col--top > .content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .main-3col--top > .gm-sidebar-ads {
    width: 100% !important;
    max-width: 100% !important;
  }

  .main-3col--top > .recommend-column {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ヘッダー内のロゴとテキスト整列用 */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 15px;
  gap: 20px;
}

.header-left img {
  height: auto;
  width: 180px;
  margin-bottom: 2px;
}

.header-left span {
  display: none;
}

.header-left small {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
  text-align: left;
}

.header-right {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
}