@charset "UTF-8";
/*
    Template: swell
    Theme Name: SWELL CHILD
    Theme URI: https://swell-theme.com/
    Description: SWELLの子テーマ
    Version: 1.0.0
    Author: LOOS WEB STUDIO
    Author URI: https://loos-web-studio.com/

    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/

/* ===== カタログ一覧ページのスタイル ===== */

/* ヘッダー */
.catalog-archive-header {
  margin-bottom: 30px;
  text-align: center;
}

.catalog-archive-title {
  font-size: 2em;
  color: #333;
  margin-bottom: 20px;
  font-weight: bold;
}

/* カタログ種別タブ */
.catalog-type-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.catalog-type-tab {
  padding: 12px 25px;
  background: #fff;
  color: var(--color_main);
  border: 2px solid var(--color_main);
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-type-tab:hover,
.catalog-type-tab.active {
  background: var(--color_main);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
}

/* カテゴリタブ */
.catalog-category-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  margin-top: 15px;
}

.catalog-tab {
  padding: 10px 20px;
  background: #fff;
  color: #d4a574;
  border: 1px solid #d4a574;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.catalog-tab:hover,
.catalog-tab.active {
  background: #d4a574;
  color: white;
  text-decoration: none;
}

/* 件数表示 */
.catalog-count-info {
  text-align: center;
  margin-bottom: 30px;
  font-size: 16px;
  color: #666;
}

.current-category {
  color: #d4a574;
  font-weight: bold;
}

/* メルカリ風グリッド */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.catalog-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #eee;
}

.catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.catalog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.catalog-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.catalog-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f8f8;
}

.catalog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-card-image img {
  transform: scale(1.05);
}

.catalog-number-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(212, 165, 116, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.catalog-card-content {
  padding: 15px;
}

.catalog-card-title {
  font-size: 14px;
  color: #333;
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
  word-break: break-word;
}

/* ページネーション修正版 */
.catalog-pagination {
  text-align: center !important;
  margin-top: 40px !important;
}

.catalog-pagination .page-numbers {
  display: inline-flex !important; /* inline-block から inline-flex に変更 */
  align-items: center !important; /* 縦方向中央揃え追加 */
  justify-content: center !important; /* 横方向中央揃え追加 */
  padding: 10px 15px !important;
  margin: 0 5px !important;
  background: #fff !important;
  color: #d4a574 !important;
  border: 1px solid #d4a574 !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  min-width: 40px !important;
  min-height: 40px !important; /* 最小高さ追加 */
  line-height: 1 !important; /* line-heightリセット */
  vertical-align: top !important;
  float: none !important;
  box-sizing: border-box !important;
}

.catalog-pagination .page-numbers:hover,
.catalog-pagination .page-numbers.current {
  background: #d4a574 !important;
  color: white !important;
  text-decoration: none !important;
}

.catalog-pagination .page-numbers.dots {
  border: none !important;
  background: none !important;
  color: #666 !important;
  cursor: default !important;
}

.catalog-pagination .page-numbers.prev,
.catalog-pagination .page-numbers.next {
  padding: 10px 20px !important;
  min-width: auto !important;
}

/* WordPressデフォルトのページネーション構造に対応 */
.catalog-pagination div {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
}

/* 追加の強制修正 */
.catalog-pagination * {
  box-sizing: border-box !important;
}

.catalog-pagination::after {
  content: "";
  display: table;
  clear: both;
}

/* 結果なし */
.catalog-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.catalog-no-results p {
  font-size: 16px;
  margin-bottom: 20px;
}

.catalog-no-results a {
  color: #d4a574;
  text-decoration: none;
}

.catalog-no-results a:hover {
  text-decoration: underline;
}

/* ===== カタログ詳細ページのスタイル ===== */

/* QRコードセクション */
.catalog-qr-section {
  margin: 30px 0;
  padding: 20px;
  background: #f8f5f0;
  border: 1px solid #d4a574;
  border-radius: 8px;
  text-align: center;
}

.catalog-qr-title {
  color: #d4a574;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.catalog-qr-description {
  color: #666;
  font-size: 14px;
  margin-top: 10px;
}

.pdf-container {
  margin: 0 auto; /* 中央寄せ */
}

.pdf-container iframe {
  width: 100%; /* コンテナに合わせて拡大縮小 */
  height: 1300px;
  border: none; /* 枠線なし */
}

/* ===== レスポンシブ対応 ===== */

@media (max-width: 768px) {
  /* グリッド調整 */
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .catalog-card-image {
    height: 150px;
  }

  .catalog-card-content {
    padding: 12px;
  }

  .catalog-card-title {
    font-size: 13px;
  }

  /* タブ調整 */
  .catalog-type-tabs {
    gap: 8px;
  }

  .catalog-type-tab {
    padding: 10px 20px;
    font-size: 14px;
  }

  .catalog-category-tabs {
    gap: 8px;
  }

  .catalog-tab {
    padding: 8px 15px;
    font-size: 13px;
  }

  .catalog-archive-title {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .catalog-card-image {
    height: 120px;
  }

  .catalog-card-content {
    padding: 10px;
  }

  .catalog-card-title {
    font-size: 12px;
  }

  .pdf-container iframe {
    height: 800px;
  }
}

/* カタログ種別表示用スタイル */
.catalog-type-name {
  color: var(--color_main);
  font-weight: bold;
  font-size: 1.1em;
}

.catalog-separator {
  color: #999;
  margin: 0 5px;
}

.catalog-current-info {
  line-height: 1.6;
}
/* 改良版カタログPDF表示スタイル */
.catalog-pdf-section {
  margin: 20px 0;
  background: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
}

.pdf-controls {
  background: #f0f0f0;
  padding: 15px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.pdf-control-buttons {
  margin-bottom: 10px;
}

.pdf-control-buttons .c-btn {
  margin: 0 5px 5px;
  background: #d4a574;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
}

.pdf-control-buttons .c-btn:hover {
  background: #b8956b;
  text-decoration: none;
  color: white;
}

.pdf-file-size {
  color: #666;
  font-size: 14px;
}

/* ローディング表示 */
.pdf-loading {
  text-align: center;
  padding: 50px;
  background: #fff;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d4a574;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 埋め込み表示スタイル */
.pdf-container {
  background: #fff;
  min-height: 400px;
}

.embedded-view .pdf-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 141.42%; /* デフォルトA4比率、PHPで動的に変更 */
}

.embedded-view .pdf-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* 画像表示スタイル */
.image-view {
  padding: 20px;
}

.pdf-image-controls {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f8f8;
  border-radius: 5px;
}

.zoom-btn {
  background: #d4a574;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin: 0 10px;
}

.zoom-btn:hover {
  background: #b8956b;
}

#pdf-zoom-level {
  display: inline-block;
  min-width: 60px;
  font-weight: bold;
  color: #333;
}

.pdf-as-image {
  text-align: center;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f5f5f5;
  max-height: 80vh;
}

.pdf-as-image img {
  max-width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ダウンロード表示スタイル */
.download-view {
  padding: 40px;
  text-align: center;
}

.pdf-download-message h4 {
  color: #333;
  margin-bottom: 15px;
}

.pdf-download-message p {
  color: #666;
  margin-bottom: 20px;
}

.download-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.download-options .c-btn {
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  border: none;
  font-weight: bold;
}

.c-btn--primary {
  background: #d4a574;
  color: white;
}

.c-btn--secondary {
  background: #fff;
  color: #d4a574;
  border: 2px solid #d4a574;
}

.c-btn--primary:hover {
  background: #b8956b;
  color: white;
  text-decoration: none;
}

.c-btn--secondary:hover {
  background: #d4a574;
  color: white;
  text-decoration: none;
}

/* フルスクリーン表示 */
.pdf-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.pdf-fullscreen iframe {
  width: 95%;
  height: 95%;
  background: white;
  border-radius: 5px;
}

.pdf-fullscreen .close-fullscreen {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #d4a574;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .catalog-pdf-section {
    margin: 15px -10px;
    border-radius: 0;
  }

  .pdf-controls {
    padding: 10px;
  }

  .pdf-control-buttons .c-btn {
    font-size: 14px;
    padding: 6px 12px;
    margin: 2px;
  }

  .image-view {
    padding: 15px;
  }

  .download-options {
    flex-direction: column;
    align-items: center;
  }

  .download-options .c-btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .pdf-control-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .pdf-control-buttons .c-btn {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
}

/* スマホPDF表示修正（最終版） */
@media (max-width: 768px) {
  .catalog-pdf-section .pdf-container {
    height: 70vh !important;
    overflow: hidden !important;
  }
  
  .catalog-pdf-section iframe {
    width: 120% !important;
    height: 120% !important;
    transform: scale(0.83) !important;
    transform-origin: 0 0 !important;
  }
}

@media (max-width: 480px) {
  .catalog-pdf-section .pdf-container {
    height: 60vh !important;
  }
  
  .catalog-pdf-section iframe {
    width: 140% !important;
    height: 140% !important;
    transform: scale(0.71) !important;
  }
}