/* 全体のリセットと基本設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background-color: #ffffff;
  color: #333333;
  line-height: 1.5;
  padding: 10px;
}

/* コンテナ設定（レスポンシブ） */
.coupon-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

/* ヘッダー部分 */
.coupon-header h1 {
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 5px;
}

.instruction {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.1em;
  margin: 5px 0;
}

/* 水玉の区切り線 */
.dot-divider {
  letter-spacing: 5px;
  color: #b0b0b0;
  font-size: 12px;
  margin: 5px 0;
}
.dot-divider::after {
  content: "● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●";
  display: block;
  overflow: hidden;
  white-space: nowrap;
}

.footer-divider {
  margin-top: 20px;
}

/* クーポン本体の枠（二重線風） */
.coupon-card {
  border: 1px solid #333;
  padding: 3px;
  margin: 15px auto;
  background: #fff;
}

.coupon-card-inner {
  border: 1px solid #333;
  padding: 15px 10px;
  position: relative;
  overflow: hidden;
}

/* 左上リボン & ナンバー表示 */
.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.service-ribbon {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: #fff;
  padding: 4px 15px;
  font-size: 11px;
  font-style: italic;
  font-weight: bold;
  transform: skewX(-20px);
  margin-left: -15px;
}

.service-ribbon span {
  display: inline-block;
  transform: skewX(20px);
}

.service-ribbon span span {
  color: #fff200;
  font-size: 13px;
  font-style: normal;
}

.serial-number {
  font-size: 11px;
  font-family: monospace;
}

/* 店舗名 */
.shop-name {
  font-size: 18px;
  margin-bottom: 15px;
  letter-spacing: 0.05em;
}

/* 特典内容ボックス */
.benefit-box {
  position: relative;
  margin: 0 auto 15px auto;
  max-width: 580px;
}

.benefit-label {
  position: absolute;
  top: -8px;
  left: 10px;
  background-color: #636e72;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
}

.benefit-content {
  background-color: #ffffcc;
  border: 1px solid #ccc;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: bold;
}

/* 店舗情報 */
.shop-info {
  font-size: 11px;
  color: #333;
  margin-bottom: 15px;
}

/* クーポンフッターのアイコン群 */
.card-footer-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dotted #ccc;
  padding-top: 10px;
  font-size: 12px;
}

.icon-strip {
  color: #b2bec3;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 3px;
}

.bank-logo {
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  margin: 0 10px;
  white-space: nowrap;
}

.logo-mark {
  background-color: #2d3436;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  margin-right: 5px;
}

/* アクションボタン */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.btn {
  border-radius: 20px;
  padding: 8px 30px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
  min-width: 160px;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.8;
}

.btn-back {
  background: linear-gradient(to bottom, #3498db, #2980b9);
}

.btn-print {
  background: linear-gradient(to bottom, #3498db, #2980b9);
}

/* フッター */
.site-footer {
  font-size: 10px;
  color: #666;
  margin-top: 15px;
}

/* 📱 レスポンシブ対応（スマホサイズでの微調整） */
@media (max-width: 600px) {
  .coupon-header h1 {
    font-size: 14px;
  }
  .shop-name {
    font-size: 15px;
  }
  .benefit-content {
    font-size: 12px;
  }
  .icon-strip {
    display: none;
  }
  .card-footer-icons {
    justify-content: center;
  }
  .action-buttons {
    gap: 15px;
  }
  .btn {
    width: 100%;
    max-width: 260px;
  }
}

/* ==========================================================================
   🖨️ 印刷画面専用設定（指定エリア以外を完全に除外）
   ========================================================================== */
@media print {
  /* 1. ページ全体の不要な外枠や余白、他のCMS要素をすべて非表示にする */
  body * {
    visibility: hidden;
  }
  
  /* 2. クーポンエリア（#print-area）とその子要素だけを印刷対象として有効化する */
  #print-area, #print-area * {
    visibility: visible;
  }

  /* 3. 印刷位置を紙の左上にぴったり合わせ、余計な余白を消去する */
  body, .coupon-container {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
  }

  /* 4. クーポンの背景グラデーションやセールの黄色を、印刷時にも強制適用 */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 5. 印刷時はスマホ用のアイコン非表示を解除し、全て綺麗に出力 */
  .icon-strip {
    display: block !important;
  }
}
