/* ===================== Reset / Base ===================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  appearance: none;
}

.back {
  background-color: rgb(196, 196, 196);
}

/* ===================== Footer ===================== */
#footer {
  background-color: rgb(145, 145, 145);
  width: 100%;
  height: 200px;
  padding-top: 2.5vw;
  padding-bottom: 20vw;
}
#logo_footer {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.logo_footer {
  width: 100%;
}
.menu_footer_base {
  margin-top: 1vw;
  margin-left: auto;
  margin-right: auto;
  width: 30vw;
  display: flex;
}
.menu_footer {
  margin-left: auto;
  margin-right: auto;
  font-size: 15px;
  color: #000;
}
.logo_sns_base {
  margin-top: 1.5vw;
  margin-left: auto;
  margin-right: 2vw;
}
.logo_x_base {
  margin-top: 1.5vw;
  margin-left: 2vw;
  margin-right: auto;
}
.logo_sns {
  height: 3vw;
}

/* ===================== Header / Global Nav ===================== */
#header {
  position: relative;
  z-index: 9999;
}

#header_space {
  height: 5vh;
  background-color: #fff;
}

.header_display_flex {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  background-color: #fff;
  opacity: 0.9;
  height: 1.5vw;
  position: fixed;
  z-index: 1;
  margin-bottom: 1vw;
  margin-top: 1vw;
  width: 100%;
}
.header_home_flex {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  opacity: 0.9;
  height: 5vw;
  position: fixed;
  z-index: 1;
  margin-bottom: 1vw;
  margin-top: 1vw;
  width: 100%;
}
.header_logo_base {
  width: 100vw;
  top: 3px;
  z-index: 10;
  margin-left: auto;
  margin-right: auto;
}
.header_logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#header_menu_base {
  width: fit-content;
  margin-left: auto;
  margin-right: 1vw;
}
.menu {
  font-size: 1vw;
  margin-left: 0.5vw;
  color: #373737;
  font-family: "Charter";
  z-index: 2;
}
.cart_logo {
  width: 1vw;
  height: 1vw;
}

/*============================== store ヘッダー（ハンバーガー） ===========================*/
.store-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: transparent;
  box-shadow: none;
  transform: translateY(0);
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  padding: 8px;
  margin-right: 7px;
}
:root {
  --sh-pad: 8px;
  --hh-pad: 10vw;
  --ch-pad: 10vw;
  --btn-size: 30px;
}
.contents-hamburger {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 7px;
  margin-left: 3px;
}

.hamburger-group {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 7px;
  padding-right: 20px;
}

.store-menu {
  display: block;
  padding: 12px 12px;
  border-radius: 6px;
  line-height: 1;
  color: #222;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 12px;
  text-align: center;
}
/* ホバー/フォーカス時の背景色変更 */
.store-menu:hover,
.store-menu:focus-visible {
  background-color: #f0f0f0;
}

.store-menu:active {
  background-color: #e5e5e5;
}

/* カートアイコンの見た目 */
.hamburger-store-cart_logo {
  display: inline-block;
  inline-size: var(--btn-size);
  block-size: var(--btn-size);
  object-fit: contain;
}
.cart-icon {
  height: 100%;
  width: 100%;
}

.store-hamburger {
  width: var(--btn-size);
  height: var(--btn-size);
  display: grid;
  place-items: center;
  /* border-radius: 8px; */
  /* border: 1px solid rgba(0, 0, 0, 0.1); */
  /* background: #fff; */
}
.store-hamburger_line {
  display: block;
  width: 20px;
  height: 2px;
  background: #333;
}
.store-hamburger_line + .store-hamburger_line {
  margin-top: 4px;
}

.store-nav[hidden] {
  display: none !important;
}
.store-nav {
  position: absolute;
  top: var(--sh-pad);
  right: var(--sh-pad);
  width: 105px;
  min-width: 105px;
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform-origin: top right;
}

.home-nav[hidden] {
  display: none !important;
  padding: 5px;
}
.home-nav {
  position: absolute;
  top: var(--hh-pad);
  right: var(--sh-pad);
  width: 105px;
  min-width: 105px;
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform-origin: top right;
}
.contents-nav[hidden] {
  display: none !important;
  padding: 5px;
}
.contents-nav {
  position: absolute;
  top: var(--hh-pad);
  right: var(--ch-pad);
  width: 105px;
  min-width: 105px;
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform-origin: top right;
}

/* ===================== Index (hero) ===================== */
.home_main_body {
  background-color: #fff;
  display: flex;
}
.home_main_text {
  width: 10%;
}
.home_main_image {
  margin-left: auto;
  margin-right: auto;
  height: 80vh;
  background-color: #fff;
  padding-bottom: 10vh;
}
.home_main {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===================== Shared container ===================== */
.all_back {
  padding: 0 10vw 7vh 10vw;
  background-color: rgb(196, 196, 196);
}

/* ===================== Gallery ===================== */
.back_base {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5vw;
  width: 100%;
}
@media (min-width: 980px) {
  .back_base {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.block_base {
  width: 100%;
  aspect-ratio: 29.25 / 42.3;
  position: relative;
  display: block;
}
.photo_frame_base {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  box-shadow: 2px 2px 4px rgb(128 128 128 / 60%);
  margin: auto;
}
.photo_frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo_base {
  background-color: rgb(168, 168, 168);
  height: 66%;
  width: 63%;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
}
.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.main_image {
  width: 100%;
  height: 100%;
  margin-left: auto;
  object-fit: cover;
}

#category_base {
  background-color: rgb(196, 196, 196);
  padding: 2vw 10vw;
}
.category {
  display: flex;
  flex-wrap: wrap;
  background-color: rgb(196, 196, 196);
  border-bottom: solid 1px #373737;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.category_name {
  font-family: "Charter";
  font-size: clamp(20px, 10vw, 48px);
  margin-left: 0.5vw;
  margin-bottom: 5px;
  margin-top: 5px;
}
.search {
  width: fit-content;
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-top: auto;
  margin-bottom: 0.7vw;
  margin-right: 1vw;
  gap: 8px;
}
.new_post {
  font-size: 1vw;
  color: #fff;
  text-align: center;
  border-radius: 2px;
  background-color: rgb(136, 136, 136);
  height: fit-content;
  width: 7vw;
  margin-top: 0.3vw;
  margin-right: 0.8vw;
}

/* ===================== My Page ===================== */
.mypage_category {
  width: 100%;
  background-color: #fff;
  display: flex;
  padding-bottom: 1vw;
  padding-top: 4vw;
}
.mypage_name,
.mypage_icon,
.mypage_menu {
  width: calc(100% / 3);
}
.mypage_menu {
  display: flex;
}
.mypage_menu_title {
  font-family: "Charter";
  border-left: 1px solid #000;
  padding: 10px 8px;
  margin-left: 10vw;
  width: 20vw;
}
.mypage_new_post_base {
  padding-bottom: 0.7vw;
}
.mypage_new_post {
  text-align: center;
  width: 50%;
  font-size: 1vw;
}
.mypage_name_body {
  text-align: center;
  font-family: "Charter";
  font-size: 2vw;
}

/* ========================================== Store ========================================== */
/* 共有 */
#store-back {
  background-color: rgb(196, 196, 196);
  padding-bottom: 30px;
}
.product-title {
  display: flex;
  margin-top: 50px;
}

/* ヒーローイメージ */
#store-hero-image-base {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
  place-items: center;
  background: #fff;
  margin-bottom: -10px;
}
#store-hero-base {
  --hero-gap: 50px;
  position: absolute;
  inset: var(--hero-gap);
  overflow: hidden;
  background: transparent;
}
#store-hero-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
#store-hero-logo-base {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 11001;
  pointer-events: none;
}
#store-hero-logo {
  width: 100vw;
  padding-top: 300px;
}

/* 商品 */
#product {
  margin: 0 10vw;
  padding-top: 10vh;
}

/* コンテナ（白箱） */
.store-fotoflame {
  background: #ffffff;
  padding: 16px;
  width: 100%;
  min-height: 68vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* 3カラム */
.product-grid {
  display: grid;
  gap: 15px;
  height: 100%;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
}
.product-grid > * {
  min-width: 0;
  overflow: hidden;
}

.main_sub_base,
.sub_sub_base,
.info_col {
  height: 100%;
  min-width: 0;
}

/* 右列（説明+購入） */
.info_col {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  min-height: 0;
}
.info-card {
  background-color: rgb(228, 228, 228);
  padding: 14px;
  font-size: small;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 画像 */
.main_sub_base img,
.sub_sub_base .frame > img,
.sub_sub_image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.main_sub_base {
  position: relative;
  width: 100%;
  /* 比率は既存のまま */
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.sub_sub_base {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.sub_sub_base .frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* カート（商品説明側） */
.store_cart .catalog-card__form {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: 10px;
  align-items: center;
  justify-items: end;
  margin-top: 10px;
}
.store_cart .catalog-card__form input[type="number"] {
  width: auto;
  min-width: 70px;
  text-align: right;
}
.store_cart .catalog-card__form button {
  width: auto;
  justify-self: end;
  padding: 8px 14px;
}

/* ---------- Refill ---------- */
.store-fotoflame .store-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
}
.catalog-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 15px;
}
.catalog-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.catalog-card__body {
  background-color: rgb(228, 228, 228);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}
.catalog-card__title {
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.catalog-card__form {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
}
.catalog-card__form input[type="number"] {
  inline-size: 3ch;
  min-inline-size: 64px;
  max-inline-size: 120px;
  padding: 6px 8px;
  text-align: right;
  flex: 0 0 auto;
}
.store_cart .catalog-card__form input[type="number"] {
  inline-size: 3ch;
}
.catalog-card__form button {
  width: auto;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.catalog-card__form button:hover {
  background: #f7f7f7;
}

/* ========================================== Modal (gallery / mypage) ========================================== */
.myModal {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  place-items: center;
}
.myModal.is-open {
  display: grid;
}

.modal {
  position: relative;
  background: rgb(214, 214, 214);
  border-radius: 10px;
  width: 720px;
  height: 600px;
  box-shadow: 0 20px 60px rgba(62, 62, 62, 0.35);
  display: grid;
  grid-template-columns: 420px 1fr;
  align-items: stretch;
  column-gap: 0;
}
.caption-base {
  grid-column: 2;
  position: relative;
  z-index: 2;
  width: 330px;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
  margin-left: -80px;
}
.caption-padding {
  background-color: rgb(255, 255, 255);
  height: 100%;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: 24px 70px 0px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.caption-top {
  margin-top: 80px;
}
#galleryTitle {
  font-size: clamp(16px, 2.2vw, 18px);
  border-bottom: solid 2px;
  border-color: #3f3f3f;
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: bold;
  padding: 5px;
  margin: 5px;
  text-align: center;
}
#galleryComment {
  font-size: clamp(12px, 1.8vw, 14px);
  margin-bottom: 10px;
}

.user_icon_base {
  flex: 0 0 auto;
  overflow: hidden;
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  line-height: 0;
}
#userPage {
  color: #fff;
}
.modal_user_icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.caption-user {
  background-color: #8a8a8a;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.05s;
  border-radius: 3px;
}
.caption-user:hover {
  background-color: #737373;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.caption-user:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset;
}
.caption-user #userPage {
  color: #fff;
  text-decoration: none;
}

.modal_main_photo {
  grid-column: 1;
  margin-left: 30px;
  justify-self: center;
  align-self: center;
  position: relative;
  z-index: 3;
}
.modalPhoto_frame_base {
  background-color: #ffffff;
  position: relative;
  width: 330px;
  aspect-ratio: 29.25 / 42.3;
  z-index: 1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.modalPhoto_frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.modalPhoto_base {
  background-color: #000;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 63%;
  aspect-ratio: 29.25 / 44;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modalPhoto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.caption-cart {
  display: block;
  padding-bottom: 20px;
}
.caption-cart form {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}
#cart-quantity {
  width: 40px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
}
.add-cart {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.55rem 1rem;
  border-radius: 1px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #8a8a8a;
  color: #fff;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.05s ease;
  font-size: small;
  margin-left: auto;
}
.add-cart:hover {
  background: #3f3f3f;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.add-cart:active {
  background: #757575;
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset;
}
.add-cart:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(181, 181, 181, 0.5);
}
.add-cart:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===================== Media Queries ===================== */

/* store レイアウト（幅が狭いときは縦積み） */
@media (max-width: 1020px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  .sub_sub_base {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
    height: auto;
  }
  .sub_sub_base .frame {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  /* ---- 1020px以下で info-card を横並び（2カラム）に ---- */
  .info_col {
    display: grid;
    grid-template-rows: none;
    grid-template-columns: 3fr 1fr;
    gap: 12px;
    align-items: stretch;
    min-height: 0;
  }
  .info_col > .info-card {
    min-width: 0;
    min-height: 0;
  }

  .info_col .product-title {
    margin-top: 0;
  }

  #cart-quantity {
    width: 54px;
    padding: 10px 12px;
    font-size: 16px;
  }
  .add-cart {
    margin-left: 0;
    flex: 1 1 auto;
    justify-content: center;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* モーダルウィンドウ */
  .modal {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 80vw;
    max-width: 100%;
    height: auto;
    padding: 50px 0 30px 0;
    gap: 14px;
  }
  .modal_main_photo {
    order: 1;
    margin-left: 0;
    align-self: center;
  }

  .modalPhoto_frame_base {
    width: 50vw;
  }

  /* Refill カードの列数 */
  .store-fotoflame .store-catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .store-fotoflame .store-catalog-grid {
    grid-template-columns: 1fr;
  }

  /* キャプション修正 */
  .caption-padding {
    padding: 0 50px;
    height: 100%;
  }

  .caption-base {
    order: 2;
    width: 60vw;
    margin-left: 0;
    padding: 30px 0 30px 0;
    background-color: rgb(255, 255, 255);
    height: 30vh;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }
  .caption-top {
    margin-top: 0;
  }
  .caption-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  .caption-user {
    order: -1;
    justify-content: center;
    gap: 12px;
    padding: 12px 14px;
  }
  .caption-cart form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
  }
}
/* 745px以下では再び縦積み（1カラム）に戻す */
@media (max-width: 745px) {
  .info_col {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .home_main_image {
    height: 90vh;
    margin-top: 20px;
  }

  /* 745px以下：カート内は“数量＋ボタン”を横並びに（右寄せ） */
  .store_cart .catalog-card__form {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-left: 0;
  }
  .store_cart .catalog-card__form input[type="number"] {
    width: auto;
    min-width: 72px;
    text-align: right;
  }

  .store_cart .catalog-card__form button {
    width: auto;
    padding: 10px 14px;
  }
}

/* Modal: PC 横並び時の調整 */
@media (min-width: 1060px) {
  .modal {
    align-items: stretch;
  }
  .modal_main_photo {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
