/**
 * Fixperts - 제품 헤더 섹션 스타일
 */

/* 헤더 고정 해제 (이 페이지에서만) */
.header {
  position: static;
}

/* 제품 헤더 섹션 */
.product-header {
  background: var(--color-bg-primary);
  border-radius: var(--border-radius-md);
  display: grid;
  grid-template-columns: 280px 1fr; /* 이미지 영역 너비 (조정 가능: 200px ~ 320px) */
  align-items: stretch;
  margin: 20px 0 20px 20px;
  width: calc(100% - 20px); /* 왼쪽 마진 20px 포함해 부모 영역 안에 맞춤 */
  min-width: 0; /* 그리드가 부모보다 넘치지 않도록 */
}

/* 제품 이미지 영역 */
.product-header__image-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-header__main-image {
  width: 100%;
  height: 100%;
  min-height: 220px; /* 이미지 최소 높이 (조정 가능) */
  background: transparent;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-header__main-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 제품 정보 영역 */
.product-header__info-area {
  display: flex;
  flex-direction: column;
  justify-content: center; /* main-info 세로 중앙 정렬 */
  gap: 8px;
  height: 100%;
  min-width: 0; /* 그리드 셀이 부모 영역을 넘지 않도록 */
  overflow: hidden; /* 긴 콘텐츠가 영역 밖으로 나가지 않도록 */
  overflow-wrap: break-word; /* 긴 단어도 영역 안에서 줄바꿈 */
  padding: 0 0 0 30px;
  margin: 0 0 0 30px;
  border-left: 1px solid var(--color-border-light);
}

.product-header__main-info {
  flex-shrink: 0;
}

/* 제품 제목 섹션 */
.product-header__title-section {
  margin: 15px 0px 15px 0px;
  padding: 0 0 15px 0;
}

.product-header__title {
  font-size: var(--font-size-title);
  font-weight: bold;
  margin: 0;
  color: var(--color-text-dark);
}

.product-header__info-line {
  margin: 15px 0px 30px 0px;
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.product-header__info-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-header__info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.product-header__spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--color-bg-gray-50);
  padding: 5px 10px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.product-header__spec-label {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--color-text-tertiary);
}

.product-header__spec-label::after {
  content: ':';
  margin-right: 2px;
}

.product-header__brand-logo {
  width: 80px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
}

.product-header__brand-text {
  display: inline;
}

/* =============================================================================
   모바일 반응형 스타일
   ============================================================================= */

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
  .product-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-header__info-area {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
  }

  .product-header__main-image {
    min-height: 250px;
  }

  .product-header__main-image img {
    max-width: 100%;
    max-height: 100%;
    padding: 12px;
  }

  .product-header__title-section {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin: 20px 0px 12px 0px;
  }

  .product-header__title {
    font-size: var(--font-size-4xl);
    margin: 0;
    flex: 1;
  }

  .product-header__quick-actions {
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
  }

  /* 모바일: 정보 항목 2열 그리드 (제조사·카테고리 / 제품코드·출시 / 등록일·조회수) */
  .product-header__info-line {
    font-size: var(--font-size-base);
    margin: 12px 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .product-header__info-content {
    display: contents;
  }

  .product-header__info-row {
    display: contents;
  }

  .product-header__spec-badge {
    white-space: normal;
    word-break: break-word;
  }

  .product-header__info-actions {
    gap: 10px;
  }

  .product-header__action-row {
    width: 100%;
  }

  .product-header__action-btn {
    flex: 1;
    min-width: auto;
  }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
  .product-header__main-image {
    min-height: 220px;
  }

  .product-header__main-image img {
    max-width: 100%;
    max-height: 100%;
    padding: 5px;
  }

  .product-header__title-section {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0px;
    border-top: 1px solid var(--color-border-divider);
    border-bottom: 1px solid var(--color-border-divider);
    padding: 20px 0px;
  }

  .product-header__title {
    font-size: var(--font-size-xl);
    margin: 0;
    text-align: center;
  }

  .product-header__info-line {
    font-size: var(--font-size-sm);
    gap: 10px;
    margin: 20px 0px;
    border-top: 1px solid var(--color-border-divider);
    border-bottom: 1px solid var(--color-border-divider);
    padding: 20px 0px;
    justify-content: center;
  }

  .product-header__info-content {
    justify-content: center;
  }

  .product-header__info-row {
    justify-content: center;
  }
}
