/* =======================================
 * 1. グローバル設定とベーススタイル
 * ======================================= */
:root {
  --color-primary: #3498db;
  --color-secondary: #2c3e50;
  --color-accent: #e74c3c;
  --color-text-light: #ecf0f1;
  --color-background-light: #ffffff;
  --font-family-sans: "Helvetica Neue", Arial, sans-serif;
}

.common-body {
  margin: 0;
  padding: 0;
  background-color: #f4f7f9;
  font-family: var(--font-family-sans);
  line-height: 1.6;
}

.common-body.is-shop {
  background-color: white;
}

@media screen and (max-width: 768px) {
  .common-body {
    padding-top: 60px;
  }
}

/* ===================================================================
 * 共通ヘッダースタイル
 * =================================================================== */
.common-top-area {
  background-color: var(--color-background-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 10px 0 0 0;
  z-index: 1001;
  display: block;
}

.common-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.common-header-title {
  font-size: 1.5rem;
  margin: 0;
  font-weight: bold;
}

.common-header-title a {
  color: var(--color-secondary);
  white-space: nowrap;
  padding: 5px 0;
  display: block;
}

.common-header-title a:hover {
  color: var(--color-primary);
}

/* ===================================================================
 * 共通ナビゲーションバー
 * =================================================================== */
.common-nav-fixed-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: var(--color-background-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.is-shop .common-nav-fixed-bar {
  margin: 0;
}

.common-nav-content {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  padding: 5px 0;
}

.common-nav__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.common-nav__list li {
  margin-left: 20px;
  padding: 5px 0;
}

.common-nav__list.is-release li {
    padding: 10px 0;
}

.common-nav__list .menu-link {
  display: inline-block;
  padding: 5px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-secondary);
  position: relative;
}

.common-nav__list .menu-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.common-nav__list .menu-link:hover::after,
.common-nav__list .menu-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.common-nav__static-items {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0 0 0 20px;
  margin: 0;
  gap: 20px;
}

/* ===================================================================
 * .is-release 専用スタイル (検索フォーム)
 * =================================================================== */
.common-nav__list.is-release .search-bar-item {
  margin-left: 20px !important;
}

.is-release .search-form {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 20px;
  overflow: hidden;
  background-color: #fff;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  padding-right: 1px;
}

.is-release .search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.is-release .search-label {
  display: contents;
}

.is-release input.search-field {
  border: none;
  padding: 8px 15px;
  font-size: 0.9rem;
  outline: none;
  width: 250px;
}

.is-release input.search-field:focus {
  border-style: none;
}

.is-release .search-submit {
  background-color: var(--color-primary);
  border: none;
  cursor: pointer;
  height: 35px;
  width: 35px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.is-release .search-submit:hover {
  background-color: #2980b9;
}

.is-release .search-icon {
  width: 18px;
  height: 18px;
  stroke: var(--color-text-light);
}

.is-release .searchwp-live-search-results {
  position: fixed !important;
  top: var(--header-bottom, 53px) !important;
  left: 83% !important;
  transform: translateX(-50%) !important;
  width: 300px !important;
  max-width: none !important;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 8px 8px;
}

/* ===================================================================
 * .is-shop 専用スタイル (カート・ログイン)
 * =================================================================== */
.is-shop .nav-link {
  display: flex;
  align-items: center;
}

.is-shop .nav-link svg {
  width: 24px;
  height: 24px;
  margin-bottom: 7px;
  fill: var(--color-secondary);
}

.is-shop .dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
  padding-top: 5px;
  padding-bottom: 5px;
}

.is-shop .dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
  top: 5px;
}

/* Categoryメニュー */
.is-shop #menu-item-12130 > a {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  position: relative !important;
  padding-right: 0 !important;
  white-space: nowrap !important;
}

.is-shop #menu-item-12130 > a::after {
  content: '' !important;
  position: absolute !important;
  bottom: -3px !important;
  left: 0 !important;
  width: calc(100% - 22px) !important;
  height: 2px !important;
  background-color: var(--color-primary) !important;
  transform: scaleX(0) !important;
  transition: transform 0.3s ease !important;
  transform-origin: left !important;
  z-index: 1;
}

.is-shop #menu-item-12130 > a::before {
  content: "\25BC" !important;
  font-size: 10px !important;
  color: #333 !important;
  margin-left: 8px !important;
  display: inline-block !important;
  line-height: 1 !important;
  order: 2 !important;
  transition: transform 0.3s ease !important;
}

.is-shop #menu-item-12130.is-open > a::before {
  transform: rotate(180deg) !important;
}

.is-shop #menu-item-12130 .dropdown-menu-toggle {
  display: none !important;
}

@media screen and (min-width: 769px) {
  .is-shop #menu-item-12130 {
    position: relative;
  }
  
  .is-shop #menu-item-12130 > .sub-menu {
    position: absolute;
    top: 100%;
    left: -30px;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    padding: 10px 0;
    list-style: none;
  }
}

.is-shop #menu-item-12130.is-open > .sub-menu {
  display: block !important;
}

/* ===================================================================
 * モバイルメニュー - デフォルトで非表示
 * =================================================================== */
.mobile-common-header-title {
  display: none;
}

.menu-toggle-input,
.menu-toggle-label {
  display: none;
}

.hamburger-icon {
  display: inline-block;
  width: 24px;
  height: 3px;
  background-color: #333;
  position: relative;
  vertical-align: middle;
  transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 3px;
  background-color: #333;
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease, background-color 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

/* ===================================================================
 * レスポンシブ: タブレット (1024px以下)
 * =================================================================== */
@media (max-width: 1024px) {
  .common-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .common-header-title {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
}

/* ===================================================================
 * レスポンシブ: モバイル (768px以下) - 共通
 * =================================================================== */
@media screen and (max-width: 768px) {
  .common-top-area {
    display: none;
  }

  .mobile-common-header-title {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    order: 1;
  }

  .mobile-common-header-title a {
    color: var(--color-secondary);
    text-decoration: none;
  }

  .common-nav-fixed-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  .menu-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    order: 2;
  }

  .menu-toggle-input:checked ~ .menu-toggle-label .hamburger-icon {
    background-color: transparent;
  }

  .menu-toggle-input:checked ~ .menu-toggle-label .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .menu-toggle-input:checked ~ .menu-toggle-label .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }
}

/* ===================================================================
 * モバイル: .is-release 専用
 * =================================================================== */
@media screen and (max-width: 768px) {
  .common-nav-content:has(.is-release) {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 400px;
    background-color: #f4f7f9;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
  }

  .menu-toggle-input:checked ~ .common-nav-content:has(.is-release) {
    transform: translateX(0);
  }

  .is-release .search-bar-item {
    margin-left: 0 !important;
    padding: 10px 0 0 0 !important;
    border-bottom: none !important;
    order: -1;
  }

  .is-release .search-form {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }

  .is-release .search-field {
    flex-grow: 1;
    width: auto;
  }

  .is-release .searchwp-live-search-results {
    position: fixed !important;
    top: 100px !important;
    left: 250px !important;
  }

  .common-nav-content:has(.is-release) ul {
    flex-direction: column;
    text-align: center;
    padding: 10px 0;
  }

  .common-nav-content:has(.is-release) ul li {
    order: 10;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .common-nav-content:has(.is-release) .common-nav__list {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
  }

  .common-nav-content:has(.is-release) .common-nav__list li {
    width: 100%;
    margin-left: 0;
    border-bottom: 1px dashed #ddd;
    text-align: left;
    padding: 10px 0;
  }

  .is-release .menu-link::after {
    content: none;
  }

  .common-nav-content:has(.is-release) .common-nav__static-items {
    order: 1;
    border-bottom: 2px solid #eee;
    width: 90%;
    padding-bottom: 20px;
    margin: 0 auto;
  }

  .common-nav-content:has(.is-release) .common-nav {
    order: 2;
  }
}

/* ===================================================================
 * モバイル: .is-shop 専用
 * =================================================================== */
@media screen and (max-width: 768px) {
  .common-nav-content:has(.is-shop) {
    display: contents;
  }

  .common-nav-content:has(.is-shop) .common-nav__static-items {
    display: flex !important;
    position: fixed !important;
    right: 60px;
    top: 30px;
    transform: translateY(-50%);
    gap: 15px;
    z-index: 1001;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
  }

  .is-shop .common-nav__static-items svg {
    width: 24px;
    height: 24px;
    fill: var(--color-secondary);
  }

  .common-nav-content:has(.is-shop) .common-nav {
    position: fixed;
    top: 60px;
    right: 0;
    width: 80%;
    max-width: 400px;
    height: calc(100vh - 60px);
    background-color: #f4f7f9;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  }

  .menu-toggle-input:checked ~ .common-nav-content:has(.is-shop) .common-nav {
    transform: translateX(0);
  }

  .common-nav-content:has(.is-shop) .common-nav__list {
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 80px !important;
    list-style: none;
  }

  .common-nav-content:has(.is-shop) .common-nav__list li {
    width: 100%;
    border-bottom: 1px dashed #ddd;
    text-align: left !important;
    padding: 10px 0;
  }

  .is-shop .common-nav__list .menu-link {
    display: block;
    padding: 15px 0;
    text-decoration: none;
    color: var(--color-secondary);
  }

  .is-shop .common-nav__list .sub-menu {
    display: none;
    list-style: none;
    padding-left: 20px !important;
  }

  .is-shop .common-nav__list .menu-item-has-children.is-open > .sub-menu {
    display: block !important;
  }

  .is-shop .common-nav__list .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .is-shop .common-nav__list .menu-item-has-children > a::after {
    content: '\25BC';
    font-size: 10px;
    transition: transform 0.3s ease;
  }

  .is-shop .common-nav__list .menu-item-has-children.is-open > a::after {
    transform: rotate(180deg);
  }

  .is-shop #menu-item-12111 {
    order: -1 !important;
    padding: 15px 0 !important;
    border-bottom: 2px solid #eee !important;
    width: 100% !important;
  }

  .is-shop .common-nav__list .menu-item:not(#menu-item-12111) {
    order: 1 !important;
  }

  .common-nav-content:has(.is-shop) ul {
    display: none;
    flex-direction: row !important;
    padding-top: 5px !important;
    list-style: none;
  }

  .is-shop .nav-link svg {
    width: 28px !important;  /* ここに好きな数値を入力 */
    height: 28px !important;
    display: block;
  }

  .is-shop .dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
    top: 3px;
  }
}
