/* 
 * 보험 페이지 스타일
 */

/* ========================================
   Main Layout
======================================== */
.main-layout {
  background-color: var(--color-gray-50);
  padding: var(--spacing-10) 0;
  min-height: calc(100vh - var(--header-height));
}

.layout-container {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-12);
  display: flex;
  gap: var(--spacing-8);
}

/* ========================================
   Ad Banners
======================================== */
.left-ad, .right-ad {
  width: var(--layout-side-ad);
  flex-shrink: 0;
}

.ad-sticky {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-8));
}

.ad-card {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4);
  color: var(--color-white);
  cursor: pointer;
  transition: opacity 0.2s;
}

.ad-card:hover {
  opacity: 0.9;
}

.ad-blue {
  background: linear-gradient(135deg, var(--color-ad-blue-from) 0%, var(--color-ad-blue-to) 100%);
}

.ad-green {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.ad-icon {
  margin-bottom: var(--spacing-3);
}

.ad-title {
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-1);
}

.ad-subtitle {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-medium);
  opacity: 0.9;
  margin-bottom: var(--spacing-3);
}

.ad-desc {
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-regular);
  opacity: 0.8;
  text-align: center;
  line-height: 1.6;
}

.ad-cta {
  margin-top: var(--spacing-4);
  padding: 6px var(--spacing-4);
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-11);
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 1279px) {
  .left-ad, .right-ad {
    display: none;
  }
  
  .layout-container {
    justify-content: center;
  }
}

/* ========================================
   Main Content
======================================== */
.main-content {
  flex: 1;
  max-width: var(--layout-main-content);
}

/* ========================================
   Tab Navigation
======================================== */
.tab-navigation {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-6);
}

.tab-buttons {
  display: flex;
  border-bottom: 1px solid #E8E8E8;
}

.tab-btn {
  flex: 1;
  padding: var(--spacing-4) 0;
  font-size: var(--font-size-20); /* #91: 탭 텍스트 더 크게 */
  font-weight: var(--font-weight-bold); /* #91: 더 진하게 */
  color: #999999;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  font-family: var(--font-family);
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-icon {
  margin-bottom: 4px;
}

/* ========================================
   Tab Content
======================================== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.content-title {
  font-size: var(--font-size-24);
  font-weight: var(--font-weight-bold);
  color: #212121;
  margin-bottom: var(--spacing-6);
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

/* ========================================
   Product Card
======================================== */
.product-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-6);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-3);
}

.product-badges {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.product-badge {
  padding: 4px var(--spacing-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-semibold);
}

.badge-category {
  background-color: var(--color-gray-100);
  color: var(--color-primary);
}

.badge-tag {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.product-price {
  text-align: right;
}

.product-price-label {
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-medium);
  color: #999999;
  margin-bottom: 2px;
}

.product-price-value {
  font-size: var(--font-size-20);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.product-title {
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-bold);
  color: #212121;
  margin-bottom: var(--spacing-2);
  line-height: 1.4;
}

.product-description {
  font-size: var(--font-size-15);
  font-weight: var(--font-weight-medium);
  color: #4b5563;
  margin-bottom: var(--spacing-3);
  line-height: 1.55;
}

.product-company {
  font-size: var(--font-size-15);
  font-weight: var(--font-weight-medium);
  color: #6b7280;
}

/* ========================================
   Bottom Spacing
======================================== */
.bottom-spacing {
  height: 48px;
  background-color: var(--color-gray-50);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 768px) {
  .tab-btn {
    font-size: var(--font-size-16);
    padding: var(--spacing-3) 0;
  }
  
  .tab-icon {
    width: 18px;
    height: 18px;
  }
}

/* ── 상품 카드 (product-card) ──────────────────────────────── */
.products-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 0;
}

/* 프리미엄·스페셜 카드는 전체 너비(full-row) */
.products-list a.product-card[data-tier="premium"],
.products-list a.product-card[data-tier="special"] {
  grid-column: 1 / -1;
}

/* 모바일: 1열로 */
@media (max-width: 600px) {
  .products-list { grid-template-columns: 1fr; }
  .products-list a.product-card[data-tier="premium"],
  .products-list a.product-card[data-tier="special"] { grid-column: auto; }
}

a.product-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  overflow: hidden;
}
/* 이미지가 있는 카드: 가로 배치 */
a.product-card.has-thumb {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
a.product-card.has-thumb .product-body { flex: 1; min-width: 0; }

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

/* ── 상품 카드 썸네일 ──────────────────────────────────────── */
.product-thumb {
  flex-shrink: 0;
  width: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-badge {
  display: inline-block;
  font-size:13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.6;
}

.badge-category { background: #eff6ff; color: #2563eb; }
.badge-tag      { background: #fef3c7; color: #d97706; }

.product-price { text-align: right; flex-shrink: 0; }
.product-price-label { font-size:14px; color: #6b7280; margin: 0; }
.product-price-value { font-size: 18px; font-weight: 700; color: #1e40af; margin: 0; }

.product-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
  line-height: 1.4;
}

.product-description {
  font-size: 14px;
  color: #4b5563;
  margin: 0 0 6px;
  line-height: 1.55;
}

.product-company {
  font-size:14px;
  color: #6b7280;
  margin: 0;
}

/* ── 탭 스타일 ──────────────────────────────────────────────── */
.tab-navigation {
  background: #fff;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 20px;
}

.tab-buttons {
  display: flex;
  gap: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 800;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

.tab-btn:hover { color: #374151; }
.tab-icon { flex-shrink: 0; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.content-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px;
}

/* ── 반응형 ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tab-btn { padding: 12px 14px; font-size: 16px; font-weight: 800; }
  .tab-label { display: none; }
  a.product-card { padding: 14px; }
  a.product-card.has-thumb { gap: 12px; }
  .product-thumb { width: 90px; }
  .product-title { font-size: 15px; }
  .product-description { font-size: 13px; }
  .product-price-value { font-size: 15px; }
}

/* ── 공용 ad-card 보정 ──────────────────────────────────────── */
.ad-icon-wrap { margin-bottom: 12px; }
.ad-icon-wrap svg { display: block; }

/* ── 우측 배너 추가 색상 (DB 연동 — 패치5) ─────────────────────── */
.ad-orange {
  background: linear-gradient(135deg, var(--color-ad-orange-from, #EA580C) 0%, var(--color-ad-orange-to, #F97316) 100%);
}
.ad-cyan {
  background: linear-gradient(135deg, var(--color-ad-cyan-from, #00B4D8) 0%, var(--color-ad-cyan-to, #0077B6) 100%);
}
.ad-purple {
  background: linear-gradient(135deg, #9D4EDD 0%, #7209B7 100%);
}

/* ── 티어 배지 (insurance.js v3) ──────────────────────────── */
.it-tier-badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:20px;font-size:13px;font-weight:700;margin-right:4px;}
.it-tier-premium{background:#F59E0B;color:#fff;}
.it-tier-special{background:#8B5CF6;color:#fff;}
.it-tier-general{background:#10B981;color:#fff;}
