/* =========================================================
   TAKEKATA農園  Responsive Enhancement Layer
   - style.css / style-home.css を上書き＆強化するだけの追加レイヤー
   - 不要になった場合は <link rel="stylesheet" href="style-responsive.css"> を1行外せば元に戻る
   - 統一ブレイクポイント:  sm 480 / md 640 / lg 960 / xl 1200
   ========================================================= */

:root {
  /* breakpoints (CSS変数として使う場面はないが、文書化目的) */
  --bp-sm:  480px;
  --bp-md:  640px;
  --bp-lg:  960px;
  --bp-xl: 1200px;

  /* mobile sticky CTA 用の余白 */
  --tk-mcta-h: 0px;
}

/* ===== 全体: iOS Safari の横揺れ防止＆スムーズスクロール ===== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}

/* iOS で input/select が拡大しないよう最低 16px を保証 */
@media (max-width: 760px) {
  input, select, textarea, button {
    font-size: max(16px, 1rem);
  }
}

/* タップ時のハイライト除去（Androidの青い四角） */
a, button, summary, label {
  -webkit-tap-highlight-color: transparent;
}

/* ===== ヒーロー画像セクション（rice/strawberry 共通） ===== */
.page-hero-img {
  padding: clamp(0.6rem, 2vw, 1.4rem) 1rem 0;
}
.page-hero-img img {
  max-width: min(960px, 100%);
  margin: 0 auto;
  display: block;
}
@media (max-width: 640px) {
  .page-hero-img img { width: 100%; }
}

/* =========================================================
   Shop hero block: 我が家自慢の産直米 / 採りたてイチゴ
   ========================================================= */
.shop-hero-block {
  border-radius: clamp(14px, 2vw, 22px);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(45, 80, 22, 0.06);
}

.shop-hero-head {
  padding: clamp(1rem, 3vw, 1.6rem) clamp(1.1rem, 3vw, 1.8rem);
}

.shop-hero-head h2 {
  font-size: clamp(1.35rem, 4.2vw, 1.9rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.shop-hero-body {
  padding: clamp(1.1rem, 3vw, 1.8rem) clamp(1.1rem, 3vw, 1.8rem) clamp(1.3rem, 3vw, 2rem);
}

.shop-hero-body p {
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.85;
}

/* =========================================================
   Gallery: モバイルは横スクロールスナップ、タブレット以上はグリッド
   ========================================================= */
.shop-gallery {
  margin-top: clamp(1.2rem, 3vw, 1.75rem);
  gap: clamp(0.5rem, 2vw, 0.85rem);
}

@media (max-width: 640px) {
  .shop-gallery {
    display: grid;
    grid-template-columns: repeat(8, 78%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1rem;
    padding: 0.25rem 1rem 1rem;
    margin-inline: calc(-1 * clamp(1rem, 3vw, 1.6rem));
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shop-gallery::-webkit-scrollbar { display: none; }
  .shop-gallery img {
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(80, 60, 20, 0.10);
  }
}

/* タップで開くライトボックス用 */
.shop-gallery img {
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.3s ease;
}
.shop-gallery img:active { transform: scale(0.98); }

/* ===== Lightbox ===== */
.tk-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 12, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}
.tk-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tk-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1);
}
.tk-lightbox.is-open img { transform: scale(1); }
.tk-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #2d5016;
  font-size: 1.6rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* =========================================================
   Product card: モバイル最適化
   ========================================================= */
@media (max-width: 640px) {
  .shop-card {
    padding: 1.2rem 1.1rem 1.3rem;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(45, 80, 22, 0.06);
  }
  .shop-card-name {
    font-size: 1.18rem;
    line-height: 1.4;
  }
  .shop-card-price {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }
  .shop-card-price .amount {
    font-size: 2.1rem;
  }
  .shop-field select,
  .shop-field input[type="number"] {
    padding: 0.85rem 0.95rem;
    border-radius: 10px;
    min-height: 48px;
  }
  .shop-card-submit {
    min-height: 52px;
    font-size: 1rem;
    padding: 0.95rem 1rem;
    box-shadow: 0 4px 14px rgba(74, 124, 58, 0.25);
  }
  .shop-card-submit:active {
    transform: scale(0.98);
  }
}

/* desktop: hover を少し豪華に */
@media (min-width: 961px) {
  .shop-card {
    transition: transform 0.35s cubic-bezier(.2,.7,.2,1),
                box-shadow 0.35s cubic-bezier(.2,.7,.2,1),
                border-color 0.25s ease;
  }
  .shop-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(45, 80, 22, 0.14);
  }
}

/* =========================================================
   Products section head: モバイルで読みやすく
   ========================================================= */
@media (max-width: 640px) {
  .shop-products-head {
    align-items: flex-start;
  }
  .shop-products-head .variety-mark--img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }
  .shop-products-head .variety-name {
    font-size: 1.25rem;
    line-height: 1.45;
  }
  .shop-products-head .variety-desc {
    font-size: 0.86rem;
    line-height: 1.7;
    display: block;
    margin-top: 0.4rem;
  }
}

/* =========================================================
   Notes (お買い物の前に): モバイルで読みやすく
   ========================================================= */
@media (max-width: 640px) {
  .shop-notes {
    padding: 1.2rem 1.1rem;
    border-radius: 14px;
  }
  .shop-notes h3 {
    font-size: 1.05rem;
  }
  .shop-notes li {
    font-size: 0.9rem;
    line-height: 1.75;
  }
}

/* =========================================================
   Info accordion: タップ領域を48px以上に
   ========================================================= */
.shop-info-item summary {
  min-height: 52px;
  padding-block: clamp(0.9rem, 2.5vw, 1.05rem);
}

@media (max-width: 640px) {
  .shop-info-grid { gap: 0.7rem; }
  .shop-info-item summary { font-size: 1rem; }
  .shop-info-body { font-size: 0.92rem; }
}

/* =========================================================
   送料テーブル（rice）: モバイルで横スクロール可能に
   ========================================================= */
.shop-shipping-table-rice {
  display: table;
  width: 100%;
}
@media (max-width: 520px) {
  #shipping-rice-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .shop-shipping-table-rice { min-width: 460px; }
}

/* =========================================================
   既存 cart-bar の見た目を少しリッチに
   ========================================================= */
.shop-cart-bar {
  margin-top: clamp(1.5rem, 4vw, 2.2rem);
  display: flex;
  justify-content: center;
}
.shop-cart-link {
  border-radius: 999px;
  padding: 0.95rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5a9046, #4a7c3a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(74, 124, 58, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shop-cart-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(74, 124, 58, 0.35);
}

/* =========================================================
   モバイル固定 CTA: 画面下に「カートを見る (件数)」を常時表示
   - カートに1件以上ある時だけ data-cart-count > 0 で表示
   - body に .has-mcta が付いたら有効化
   ========================================================= */
.tk-mcta {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  width: calc(100% - 1.6rem);
  max-width: 480px;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #5a9046, #2d5016);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 0.98rem;
  box-shadow: 0 10px 30px rgba(20, 50, 10, 0.30), 0 2px 6px rgba(20, 50, 10, 0.15);
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}
.tk-mcta.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.tk-mcta-ico {
  width: 22px; height: 22px; flex-shrink: 0;
}
.tk-mcta-label { flex: 1; }
.tk-mcta-count {
  background: rgba(255,255,255,0.18);
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
}
.tk-mcta-arrow { font-size: 1.1rem; opacity: 0.9; }

/* イチゴショップでは赤系 */
.shop-section--strawberry ~ .tk-mcta,
body.is-strawberry .tk-mcta {
  background: linear-gradient(135deg, #e85d75, #b83838);
  box-shadow: 0 10px 30px rgba(184, 56, 56, 0.30), 0 2px 6px rgba(184, 56, 56, 0.15);
}

/* モバイル以外では非表示 */
@media (min-width: 768px) {
  .tk-mcta { display: none; }
}

/* mcta 表示中はフッター下部に余白を確保（被り防止） */
body.has-mcta { padding-bottom: 5rem; }
@media (min-width: 768px) {
  body.has-mcta { padding-bottom: 0; }
}

/* =========================================================
   Scroll reveal: 軽量フェードイン
   - .tk-reveal を付けた要素が visible になったら opacity:1 / translateY:0
   ========================================================= */
.tk-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1),
              transform 0.7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.tk-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tk-reveal[data-delay="1"].is-visible { transition-delay: 0.08s; }
.tk-reveal[data-delay="2"].is-visible { transition-delay: 0.16s; }
.tk-reveal[data-delay="3"].is-visible { transition-delay: 0.24s; }
.tk-reveal[data-delay="4"].is-visible { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .tk-reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   ヘッダー: モバイルでロゴを縮め、ナビ展開を滑らかに
   ========================================================= */
@media (max-width: 760px) {
  .tk-header-inner {
    padding: 0.55rem 0.9rem;
    gap: 0.8rem;
  }
  .tk-logo img { width: 38px; height: 38px; }
  .tk-logo-name { font-size: 1rem; }

  /* 閉じた状態：max-height だけだと padding 分（約24px）がヘッダー下に漏れて
     ナビ項目が見切れて見えてしまう。padding / border / visibility も完全に畳む。 */
  .tk-nav {
    padding-top: 0;
    padding-bottom: 0;
    border-top: 0;
    visibility: hidden;
    box-sizing: border-box;
    transition: max-height 0.4s cubic-bezier(.2,.7,.2,1),
                padding 0.4s cubic-bezier(.2,.7,.2,1),
                visibility 0s linear 0.4s;
  }
  /* 開いた状態：余白・境界線・表示を復元（:checked で specificity も勝つ） */
  .tk-nav-toggle:checked ~ .tk-nav {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--tk-green-pale);
    visibility: visible;
    transition: max-height 0.4s cubic-bezier(.2,.7,.2,1),
                padding 0.4s cubic-bezier(.2,.7,.2,1),
                visibility 0s;
  }
  .tk-nav a {
    font-size: 1rem;
    padding: 1rem 0.5rem;
    transition: background 0.2s ease;
  }
  .tk-nav a:active { background: var(--tk-green-cream); }
  .tk-nav a.tk-nav-cart,
  .tk-nav a.tk-nav-contact {
    margin-top: 0.6rem;
    padding: 0.9rem 1rem;
    text-align: center;
    justify-content: center;
  }
}

/* =========================================================
   Footer: モバイルで詰めすぎないよう調整
   ========================================================= */
@media (max-width: 640px) {
  .tk-footer { padding: 1.5rem 1rem 2rem; }
  .tk-footer-nav { gap: 0.85rem 1.2rem; }
  .tk-footer-nav a { font-size: 0.9rem; padding: 0.3rem 0; }
}

/* =========================================================
   汎用: コンテナの左右余白をモバイルで詰めて画面端まで活用
   ========================================================= */
.container, .tk-wrap {
  padding-left: clamp(1rem, 4vw, 1.6rem);
  padding-right: clamp(1rem, 4vw, 1.6rem);
}

/* セクション間の余白を画面サイズに応じて滑らかに */
.shop-section {
  padding-top: clamp(1.6rem, 5vw, 3rem);
  padding-bottom: clamp(2.4rem, 7vw, 4rem);
}

/* =========================================================
   Toast: より目立つ・スマホで下に出す
   ========================================================= */
.shop-toast {
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(20, 50, 10, 0.25);
}
@media (max-width: 640px) {
  .shop-toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(120%);
    bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
    top: auto;
    width: calc(100% - 1.6rem);
    max-width: 420px;
    text-align: center;
  }
  .shop-toast.is-visible {
    transform: translateX(-50%) translateY(0);
  }
}
